Add clientId and time parameters to pricing methods

This is a broken-out refactoring from []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121603352
This commit is contained in:
mcilwain 2016-05-05 12:19:50 -07:00 committed by Justine Tunney
parent 4a9be60e0b
commit 6f69e96465
18 changed files with 105 additions and 62 deletions

View file

@ -176,7 +176,8 @@ public abstract class BaseDomainCreateFlow<R extends DomainBase, B extends Build
tldState = registry.getTldState(now);
checkRegistryStateForTld(tld);
domainLabel = domainName.parts().get(0);
createCost = registry.getDomainCreateCost(targetId, command.getPeriod().getValue());
createCost =
registry.getDomainCreateCost(targetId, now, getClientId(), command.getPeriod().getValue());
// The TLD should always be the parent of the requested domain name.
isAnchorTenantViaReservation = matchesAnchorTenantReservation(
domainLabel, tld, command.getAuthInfo().getPw().getValue());
@ -201,7 +202,7 @@ public abstract class BaseDomainCreateFlow<R extends DomainBase, B extends Build
} else if (isClaimsCreate) {
throw new ClaimsPeriodEndedException(tld);
}
verifyPremiumNameIsNotBlocked(targetId, tld, getClientId());
verifyPremiumNameIsNotBlocked(targetId, now, getClientId(), tld);
}
verifyUnitIsYears(command.getPeriod());
verifyNotInPendingDelete(