com.gu.config.DiscountRatePlanIds.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of membership-common_2.12 Show documentation
Show all versions of membership-common_2.12 Show documentation
Scala library for common Guardian Membership/Subscriptions functionality.
package com.gu.config
import com.gu.memsub.Subscription.{ProductRatePlanChargeId, ProductRatePlanId}
import com.typesafe.config.Config
case class DiscountRatePlan(planId: ProductRatePlanId, planChargeId: ProductRatePlanChargeId)
case class DiscountRatePlanIds(percentageDiscount: DiscountRatePlan)
object DiscountRatePlanIds {
def fromConfig(config: Config) =
DiscountRatePlanIds(
DiscountRatePlan(
ProductRatePlanId(config.getString("discount.percentage.plan")),
ProductRatePlanChargeId(config.getString("discount.percentage.charge"))
)
)
}