Class ExpandBillingRecurrencesPipeline
- All Implemented Interfaces:
Serializable
BillingRecurrence
to
BillingEvent
when an autorenew occurs within the given time frame.
This pipeline works in three stages:
- Gather the
BillingRecurrence
s that are in scope for expansion. The exact condition ofBillingRecurrence
s to include can be found ingetRecurrencesInScope(Pipeline)
. - Expand the
BillingRecurrence
s toBillingEvent
(and correspondingDomainHistory
) that fall within the [startTime
,endTime
) window, excluding those that are already present (to make this pipeline idempotent when running with the same parameters multiple times, either in parallel or in sequence). TheBillingRecurrence
is also updated with the information on when it was last expanded, so it would not be in scope for expansion until at least a year later. - If the cursor for billing events should be advanced, advance it to
endTime
after all of the expansions in the previous step is done, only when it is currently atstartTime
.
Note that the creation of new BillingEvent
and DomainHistory
is done
speculatively as soon as its event time is in scope for expansion (i.e. within the window of
operation). If a domain is subsequently cancelled during the autorenew grace period, a BillingCancellation
would have been created to cancel the BillingEvent
out. Similarly, a
DomainHistory
for the delete will be created which negates the effect of the
speculatively created DomainHistory
, specifically for the transaction records. Both the
BillingEvent
and DomainHistory
will only be used (and cancelled out) when the
billing time becomes effective, which is after the grace period, when the cancellations would
have been written, if need be. This is no different from what we do with manual renewals or
normal creates, where entities are always created for the action regardless of whether their
effects will be negated later due to subsequent actions within respective grace periods.
To stage this template locally, run ./nom_build :core:sBP --environment=alpha \
--pipeline=expandBilling
.
Then, you can run the staged template via the API client library, gCloud or a raw REST call.
- See Also:
-
Method Summary
-
Method Details
-
main
-