From 96d81a36286e41035ff4068859a3b0f9da924fbc Mon Sep 17 00:00:00 2001 From: vlad Date: Fri, 30 Jun 2017 19:38:37 -0700 Subject: Latest PDS UI utils including all the domain stuff --- .../driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion') diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala index 604a98b..ab7641f 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala @@ -11,6 +11,7 @@ import xyz.driver.pdsuidomain.services.CriterionService.RichCriterion final case class ApiNewCriterion(meta: Option[String], arms: Option[Seq[Long]], text: Option[String], + isCompound: Option[Boolean], labels: Seq[ApiCriterionLabel], trialId: String) { @@ -19,7 +20,7 @@ final case class ApiNewCriterion(meta: Option[String], id = LongId(0L), meta = meta.getOrElse(""), trialId = StringId(trialId), - isCompound = false, + isCompound = isCompound.getOrElse(false), text = text ), armIds = arms.getOrElse(Seq.empty).map(LongId[Arm]), @@ -35,6 +36,7 @@ object ApiNewCriterion { }, Writes[String](Json.parse))) and (JsPath \ "arms").formatNullable(seqJsonFormat[Long]) and (JsPath \ "text").formatNullable[String] and + (JsPath \ "isCompound").formatNullable[Boolean] and (JsPath \ "labels").format(seqJsonFormat[ApiCriterionLabel]) and (JsPath \ "trialId").format[String] )(ApiNewCriterion.apply, unlift(ApiNewCriterion.unapply)) -- cgit v1.2.3