aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala
diff options
context:
space:
mode:
authorKseniya Tomskikh <ktomskih@datamonsters.co>2017-10-02 15:21:58 +0700
committerKseniya Tomskikh <ktomskih@datamonsters.co>2017-10-02 15:21:58 +0700
commit14b460edbebb1d5c39809dbc591b786edec9fa8e (patch)
tree5e7f41d2f951ae5ec7f9375e6a3d5bda0250c796 /src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala
parentc5b7f009479930b82f0fb839971eeb2c457dcef0 (diff)
downloadrest-query-14b460edbebb1d5c39809dbc591b786edec9fa8e.tar.gz
rest-query-14b460edbebb1d5c39809dbc591b786edec9fa8e.tar.bz2
rest-query-14b460edbebb1d5c39809dbc591b786edec9fa8e.zip
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.scala9
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))
}