Create a separate billing event when EAP is applied

When EAP is involed we current have one billing event for domain create that
has the create fee and EAP fee lumped together. Change it to record two
separate billing events for each.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132335349
This commit is contained in:
jianglai 2016-09-06 10:28:56 -07:00 committed by Ben McIlwain
parent 969d9483ae
commit 6641f105b7
12 changed files with 196 additions and 72 deletions

View file

@ -38,6 +38,7 @@ import google.registry.model.billing.BillingEvent;
import google.registry.model.billing.BillingEvent.Reason;
import google.registry.model.domain.DomainCommand.Update;
import google.registry.model.domain.DomainResource;
import google.registry.model.domain.fee.BaseFee.FeeType;
import google.registry.model.domain.fee.Fee;
import google.registry.model.domain.fee.FeeTransformCommandExtension;
import google.registry.model.domain.rgp.GracePeriodStatus;
@ -187,13 +188,17 @@ public class DomainRestoreRequestFlow extends OwnedResourceMutateFlow<DomainReso
return createOutput(
Success,
null,
(feeUpdate == null) ? null : ImmutableList.of(
feeUpdate.createResponseBuilder()
.setCurrency(restoreCost.getCurrencyUnit())
.setFees(ImmutableList.of(
Fee.create(restoreCost.getAmount(), "restore"),
Fee.create(renewCost.getAmount(), "renew")))
.build()));
(feeUpdate == null)
? null
: ImmutableList.of(
feeUpdate
.createResponseBuilder()
.setCurrency(restoreCost.getCurrencyUnit())
.setFees(
ImmutableList.of(
Fee.create(restoreCost.getAmount(), FeeType.RESTORE),
Fee.create(renewCost.getAmount(), FeeType.RENEW)))
.build()));
}
/** Restore command cannot have other changes specified. */