diff options
author | Aleksandr <ognelisar@gmail.com> | 2017-10-12 10:44:54 +0700 |
---|---|---|
committer | Aleksandr <ognelisar@gmail.com> | 2017-10-12 10:44:54 +0700 |
commit | f525ab2604cc5d1366c852bdbcb4d912bbcea800 (patch) | |
tree | 4fe4b35e1f474e2dc85a8885dc4c9002f3ea46c2 /src/main/scala/xyz/driver/pdsuidomain/formats/json/record/ApiRecord.scala | |
parent | 9198729ebf3d20b650b4467daa0d484a3148f01c (diff) | |
parent | e15415d69ec990d5243e58704e232e619b80aa6f (diff) | |
download | rest-query-f525ab2604cc5d1366c852bdbcb4d912bbcea800.tar.gz rest-query-f525ab2604cc5d1366c852bdbcb4d912bbcea800.tar.bz2 rest-query-f525ab2604cc5d1366c852bdbcb4d912bbcea800.zip |
All merge conflicts are resolved
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/record/ApiRecord.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/formats/json/record/ApiRecord.scala | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/record/ApiRecord.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/record/ApiRecord.scala index fc0a2e7..00441a1 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/record/ApiRecord.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/record/ApiRecord.scala @@ -41,7 +41,8 @@ object ApiRecord { (JsPath \ "requestId").format[UUID] and (JsPath \ "meta").format(Format(Reads { x => JsSuccess(Json.stringify(x)) - }, Writes[String](Json.parse))) + }, Writes[String](Json.parse))) and + (JsPath \ "totalPages").format[Int] )(ApiRecord.apply, unlift(ApiRecord.unapply)) def fromDomain(record: MedicalRecord) = ApiRecord( @@ -57,7 +58,8 @@ object ApiRecord { previousAssignee = record.previousAssignee.map(_.id), lastActiveUser = record.lastActiveUserId.map(_.id), requestId = record.requestId.id, - meta = record.meta.map(x => JsonSerializer.serialize(x.content)).getOrElse(emptyMeta) + meta = record.meta.map(x => JsonSerializer.serialize(x.content)).getOrElse(emptyMeta), + totalPages = record.totalPages ) } @@ -73,7 +75,8 @@ final case class ApiRecord(id: Long, previousAssignee: Option[String], lastActiveUser: Option[String], requestId: UUID, - meta: String) { + meta: String, + totalPages: Int) { private def extractStatus(status: String): Status = Status @@ -101,6 +104,7 @@ final case class ApiRecord(id: Long, Some(TextJson(JsonSerializer.deserialize[List[MedicalRecord.Meta]](this.meta))) } }, - lastUpdate = this.lastUpdate.toLocalDateTime() + lastUpdate = this.lastUpdate.toLocalDateTime, + totalPages = 0 ) } |