aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocument.scala
diff options
context:
space:
mode:
authorKseniya Tomskikh <ktomskih@datamonsters.co>2017-10-05 14:56:08 +0700
committerGitHub <noreply@github.com>2017-10-05 14:56:08 +0700
commit98dd8b171aee84c88754ea1a8ec20524ad579d7c (patch)
tree8d6983473c12c4bbdff3fdc1b22e64feb82b0993 /src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocument.scala
parent7d6376873a5bdeca2c9a67f0a0db99faa78b5967 (diff)
parent6f4de1ccfb6efe8f9ddbaec6551a9138a6efa6f8 (diff)
downloadrest-query-98dd8b171aee84c88754ea1a8ec20524ad579d7c.tar.gz
rest-query-98dd8b171aee84c88754ea1a8ec20524ad579d7c.tar.bz2
rest-query-98dd8b171aee84c88754ea1a8ec20524ad579d7c.zip
Merge pull request #39 from drivergroup/PDSUI-2268
PDSUI-2268 Added institution field to document
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocument.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocument.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocument.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocument.scala
index 1869ff3..3f1ecfe 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocument.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocument.scala
@@ -2,7 +2,6 @@ package xyz.driver.pdsuidomain.formats.json.document
import java.time.{LocalDate, ZoneId, ZonedDateTime}
import xyz.driver.pdsuicommon.domain.{LongId, StringId, TextJson}
-import xyz.driver.pdsuicommon.json.JsonSerializer
import xyz.driver.pdsuidomain.entities._
import play.api.data.validation.ValidationError
@@ -20,6 +19,7 @@ final case class ApiDocument(id: Long,
provider: Option[String],
providerTypeId: Option[Long],
requiredType: Option[String],
+ institutionName: Option[String],
status: Option[String],
previousStatus: Option[String],
assignee: Option[String],
@@ -46,6 +46,7 @@ final case class ApiDocument(id: Long,
providerName = this.provider,
providerTypeId = this.providerTypeId.map(LongId(_)),
requiredType = this.requiredType.map(extractRequiredType),
+ institutionName = this.institutionName,
meta = this.meta.map(x => TextJson(JsonSerializer.deserialize[Document.Meta](x))),
startDate = this.startDate,
endDate = this.endDate,
@@ -74,6 +75,7 @@ object ApiDocument {
(JsPath \ "provider").formatNullable[String] and
(JsPath \ "providerTypeId").formatNullable[Long] and
(JsPath \ "requiredType").formatNullable[String] and
+ (JsPath \ "institutionName").formatNullable[String] and
(JsPath \ "status").formatNullable(statusFormat) and
(JsPath \ "previousStatus").formatNullable(statusFormat) and
(JsPath \ "assignee").formatNullable[String] and
@@ -96,6 +98,7 @@ object ApiDocument {
provider = document.providerName,
providerTypeId = document.providerTypeId.map(_.id),
requiredType = document.requiredType.map(Document.RequiredType.requiredTypeToString),
+ institutionName = document.institutionName,
status = Option(Document.Status.statusToString(document.status)),
previousStatus = document.previousStatus.map(Document.Status.statusToString),
assignee = document.assignee.map(_.id),