aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/entities/Keyword.scala
blob: a984f926977120d6ca94dd5ba91dada1a561f0b6 (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
32
package xyz.driver.pdsuidomain.entities

import xyz.driver.entities.labels.Label
import xyz.driver.pdsuicommon.domain.LongId
import xyz.driver.pdsuicommon.logging._

final case class Keyword(id: LongId[Keyword], keyword: String)

object Keyword {
  implicit def toPhiString(x: Keyword): PhiString = {
    import x._
    phi"Keyword(id=$id, keyword=${Unsafe(keyword)})"
  }
}

final case class KeywordWithLabels(keyword: Keyword, labels: List[Label])

object KeywordWithLabels {
  implicit def toPhiString(x: KeywordWithLabels): PhiString = {
    import x._
    phi"KeywordWithLabels(keyword=$keyword, ${Unsafe(labels)}"
  }
}

final case class KeywordLabel(keywordId: LongId[Keyword], labelId: LongId[Label])

object KeywordLabel {
  implicit def toPhiString(x: KeywordLabel): PhiString = {
    import x._
    phi"KeywordLabel($keywordId, $labelId)"
  }
}