diff options
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/document')
4 files changed, 15 insertions, 13 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 be9c65b..0fd96b3 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 @@ -28,7 +28,7 @@ object ApiDocument { private val statusFormat = Format( Reads.StringReads.filter(ValidationError("unknown status")) { case x if DocumentUtils.statusFromString.isDefinedAt(x) => true - case _ => false + case _ => false }, Writes.StringWrites ) @@ -47,8 +47,10 @@ object ApiDocument { (JsPath \ "previousStatus").formatNullable(statusFormat) and (JsPath \ "assignee").formatNullable[Long] and (JsPath \ "previousAssignee").formatNullable[Long] and - (JsPath \ "meta").formatNullable(Format(Reads { x => JsSuccess(Json.stringify(x)) }, Writes[String](Json.parse))) - ) (ApiDocument.apply, unlift(ApiDocument.unapply)) + (JsPath \ "meta").formatNullable(Format(Reads { x => + JsSuccess(Json.stringify(x)) + }, Writes[String](Json.parse))) + )(ApiDocument.apply, unlift(ApiDocument.unapply)) def fromDomain(document: Document): ApiDocument = { ApiDocument( diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocumentType.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocumentType.scala index e00da20..8b11b91 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocumentType.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiDocumentType.scala @@ -11,7 +11,7 @@ object ApiDocumentType { implicit val format: Format[ApiDocumentType] = ( (JsPath \ "id").format[Long] and (JsPath \ "name").format[String] - ) (ApiDocumentType.apply, unlift(ApiDocumentType.unapply)) + )(ApiDocumentType.apply, unlift(ApiDocumentType.unapply)) def fromDomain(documentType: DocumentType) = ApiDocumentType( id = documentType.id.id, diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiProviderType.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiProviderType.scala index 7b370ba..eb0ac46 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiProviderType.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiProviderType.scala @@ -11,7 +11,7 @@ object ApiProviderType { implicit val format: Format[ApiProviderType] = ( (JsPath \ "id").format[Long] and (JsPath \ "name").format[String] - ) (ApiProviderType.apply, unlift(ApiProviderType.unapply)) + )(ApiProviderType.apply, unlift(ApiProviderType.unapply)) def fromDomain(providerType: ProviderType) = ApiProviderType( id = providerType.id.id, diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/DocumentUtils.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/DocumentUtils.scala index 87e449f..24e388e 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/DocumentUtils.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/DocumentUtils.scala @@ -5,20 +5,20 @@ import xyz.driver.pdsuidomain.entities.Document.Status object DocumentUtils { val statusFromString: PartialFunction[String, Status] = { - case "New" => Status.New + case "New" => Status.New case "Organized" => Status.Organized case "Extracted" => Status.Extracted - case "Done" => Status.Done - case "Flagged" => Status.Flagged - case "Archived" => Status.Archived + case "Done" => Status.Done + case "Flagged" => Status.Flagged + case "Archived" => Status.Archived } def statusToString(x: Status): String = x match { - case Status.New => "New" + case Status.New => "New" case Status.Organized => "Organized" case Status.Extracted => "Extracted" - case Status.Done => "Done" - case Status.Flagged => "Flagged" - case Status.Archived => "Archived" + case Status.Done => "Done" + case Status.Flagged => "Flagged" + case Status.Archived => "Archived" } } |