diff options
author | Vlad Uspensky <v.uspenskiy@icloud.com> | 2017-07-27 09:22:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 09:22:50 -0700 |
commit | e120d1b2ffbf42b5b809b69a2201b3b8dd1a1ef9 (patch) | |
tree | 8d782fdb79c56615dcaf052e7a4bd0cfd7f4d5ef /src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory | |
parent | 56209581161e4cc2f83f85b52bd573dd25bb7201 (diff) | |
parent | 4c7b4102dede53b9707fe3758a4a9ff9ccf87bf8 (diff) | |
download | rest-query-e120d1b2ffbf42b5b809b69a2201b3b8dd1a1ef9.tar.gz rest-query-e120d1b2ffbf42b5b809b69a2201b3b8dd1a1ef9.tar.bz2 rest-query-e120d1b2ffbf42b5b809b69a2201b3b8dd1a1ef9.zip |
Merge pull request #10 from drivergroup/PDSUI-2145v0.2.7
PDSUI-2145 Create own user history for Documents and Medical Records
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory/ApiDocumentHistory.scala | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory/ApiDocumentHistory.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory/ApiDocumentHistory.scala new file mode 100644 index 0000000..5aae774 --- /dev/null +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/documenthistory/ApiDocumentHistory.scala @@ -0,0 +1,27 @@ +package xyz.driver.pdsuidomain.formats.json.documenthistory + +import java.time.{ZoneId, ZonedDateTime} + +import play.api.libs.json.{Format, Json} +import xyz.driver.pdsuidomain.entities.DocumentHistory + +final case class ApiDocumentHistory(id: Long, + executor: String, + documentId: Long, + state: String, + action: String, + created: ZonedDateTime) + +object ApiDocumentHistory { + implicit val format: Format[ApiDocumentHistory] = + Json.format[ApiDocumentHistory] + + def fromDomain(x: DocumentHistory) = ApiDocumentHistory( + id = x.id.id, + executor = x.executor.id, + documentId = x.documentId.id, + state = DocumentHistory.State.stateToString(x.state), + action = DocumentHistory.Action.actionToString(x.action), + created = ZonedDateTime.of(x.created, ZoneId.of("Z")) + ) +} |