diff options
author | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-10-02 17:26:43 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-02 17:26:43 +0700 |
commit | 1913870abec9e31d080f6858d0fc296445852cc6 (patch) | |
tree | 0fd3f012bfa563315e3f9a93b8e1788efe03fa12 /src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala | |
parent | d0482b45b6f9149f050c5e5a6dbab6f059229282 (diff) | |
parent | 14b460edbebb1d5c39809dbc591b786edec9fa8e (diff) | |
download | rest-query-1913870abec9e31d080f6858d0fc296445852cc6.tar.gz rest-query-1913870abec9e31d080f6858d0fc296445852cc6.tar.bz2 rest-query-1913870abec9e31d080f6858d0fc296445852cc6.zip |
Merge pull request #33 from drivergroup/TRIAL-17v0.5.4
TRIAL-17 Added 'inclusion' field to Criterion
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala | 9 |
1 files changed, 6 insertions, 3 deletions
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 ab7641f..d72a9b4 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 @@ -13,7 +13,8 @@ final case class ApiNewCriterion(meta: Option[String], text: Option[String], isCompound: Option[Boolean], labels: Seq[ApiCriterionLabel], - trialId: String) { + trialId: String, + inclusion: Option[Boolean]) { def toDomain = RichCriterion( criterion = Criterion( @@ -21,7 +22,8 @@ final case class ApiNewCriterion(meta: Option[String], meta = meta.getOrElse(""), trialId = StringId(trialId), isCompound = isCompound.getOrElse(false), - text = text + text = text, + inclusion = inclusion ), armIds = arms.getOrElse(Seq.empty).map(LongId[Arm]), labels = labels.map(_.toDomain(LongId(Long.MaxValue))) // A developer should specify right criterionId himself @@ -38,6 +40,7 @@ object ApiNewCriterion { (JsPath \ "text").formatNullable[String] and (JsPath \ "isCompound").formatNullable[Boolean] and (JsPath \ "labels").format(seqJsonFormat[ApiCriterionLabel]) and - (JsPath \ "trialId").format[String] + (JsPath \ "trialId").format[String] and + (JsPath \ "inclusion").formatNullable[Boolean] )(ApiNewCriterion.apply, unlift(ApiNewCriterion.unapply)) } |