mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Set EAP billing event to one-year period
This is consistent with how we treat RESTORE billing events as well- in general, fees are considered to be amortized over the course of a year (by the invoicing team). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=199684843
This commit is contained in:
parent
ea08661598
commit
1c71487e5d
4 changed files with 5 additions and 1 deletions
|
@ -525,6 +525,7 @@ public class DomainCreateFlow implements TransactionalFlow {
|
||||||
.setReason(Reason.FEE_EARLY_ACCESS)
|
.setReason(Reason.FEE_EARLY_ACCESS)
|
||||||
.setTargetId(createBillingEvent.getTargetId())
|
.setTargetId(createBillingEvent.getTargetId())
|
||||||
.setClientId(createBillingEvent.getClientId())
|
.setClientId(createBillingEvent.getClientId())
|
||||||
|
.setPeriodYears(1)
|
||||||
.setCost(feesAndCredits.getEapCost())
|
.setCost(feesAndCredits.getEapCost())
|
||||||
.setEventTime(createBillingEvent.getEventTime())
|
.setEventTime(createBillingEvent.getEventTime())
|
||||||
.setBillingTime(createBillingEvent.getBillingTime())
|
.setBillingTime(createBillingEvent.getBillingTime())
|
||||||
|
|
|
@ -304,13 +304,14 @@ public abstract class BillingEvent extends ImmutableObject
|
||||||
ImmutableSet<Reason> reasonsWithPeriods =
|
ImmutableSet<Reason> reasonsWithPeriods =
|
||||||
Sets.immutableEnumSet(
|
Sets.immutableEnumSet(
|
||||||
Reason.CREATE,
|
Reason.CREATE,
|
||||||
|
Reason.FEE_EARLY_ACCESS,
|
||||||
Reason.RENEW,
|
Reason.RENEW,
|
||||||
Reason.RESTORE,
|
Reason.RESTORE,
|
||||||
Reason.TRANSFER);
|
Reason.TRANSFER);
|
||||||
checkState(
|
checkState(
|
||||||
reasonsWithPeriods.contains(instance.reason) == (instance.periodYears != null),
|
reasonsWithPeriods.contains(instance.reason) == (instance.periodYears != null),
|
||||||
"Period years must be set if and only if reason is "
|
"Period years must be set if and only if reason is "
|
||||||
+ "CREATE, RENEW, RESTORE or TRANSFER.");
|
+ "CREATE, FEE_EARLY_ACCESS, RENEW, RESTORE or TRANSFER.");
|
||||||
checkState(
|
checkState(
|
||||||
instance.getFlags().contains(Flag.SYNTHETIC)
|
instance.getFlags().contains(Flag.SYNTHETIC)
|
||||||
== (instance.syntheticCreationTime != null),
|
== (instance.syntheticCreationTime != null),
|
||||||
|
|
|
@ -305,6 +305,7 @@ public class EppLifecycleDomainTest extends EppTestCase {
|
||||||
.setReason(Reason.FEE_EARLY_ACCESS)
|
.setReason(Reason.FEE_EARLY_ACCESS)
|
||||||
.setTargetId("example.tld")
|
.setTargetId("example.tld")
|
||||||
.setClientId("NewRegistrar")
|
.setClientId("NewRegistrar")
|
||||||
|
.setPeriodYears(1)
|
||||||
.setCost(Money.parse("USD 100.00"))
|
.setCost(Money.parse("USD 100.00"))
|
||||||
.setEventTime(createTime)
|
.setEventTime(createTime)
|
||||||
.setBillingTime(createTime.plus(Registry.get("tld").getRenewGracePeriodLength()))
|
.setBillingTime(createTime.plus(Registry.get("tld").getRenewGracePeriodLength()))
|
||||||
|
|
|
@ -267,6 +267,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
.setReason(Reason.FEE_EARLY_ACCESS)
|
.setReason(Reason.FEE_EARLY_ACCESS)
|
||||||
.setTargetId(getUniqueIdFromCommand())
|
.setTargetId(getUniqueIdFromCommand())
|
||||||
.setClientId("TheRegistrar")
|
.setClientId("TheRegistrar")
|
||||||
|
.setPeriodYears(1)
|
||||||
.setCost(eapFee)
|
.setCost(eapFee)
|
||||||
.setEventTime(clock.nowUtc())
|
.setEventTime(clock.nowUtc())
|
||||||
.setBillingTime(billingTime)
|
.setBillingTime(billingTime)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue