aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/services/CategoryService.scala
diff options
context:
space:
mode:
authorvlad <vlad@driver.xyz>2017-06-13 16:12:20 -0700
committervlad <vlad@driver.xyz>2017-06-13 16:12:20 -0700
commitcd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c (patch)
tree062e8dad1a1513e26b0fd08b1742d6ff2ee874f7 /src/main/scala/xyz/driver/pdsuidomain/services/CategoryService.scala
parent0000a65ab4479a2a40e2d6468036438e9705b4aa (diff)
downloadrest-query-cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c.tar.gz
rest-query-cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c.tar.bz2
rest-query-cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c.zip
Adding domain entitiesv0.1.0
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/CategoryService.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/services/CategoryService.scala28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/CategoryService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/CategoryService.scala
new file mode 100644
index 0000000..31ccff7
--- /dev/null
+++ b/src/main/scala/xyz/driver/pdsuidomain/services/CategoryService.scala
@@ -0,0 +1,28 @@
+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._
+import xyz.driver.pdsuidomain.entities.CategoryWithLabels
+
+import scala.concurrent.Future
+
+object CategoryService {
+ sealed trait GetListReply
+ object GetListReply {
+ case class EntityList(xs: Seq[CategoryWithLabels], totalFound: Int) extends GetListReply
+
+ case object AuthorizationError
+ extends GetListReply with DomainError.AuthorizationError {
+ def userMessage: String = "Access denied"
+ }
+ }
+}
+
+trait CategoryService extends PhiLogging {
+
+ import CategoryService._
+
+ def getAll(sorting: Option[Sorting] = None)(implicit requestContext: AuthenticatedRequestContext): Future[GetListReply]
+}