-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compute the doNotProcessUntil timespan for cancellation saves #1099
Conversation
@@ -79,16 +79,30 @@ object NotificationHandler extends CohortHandler { | |||
item: CohortItem, | |||
subscription: ZuoraSubscription | |||
): ZIO[CohortTable with Zuora, Failure, Unit] = { | |||
// Known keys for this mapping can be found in the BillingPeriod object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not very important, but a more robust approach is to use BillingPeriod.fromString
and have an exhaustive pattern match instead of a Map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually you are right, let me do that....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I was imagining a match on BillingPeriod
-
def billingPeriodToInt(period: BillingPeriod): Int =
period match {
case Monthly => 1
case Quarterly => 3
case SemiAnnual => 6
case Annual => 12
}
So that you can call:
BillingPeriod.billingPeriodToInt(BillingPeriod.fromString(billingPeriod))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This updates the logic of the interaction between subscriptions in "cancellation save" status and a pending price migration, a feature that we added for Supporter+ 2024.
In this update the time that the item is going to wait before being re-estimated, is computed as a function of the billing period. In essence we want to wait (at least) two billing periods before notifying the user of a price migration, instead of 6 months.