-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce ZuoraAmendmentOrderPayload
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
lambda/src/main/scala/pricemigrationengine/model/ZuoraAmendmentOrderPayload.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package pricemigrationengine.model | ||
|
||
import java.time.LocalDate | ||
import upickle.default.{ReadWriter, macroRW} | ||
|
||
// Zuora documentation: https://knowledgecenter.zuora.com/Zuora_Billing/Manage_subscription_transactions/Orders/Order_actions_tutorials/D_Replace_a_product_in_a_subscription | ||
|
||
sealed trait ZuoraAmendmentOrderPayloadOrderAction | ||
object ZuoraAmendmentOrderPayloadOrderAction { | ||
implicit val rw: ReadWriter[ZuoraAmendmentOrderPayloadOrderAction] = macroRW | ||
} | ||
|
||
case class ZuoraAmendmentOrderPayloadOrderActionTriggerDate(name: String, triggerDate: LocalDate) | ||
object ZuoraAmendmentOrderPayloadOrderActionTriggerDate { | ||
implicit val rw: ReadWriter[ZuoraAmendmentOrderPayloadOrderActionTriggerDate] = macroRW | ||
} | ||
|
||
case class ZuoraAmendmentOrderPayloadOrderActionRemoveProduct(ratePlanId: String) | ||
object ZuoraAmendmentOrderPayloadOrderActionRemoveProduct { | ||
implicit val rw: ReadWriter[ZuoraAmendmentOrderPayloadOrderActionRemoveProduct] = macroRW | ||
} | ||
|
||
case class ZuoraAmendmentOrderPayloadOrderActionRemove( | ||
triggerDates: List[ZuoraAmendmentOrderPayloadOrderActionTriggerDate], | ||
removeProduct: ZuoraAmendmentOrderPayloadOrderActionRemoveProduct | ||
) extends ZuoraAmendmentOrderPayloadOrderAction | ||
object ZuoraAmendmentOrderPayloadOrderActionRemove { | ||
implicit val rw: ReadWriter[ZuoraAmendmentOrderPayloadOrderActionRemove] = macroRW | ||
} | ||
|
||
case class ZuoraAmendmentOrderPayloadOrderActionAddProductChargeOverride( | ||
productRatePlanChargeId: String, | ||
pricing: Map[String, Map[String, BigDecimal]] | ||
) | ||
object ZuoraAmendmentOrderPayloadOrderActionAddProductChargeOverride { | ||
implicit val rw: ReadWriter[ZuoraAmendmentOrderPayloadOrderActionAddProductChargeOverride] = macroRW | ||
} | ||
|
||
case class ZuoraAmendmentOrderPayloadOrderActionAddProduct( | ||
productRatePlanId: String, | ||
chargeOverrides: List[ZuoraAmendmentOrderPayloadOrderActionAddProductChargeOverride] | ||
) | ||
object ZuoraAmendmentOrderPayloadOrderActionAddProduct { | ||
implicit val rw: ReadWriter[ZuoraAmendmentOrderPayloadOrderActionAddProduct] = macroRW | ||
} | ||
|
||
case class ZuoraAmendmentOrderPayloadOrderActionAdd( | ||
triggerDates: List[ZuoraAmendmentOrderPayloadOrderActionTriggerDate], | ||
addProduct: ZuoraAmendmentOrderPayloadOrderActionAddProduct | ||
) extends ZuoraAmendmentOrderPayloadOrderAction | ||
object ZuoraAmendmentOrderPayloadOrderActionAdd { | ||
implicit val rw: ReadWriter[ZuoraAmendmentOrderPayloadOrderActionAdd] = macroRW | ||
} | ||
|
||
case class ZuoraAmendmentOrderPayloadSubscription( | ||
subscriptionNumber: String, | ||
orderActions: List[ZuoraAmendmentOrderPayloadOrderAction] | ||
) | ||
object ZuoraAmendmentOrderPayloadSubscription { | ||
implicit val rw: ReadWriter[ZuoraAmendmentOrderPayloadSubscription] = macroRW | ||
} | ||
|
||
case class ZuoraAmendmentOrderPayloadProcessingOptions(runBilling: Boolean, collectPayment: Boolean) | ||
object ZuoraAmendmentOrderPayloadProcessingOptions { | ||
implicit val rw: ReadWriter[ZuoraAmendmentOrderPayloadProcessingOptions] = macroRW | ||
} | ||
|
||
case class ZuoraAmendmentOrderPayload( | ||
orderDate: LocalDate, | ||
existingAccountNumber: String, | ||
subscriptions: List[ZuoraAmendmentOrderPayloadSubscription], | ||
processingOptions: ZuoraAmendmentOrderPayloadProcessingOptions | ||
) | ||
object ZuoraAmendmentOrderPayload { | ||
implicit val rw: ReadWriter[ZuoraAmendmentOrderPayload] = macroRW | ||
} |