blob: 5aae7742c9541320bab34069761bc418c0a20fb4 (
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
|
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"))
)
}
|