aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory.scala
blob: 1652f7b0231c60f559db983919ce7828bb003e02 (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
33
34
35
package xyz.driver.pdsuidomain.formats.json

import spray.json._
import xyz.driver.core.json._
import xyz.driver.pdsuidomain.entities._

object documenthistory {
  import DefaultJsonProtocol._
  import DocumentHistory._
  import common._

  implicit val documentStateFormat = new EnumJsonFormat[State](
    "New"     -> State.New,
    "Extract" -> State.Extract,
    "Done"    -> State.Done,
    "Review"  -> State.Review,
    "Flag"    -> State.Flag,
    "Archive" -> State.Archive
  )

  implicit val documentActionFormat = new EnumJsonFormat[Action](
    "Start"          -> Action.Start,
    "Submit"         -> Action.Submit,
    "Unassign"       -> Action.Unassign,
    "Resolve"        -> Action.Resolve,
    "Flag"           -> Action.Flag,
    "Archive"        -> Action.Archive,
    "PostEvidence"   -> Action.PostEvidence,
    "CreateDocument" -> Action.CreateDocument,
    "ReadDocument"   -> Action.ReadDocument
  )

  implicit val documentHistoryFormat: RootJsonFormat[DocumentHistory] = jsonFormat6(DocumentHistory.apply)

}