aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/entities/Label.scala
blob: eea39de1cd2738dd70668ab1bd41296fb1da2649 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)"
  }
}