Bypass EAP fees for anchor tenants

Note that the check flow does not yet handle any kind of allocation token
handling at all. Step 2 will be to add allocation token handling there, so a
RESERVED_FOR_ANCHOR_TENANT or RESERVED_FOR_SPECIFIC_USE domain will show as
available instead of reserved if the right token is specified using the
extension. Then once that's done, we can use that information to adjust the
price accordingly as well.

Right now the behavior with a domain check is that reserved domains always show
as reserved, even if they're anchor tenants.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215599350
This commit is contained in:
mcilwain 2018-10-03 11:49:25 -07:00 committed by Ben McIlwain
parent ce5bbe4bfa
commit 1586813398
6 changed files with 55 additions and 136 deletions

View file

@ -211,8 +211,11 @@ public final class DomainApplicationCreateFlow implements TransactionalFlow {
checkAllowedAccessToTld(clientId, tld);
}
Registry registry = Registry.get(tld);
boolean isAnchorTenant =
isAnchorTenant(domainName, Optional.empty(), authInfo.getPw().getValue(), Optional.empty());
FeesAndCredits feesAndCredits =
pricingLogic.getCreatePrice(registry, targetId, now, command.getPeriod().getValue());
pricingLogic.getCreatePrice(
registry, targetId, now, command.getPeriod().getValue(), isAnchorTenant);
verifyUnitIsYears(command.getPeriod());
int years = command.getPeriod().getValue();
validateRegistrationPeriod(years);
@ -220,8 +223,6 @@ public final class DomainApplicationCreateFlow implements TransactionalFlow {
LaunchCreateExtension launchCreate =
eppInput.getSingleExtension(LaunchCreateExtension.class).get();
validateLaunchCreateExtension(launchCreate, registry, domainName, now);
boolean isAnchorTenant =
isAnchorTenant(domainName, Optional.empty(), authInfo.getPw().getValue(), Optional.empty());
// Superusers can create reserved domains, force creations on domains that require a claims
// notice without specifying a claims key, and override blocks on registering premium domains.
if (!isSuperuser) {