aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory.scala29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory.scala
new file mode 100644
index 0000000..a0eb3f5
--- /dev/null
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory.scala
@@ -0,0 +1,29 @@
+package xyz.driver.pdsuidomain.formats.json
+
+import spray.json._
+import xyz.driver.core.json.EnumJsonFormat
+import xyz.driver.pdsuidomain.entities._
+
+object documenthistory {
+ import DefaultJsonProtocol._
+ import DocumentHistory._
+ import common._
+
+ implicit val documentStateFormat = new EnumJsonFormat[State](
+ "Extract" -> State.Extract,
+ "Review" -> State.Review,
+ "Flag" -> State.Flag
+ )
+
+ implicit val documentActionFormat = new EnumJsonFormat[Action](
+ "Start" -> Action.Start,
+ "Submit" -> Action.Submit,
+ "Unassign" -> Action.Unassign,
+ "Resolve" -> Action.Resolve,
+ "Flag" -> Action.Flag,
+ "Archive" -> Action.Archive
+ )
+
+ implicit val documentHistoryFormat: RootJsonFormat[DocumentHistory] = jsonFormat6(DocumentHistory.apply)
+
+}