Change EAP fee billing event reason to EARLY_ACCESS

The reason field is 1:1 mapped to skus in billing reports. Need to add a new reason for EAP for this type of billing event for reporting to work correctly. Also map that reason to the correct SKU.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134005364
This commit is contained in:
jianglai 2016-09-22 15:07:07 -07:00 committed by Ben McIlwain
parent 414781e79b
commit add9474e9a
4 changed files with 16 additions and 20 deletions

View file

@ -14,7 +14,6 @@
package google.registry.flows.domain;
import static com.google.common.collect.Sets.union;
import static google.registry.flows.domain.DomainFlowUtils.validateFeeChallenge;
import static google.registry.model.index.DomainApplicationIndex.loadActiveApplicationsByDomainName;
import static google.registry.model.ofy.ObjectifyService.ofy;
@ -167,15 +166,13 @@ public class DomainCreateFlow extends DomainCreateOrAllocateFlow {
if (!commandOperations.getEapCost().isZero()) {
BillingEvent.OneTime eapEvent =
new BillingEvent.OneTime.Builder()
.setReason(createEvent.getReason())
.setReason(Reason.FEE_EARLY_ACCESS)
.setTargetId(createEvent.getTargetId())
.setClientId(createEvent.getClientId())
.setPeriodYears(createEvent.getPeriodYears())
.setCost(commandOperations.getEapCost())
.setEventTime(createEvent.getEventTime())
.setBillingTime(createEvent.getBillingTime())
.setFlags(union(createEvent.getFlags(),
ImmutableSet.of(BillingEvent.Flag.EAP)).immutableCopy())
.setFlags(createEvent.getFlags())
.setParent(createEvent.getParentKey())
.build();
ofy().save().entity(eapEvent);