def productMappings()

in handlers/soft-opt-in-consent-setter/src/main/scala/com/gu/soft_opt_in_consent_setter/models/ConsentsMapping.scala [13:26]


  def productMappings(productName: String, printProduct: Option[String]): String = {
    // the values on the left come from https://github.com/guardian/support-frontend/blob/beef97734c1ca1549bc1cb5f1ea5b4501d24fc46/support-modules/acquisition-events/src/main/scala/com/gu/support/acquisitions/models/AcquisitionDataRow.scala#L97
    productName match {
      case "RECURRING_CONTRIBUTION" => "Contribution"
      case "SUPPORTER_PLUS" => "Supporter Plus"
      case "TIER_THREE" => "Tier Three"
      case "DIGITAL_SUBSCRIPTION" => "Digital Pack"
      case "PRINT_SUBSCRIPTION" if printProduct.exists(List("HOME_DELIVERY_SUNDAY", "VOUCHER_SUNDAY").contains) => "Newspaper - Observer only" // don't set any consents for observer only
      case "PRINT_SUBSCRIPTION" if !printProduct.contains("GUARDIAN_WEEKLY") => "newspaper"
      case "PRINT_SUBSCRIPTION" if printProduct.contains("GUARDIAN_WEEKLY") => "Guardian Weekly"
      case "GUARDIAN_AD_LITE" => "Guardian Ad-Lite"
      case other => other
    }
  }