in app/com/gu/memsub/promo/Formatters.scala [201:215]
def writes(in: PromotionType[PromoContext]): JsObject = {
val o: JsObject = in match {
case p: PercentDiscount => Json.writes[PercentDiscount].writes(p)
case DoubleType(a, b) => Json.obj(
"a" -> promotionTypeFormat.writes(a),
"b" -> promotionTypeFormat.writes(b),
"name" -> PromotionType.double
)
case f: FreeTrial => Json.writes[FreeTrial].writes(f)
case i: Incentive => Json.writes[Incentive].writes(i)
case r: Retention.type => Json.obj()
case t: Tracking.type => Json.obj()
}
o ++ Json.obj("name" -> in.name)
}