mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Add extra flow logic hooks for application delete and update
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=138393251
This commit is contained in:
parent
cef07f6bc5
commit
baaaacd4f5
10 changed files with 234 additions and 33 deletions
|
@ -30,6 +30,7 @@ import com.googlecode.objectify.Key;
|
|||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.LrpTokenEntity;
|
||||
import google.registry.model.domain.fee.BaseFee;
|
||||
|
@ -259,6 +260,29 @@ public final class TldSpecificLogicProxy {
|
|||
return new EppCommandOperations(currency, feeOrCredit);
|
||||
}
|
||||
|
||||
/** Returns a new domain application update price for the pricer. */
|
||||
public static EppCommandOperations getApplicationUpdatePrice(
|
||||
Registry registry,
|
||||
DomainApplication application,
|
||||
String clientId,
|
||||
DateTime date,
|
||||
EppInput eppInput) throws EppException {
|
||||
CurrencyUnit currency = registry.getCurrency();
|
||||
|
||||
// If there is extra flow logic, it may specify an update price. Otherwise, there is none.
|
||||
BaseFee feeOrCredit;
|
||||
Optional<RegistryExtraFlowLogic> extraFlowLogic =
|
||||
RegistryExtraFlowLogicProxy.newInstanceForTld(registry.getTldStr());
|
||||
if (extraFlowLogic.isPresent()) {
|
||||
feeOrCredit = extraFlowLogic.get()
|
||||
.getApplicationUpdateFeeOrCredit(application, clientId, date, eppInput);
|
||||
} else {
|
||||
feeOrCredit = Fee.create(Money.zero(registry.getCurrency()).getAmount(), FeeType.UPDATE);
|
||||
}
|
||||
|
||||
return new EppCommandOperations(currency, feeOrCredit);
|
||||
}
|
||||
|
||||
/** Returns the fee class for a given domain and date. */
|
||||
public static Optional<String> getFeeClass(String domainName, DateTime date) {
|
||||
return getDomainFeeClass(domainName, date);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue