From e6de7d0dd021661756923717b90883a1fcf63120 Mon Sep 17 00:00:00 2001 From: Georges Lebreton <102960844+Georges-GNM@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:58:36 +0100 Subject: [PATCH] Add primary and secondary tags --- .../main/scala/com/gu/facia/client/models/Config.scala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/facia-json/src/main/scala/com/gu/facia/client/models/Config.scala b/facia-json/src/main/scala/com/gu/facia/client/models/Config.scala index 5dceb91b..f0411874 100644 --- a/facia-json/src/main/scala/com/gu/facia/client/models/Config.scala +++ b/facia-json/src/main/scala/com/gu/facia/client/models/Config.scala @@ -13,6 +13,10 @@ case class Backfill( sealed trait Metadata +case object Primary extends Metadata + +case object Secondary extends Metadata + case object Canonical extends Metadata case object Special extends Metadata @@ -47,6 +51,8 @@ case object SpecialReportAltPalette extends Metadata object Metadata extends StrictLogging { val tags: Map[String, Metadata] = Map( + "Primary" -> Primary, + "Secondary" -> Secondary, "Canonical" -> Canonical, "Special" -> Special, "Breaking" -> Breaking, @@ -78,6 +84,8 @@ object Metadata extends StrictLogging { } def writes(cardStyle: Metadata) = cardStyle match { + case Primary => JsObject(Seq("type" -> JsString("Primary"))) + case Secondary => JsObject(Seq("type" -> JsString("Secondary"))) case Canonical => JsObject(Seq("type" -> JsString("Canonical"))) case Special => JsObject(Seq("type" -> JsString("Special"))) case Breaking => JsObject(Seq("type" -> JsString("Breaking")))