Modify create price custom logic to return FeesAndCredits

Previously DomainPricingCustomLogic#customizeCreatePrice takes in the create
price itself and modifies it. Change it to take in the entire FeesAndCredits (previously named EppCommandOperations) which may contain other fees related to domain creation,
such as EAP fees, and returns FeesAndCredits that may either change the
fees or add new type of fees.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141600614
This commit is contained in:
jianglai 2016-12-09 14:30:03 -08:00 committed by Ben McIlwain
parent a56a0677ba
commit 74d64f502e
7 changed files with 90 additions and 91 deletions

View file

@ -19,8 +19,8 @@ import com.google.common.net.InternetDomainName;
import google.registry.flows.EppException;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainPricingLogic;
import google.registry.flows.domain.DomainPricingLogic.FeesAndCredits;
import google.registry.model.ImmutableObject;
import google.registry.model.domain.fee.BaseFee;
import google.registry.model.eppinput.EppInput;
import google.registry.model.registry.Registry;
import org.joda.time.DateTime;
@ -38,16 +38,16 @@ public class DomainPricingCustomLogic extends BaseFlowCustomLogic {
/** A hook that customizes create price. */
@SuppressWarnings("unused")
public BaseFee customizeCreatePrice(CreatePriceParameters createPriceParameters)
public FeesAndCredits customizeCreatePrice(CreatePriceParameters createPriceParameters)
throws EppException {
return createPriceParameters.createFee();
return createPriceParameters.feesAndCredits();
}
/** A class to encapsulate parameters for a call to {@link #customizeCreatePrice} . */
@AutoValue
public abstract static class CreatePriceParameters extends ImmutableObject {
public abstract BaseFee createFee();
public abstract FeesAndCredits feesAndCredits();
public abstract Registry registry();
@ -65,7 +65,7 @@ public class DomainPricingCustomLogic extends BaseFlowCustomLogic {
@AutoValue.Builder
public abstract static class Builder {
public abstract Builder setCreateFee(BaseFee createFee);
public abstract Builder setFeesAndCredits(FeesAndCredits feesAndCredits);
public abstract Builder setRegistry(Registry registry);