Skip to content

Commit

Permalink
Merge pull request #974 from guardian/ph-20240206-0932-rateplan-exten…
Browse files Browse the repository at this point in the history
…sion

add originalOrderDate to case class ZuoraRatePlanCharge
  • Loading branch information
shtukas authored Feb 7, 2024
2 parents 823a0a2 + 661b06e commit 633cf56
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ case class ZuoraRatePlanCharge(
billingDay: Option[String] = None,
triggerEvent: Option[String] = None,
triggerDate: Option[LocalDate] = None,
discountPercentage: Option[Double] = None
discountPercentage: Option[Double] = None,
originalOrderDate: Option[LocalDate] = None
)

object ZuoraRatePlanCharge {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("ContractEffective"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2016, 11, 13))
)
)

Expand Down Expand Up @@ -87,7 +88,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("ContractEffective"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2016, 11, 13))
)
),
lastChangeType = None
Expand Down Expand Up @@ -155,7 +157,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("ContractEffective"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2017, 1, 20))
)
)

Expand Down Expand Up @@ -193,7 +196,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("ContractEffective"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2017, 1, 20))
)
),
lastChangeType = None
Expand Down Expand Up @@ -261,7 +265,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("ContractEffective"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2017, 1, 20))
)
)

Expand Down Expand Up @@ -299,7 +304,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("ContractEffective"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2017, 1, 20))
)
),
lastChangeType = None
Expand Down Expand Up @@ -365,7 +371,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2023, 4, 1))
)
)

Expand Down Expand Up @@ -403,7 +410,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2023, 4, 1))
)
),
lastChangeType = Some("Add")
Expand Down Expand Up @@ -486,7 +494,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2023, 7, 3))
)
)

Expand Down Expand Up @@ -524,7 +533,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2023, 7, 3))
)
),
lastChangeType = None
Expand Down Expand Up @@ -619,7 +629,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2023, 7, 2))
)
)

Expand Down Expand Up @@ -657,7 +668,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2023, 7, 2))
)
),
lastChangeType = None
Expand Down Expand Up @@ -737,7 +749,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2023, 6, 28))
)
)

Expand Down Expand Up @@ -775,7 +788,8 @@ class AmendmentHandlerTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2023, 6, 28))
)
),
lastChangeType = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class DigiSubs2023MigrationTest extends munit.FunSuite {
Some("ChargeTriggerDay"),
Some("CustomerAcceptance"),
None,
None
None,
originalOrderDate = Some(LocalDate.of(2016, 7, 5))
)
),
None
Expand All @@ -79,7 +80,8 @@ class DigiSubs2023MigrationTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2016, 7, 5))
)
)

Expand Down Expand Up @@ -154,7 +156,8 @@ class DigiSubs2023MigrationTest extends munit.FunSuite {
Some("ChargeTriggerDay"),
Some("CustomerAcceptance"),
None,
None
None,
originalOrderDate = Some(LocalDate.of(2023, 10, 3))
)
),
None
Expand All @@ -181,7 +184,8 @@ class DigiSubs2023MigrationTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2023, 10, 3))
)
)

Expand Down Expand Up @@ -271,22 +275,23 @@ class DigiSubs2023MigrationTest extends munit.FunSuite {
"Digital Pack Quarterly",
List(
ZuoraRatePlanCharge(
"2c92a0fb4edd70c9014edeaa4fd42186",
"Digital Pack Quarterly",
"C-00266638",
"GBP",
Some(35.95),
Some("Quarter"),
Some(LocalDate.of(2023, 11, 10)),
Some(LocalDate.of(2023, 8, 10)),
None,
Some("Subscription_End"),
None,
None,
Some("ChargeTriggerDay"),
Some("CustomerAcceptance"),
None,
None
productRatePlanChargeId = "2c92a0fb4edd70c9014edeaa4fd42186",
name = "Digital Pack Quarterly",
number = "C-00266638",
currency = "GBP",
price = Some(35.95),
billingPeriod = Some("Quarter"),
chargedThroughDate = Some(LocalDate.of(2023, 11, 10)),
processedThroughDate = Some(LocalDate.of(2023, 8, 10)),
specificBillingPeriod = None,
endDateCondition = Some("Subscription_End"),
upToPeriodsType = None,
upToPeriods = None,
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2016, 6, 16))
)
),
None
Expand All @@ -313,7 +318,8 @@ class DigiSubs2023MigrationTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2016, 6, 16))
)
)

Expand Down Expand Up @@ -375,22 +381,23 @@ class DigiSubs2023MigrationTest extends munit.FunSuite {
"Digital Pack Annual",
List(
ZuoraRatePlanCharge(
"2c92a0fb4edd70c9014edeaa5001218c",
"Digital Pack Annual",
"C-04065127",
"GBP",
Some(119.0),
Some("Annual"),
Some(LocalDate.of(2023, 11, 17)),
Some(LocalDate.of(2022, 11, 17)),
None,
Some("Subscription_End"),
None,
None,
Some("ChargeTriggerDay"),
Some("CustomerAcceptance"),
None,
None
productRatePlanChargeId = "2c92a0fb4edd70c9014edeaa5001218c",
name = "Digital Pack Annual",
number = "C-04065127",
currency = "GBP",
price = Some(119.0),
billingPeriod = Some("Annual"),
chargedThroughDate = Some(LocalDate.of(2023, 11, 17)),
processedThroughDate = Some(LocalDate.of(2022, 11, 17)),
specificBillingPeriod = None,
endDateCondition = Some("Subscription_End"),
upToPeriodsType = None,
upToPeriods = None,
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2022, 11, 1))
)
),
None
Expand All @@ -417,7 +424,8 @@ class DigiSubs2023MigrationTest extends munit.FunSuite {
billingDay = Some("ChargeTriggerDay"),
triggerEvent = Some("CustomerAcceptance"),
triggerDate = None,
discountPercentage = None
discountPercentage = None,
originalOrderDate = Some(LocalDate.of(2022, 11, 1))
)
)

Expand Down
Loading

0 comments on commit 633cf56

Please sign in to comment.