From 90be98d0c21d7e7d7fb72e24cfa971d800bfc004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Robles?= Date: Wed, 17 Jul 2024 08:40:51 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Voter=20eligibility=20check=20(#208?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parent issue: https://github.com/sequentech/meta/issues/234 --- app/models/Models.scala | 17 ++++++++++++++++- app/utils/JsonFormatters.scala | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/models/Models.scala b/app/models/Models.scala index 8c46c13..3e0ab42 100644 --- a/app/models/Models.scala +++ b/app/models/Models.scala @@ -1045,6 +1045,20 @@ case class ShareTextItem( } } +case class VoterEligibilityScreen( + title: Option[String], + title_i18n: Option[Map[String, String]], + description: Option[String], + description_i18n: Option[Map[String, String]], + footer: Option[String], + footer_i18n: Option[Map[String, String]] +) +{ + def validate() = + { + } +} + /** defines presentation options for an election */ case class ElectionPresentation( share_text: Option[Array[ShareTextItem]], @@ -1067,7 +1081,8 @@ case class ElectionPresentation( i18n_override: Option[Map[String, Map[String, String]]], public_title: Option[String], - public_title_i18n: Option[Map[String, String]] + public_title_i18n: Option[Map[String, String]], + voter_eligibility_screen: Option[VoterEligibilityScreen] ) { def shareTextConfig() : Option[Array[ShareTextItem]] = { diff --git a/app/utils/JsonFormatters.scala b/app/utils/JsonFormatters.scala index a8dfe98..23b5e4a 100644 --- a/app/utils/JsonFormatters.scala +++ b/app/utils/JsonFormatters.scala @@ -64,6 +64,7 @@ object JsonFormatters { implicit val dateDtoF = Json.format[DateDTO] implicit val voteF = Json.format[Vote] implicit val electionExtraF = Json.format[ElectionExtra] + implicit val voterEligibilityScreenF = Json.format[VoterEligibilityScreen] implicit val questionConditionF = Json.format[QuestionCondition] implicit val conditionalQuestionF = Json.format[ConditionalQuestion] implicit val electionF = Json.format[Election]