mirror of
https://github.com/google/nomulus
synced 2026-02-04 20:12:23 +00:00
Change RESTORE BillingEvents to have 1-year periods
This simplifies calculating the overall invoice by giving RESTORE fees a period equal to the period of the associated RENEW (1 year). Older BillingEvents will not be backfilled, and will have periodYears = null. Invoicing and business both agree this is a valid representation, since RESTORE fees are intrinsically tied to the 1-year RENEW it's associated with. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=188041777
This commit is contained in:
@@ -305,10 +305,12 @@ public abstract class BillingEvent extends ImmutableObject
|
||||
Sets.immutableEnumSet(
|
||||
Reason.CREATE,
|
||||
Reason.RENEW,
|
||||
Reason.RESTORE,
|
||||
Reason.TRANSFER);
|
||||
checkState(
|
||||
reasonsWithPeriods.contains(instance.reason) == (instance.periodYears != null),
|
||||
"Period years must be set if and only if reason is CREATE, RENEW, or TRANSFER.");
|
||||
"Period years must be set if and only if reason is "
|
||||
+ "CREATE, RENEW, RESTORE or TRANSFER.");
|
||||
checkState(
|
||||
instance.getFlags().contains(Flag.SYNTHETIC)
|
||||
== (instance.syntheticCreationTime != null),
|
||||
|
||||
Reference in New Issue
Block a user