diff options
author | Jakob Odersky <jakob@odersky.com> | 2017-08-14 22:29:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 22:29:45 -0700 |
commit | 322ea28ecf5ad5f65d3376f3e97e004d229d4736 (patch) | |
tree | c405d10d70f4ec1f18ffa81bc01cd8da64bddcba /src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documenthistory.scala | |
parent | be74ae7c5531af998d38b9de8052791f17b25341 (diff) | |
parent | 442579b27ccbac82cb001a5b02402a593d005977 (diff) | |
download | rest-query-322ea28ecf5ad5f65d3376f3e97e004d229d4736.tar.gz rest-query-322ea28ecf5ad5f65d3376f3e97e004d229d4736.tar.bz2 rest-query-322ea28ecf5ad5f65d3376f3e97e004d229d4736.zip |
Merge pull request #18 from drivergroup/PDSUI-2188
PDSUI-2188 Create spray json formats for domain entities
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documenthistory.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documenthistory.scala | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documenthistory.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documenthistory.scala new file mode 100644 index 0000000..419c252 --- /dev/null +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/documenthistory.scala @@ -0,0 +1,29 @@ +package xyz.driver.pdsuidomain.formats.json.sprayformats + +import spray.json._ +import xyz.driver.core.json.EnumJsonFormat +import xyz.driver.pdsuidomain.entities._ + +object documenthistory { + import DefaultJsonProtocol._ + import common._ + import DocumentHistory._ + + 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) + +} |