diff --git a/java/google/registry/flows/domain/DomainCreateFlow.java b/java/google/registry/flows/domain/DomainCreateFlow.java index dab9a7a03..77d069478 100644 --- a/java/google/registry/flows/domain/DomainCreateFlow.java +++ b/java/google/registry/flows/domain/DomainCreateFlow.java @@ -525,6 +525,7 @@ public class DomainCreateFlow implements TransactionalFlow { .setReason(Reason.FEE_EARLY_ACCESS) .setTargetId(createBillingEvent.getTargetId()) .setClientId(createBillingEvent.getClientId()) + .setPeriodYears(1) .setCost(feesAndCredits.getEapCost()) .setEventTime(createBillingEvent.getEventTime()) .setBillingTime(createBillingEvent.getBillingTime()) diff --git a/java/google/registry/model/billing/BillingEvent.java b/java/google/registry/model/billing/BillingEvent.java index f64deef29..4d3c364dc 100644 --- a/java/google/registry/model/billing/BillingEvent.java +++ b/java/google/registry/model/billing/BillingEvent.java @@ -304,13 +304,14 @@ public abstract class BillingEvent extends ImmutableObject ImmutableSet reasonsWithPeriods = Sets.immutableEnumSet( Reason.CREATE, + Reason.FEE_EARLY_ACCESS, 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, RESTORE or TRANSFER."); + + "CREATE, FEE_EARLY_ACCESS, RENEW, RESTORE or TRANSFER."); checkState( instance.getFlags().contains(Flag.SYNTHETIC) == (instance.syntheticCreationTime != null), diff --git a/javatests/google/registry/flows/EppLifecycleDomainTest.java b/javatests/google/registry/flows/EppLifecycleDomainTest.java index 2da45646e..dbeb4c40f 100644 --- a/javatests/google/registry/flows/EppLifecycleDomainTest.java +++ b/javatests/google/registry/flows/EppLifecycleDomainTest.java @@ -305,6 +305,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .setReason(Reason.FEE_EARLY_ACCESS) .setTargetId("example.tld") .setClientId("NewRegistrar") + .setPeriodYears(1) .setCost(Money.parse("USD 100.00")) .setEventTime(createTime) .setBillingTime(createTime.plus(Registry.get("tld").getRenewGracePeriodLength())) diff --git a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java index cf564ce83..7cb97bd91 100644 --- a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java @@ -267,6 +267,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase