From cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c Mon Sep 17 00:00:00 2001 From: vlad Date: Tue, 13 Jun 2017 16:12:20 -0700 Subject: Adding domain entities --- .../driver/pdsuidomain/services/LabelService.scala | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main/scala/xyz/driver/pdsuidomain/services/LabelService.scala (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/LabelService.scala') diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/LabelService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/LabelService.scala new file mode 100644 index 0000000..25291f1 --- /dev/null +++ b/src/main/scala/xyz/driver/pdsuidomain/services/LabelService.scala @@ -0,0 +1,29 @@ +package xyz.driver.pdsuidomain.services + +import xyz.driver.pdsuicommon.auth.AuthenticatedRequestContext +import xyz.driver.pdsuicommon.db.Sorting +import xyz.driver.pdsuicommon.error.DomainError +import xyz.driver.pdsuicommon.logging.PhiLogging +import xyz.driver.pdsuidomain.entities.Label + +import scala.concurrent.Future + +object LabelService { + + sealed trait GetListReply + object GetListReply { + case class EntityList(xs: Seq[Label], totalFound: Int) extends GetListReply + + case object AuthorizationError + extends GetListReply with DomainError.AuthorizationError { + def userMessage: String = "Access denied" + } + } +} + +trait LabelService extends PhiLogging { + import LabelService._ + + def getAll(sorting: Option[Sorting] = None) + (implicit requestContext: AuthenticatedRequestContext): Future[GetListReply] +} -- cgit v1.2.3