aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/entities/Label.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/entities/Label.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/entities/Label.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/entities/Label.scala34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/entities/Label.scala b/src/main/scala/xyz/driver/pdsuidomain/entities/Label.scala
new file mode 100644
index 0000000..7f9c2aa
--- /dev/null
+++ b/src/main/scala/xyz/driver/pdsuidomain/entities/Label.scala
@@ -0,0 +1,34 @@
+package xyz.driver.pdsuidomain.entities
+
+import xyz.driver.pdsuicommon.domain.LongId
+import xyz.driver.pdsuicommon.logging._
+
+final case class Category(id: LongId[Category], name: String)
+
+object Category {
+ implicit def toPhiString(x: Category): PhiString = {
+ import x._
+ phi"Category(id=$id, name=${Unsafe(name)})"
+ }
+}
+
+final case class Label(id: LongId[Label],
+ categoryId: LongId[Category],
+ name: String,
+ description: String)
+
+object Label {
+ implicit def toPhiString(x: Label): PhiString = {
+ import x._
+ phi"Label($id, categoryId=${Unsafe(categoryId)}, name=${Unsafe(name)}, description=${Unsafe(description)})"
+ }
+}
+
+final case class CategoryWithLabels(category: Category, labels: List[Label])
+
+object CategoryWithLabels {
+ implicit def toPhiString(x: CategoryWithLabels): PhiString = {
+ import x._
+ phi"CategoryWithLabels(category=$category, labels=$labels)"
+ }
+}