in handlers/product-move-api/src/main/scala/com/gu/productmove/zuora/SubscriptionUpdate.scala [36:99]
def update[R: JsonDecoder](
subscriptionName: SubscriptionName,
requestBody: SubscriptionUpdateRequest,
): RIO[SubscriptionUpdate, R] =
ZIO.serviceWithZIO[SubscriptionUpdate](_.update[R](subscriptionName, requestBody))
}
sealed trait SubscriptionUpdateRequest
case class SwitchProductUpdateRequest(
add: List[AddRatePlan],
remove: List[RemoveRatePlan],
collect: Option[Boolean] = None,
runBilling: Option[Boolean] = None,
preview: Option[Boolean] = None,
targetDate: Option[LocalDate] = None,
currentTerm: Option[String] = None,
currentTermPeriodType: Option[String] = None,
) extends SubscriptionUpdateRequest
derives JsonEncoder
case class UpdateSubscriptionAmount(
update: List[UpdateSubscriptionAmountItem],
) extends SubscriptionUpdateRequest
derives JsonEncoder
case class UpdateSubscriptionAmountItem(
contractEffectiveDate: LocalDate,
customerAcceptanceDate: LocalDate,
serviceActivationDate: LocalDate,
ratePlanId: String,
chargeUpdateDetails: List[ChargeUpdateDetails],
) derives JsonEncoder
case class ChargeUpdateDetails(
price: BigDecimal,
ratePlanChargeId: String,
) derives JsonEncoder
case class AddRatePlan(
contractEffectiveDate: LocalDate,
productRatePlanId: String,
chargeOverrides: List[ChargeOverrides],
) derives JsonEncoder
case class RemoveRatePlan(
contractEffectiveDate: LocalDate,
ratePlanId: String,
) derives JsonEncoder
case class SubscriptionUpdateResponse(
subscriptionId: String,
totalDeltaMrr: BigDecimal,
invoiceId: Option[String],
paidAmount: Option[BigDecimal],
) derives JsonDecoder
case class SubscriptionUpdatePreviewResponse(invoice: SubscriptionUpdateInvoice) derives JsonDecoder
case class SubscriptionUpdateInvoiceItem(
serviceStartDate: LocalDate,
chargeAmount: BigDecimal,
taxAmount: BigDecimal,
productRatePlanChargeId: String,
) derives JsonDecoder {