mirror of
https://github.com/google/nomulus.git
synced 2025-05-18 18:29:36 +02:00
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:
parent
4a9be60e0b
commit
6f69e96465
18 changed files with 105 additions and 62 deletions
|
@ -492,26 +492,32 @@ public class Registry extends ImmutableObject implements Buildable {
|
|||
}
|
||||
|
||||
/** Returns true if the given domain name is on the premium price list. */
|
||||
public boolean isPremiumName(String domainName) {
|
||||
return isPremiumName(InternetDomainName.from(domainName));
|
||||
public boolean isPremiumName(String domainName, DateTime priceTime, String clientIdentifier) {
|
||||
return isPremiumName(InternetDomainName.from(domainName), priceTime, clientIdentifier);
|
||||
}
|
||||
|
||||
/** Returns true if the given domain name is on the premium price list. */
|
||||
public boolean isPremiumName(InternetDomainName domainName) {
|
||||
@SuppressWarnings("unused")
|
||||
public boolean isPremiumName(
|
||||
InternetDomainName domainName, DateTime priceTime, String clientIdentifier) {
|
||||
return getPremiumPriceForSld(domainName).isPresent();
|
||||
}
|
||||
|
||||
/** Returns the billing cost for registering the specified domain name for this many years. */
|
||||
public Money getDomainCreateCost(String domainName, int years) {
|
||||
@SuppressWarnings("unused")
|
||||
public Money getDomainCreateCost(
|
||||
String domainName, DateTime priceTime, String clientIdentifier, int years) {
|
||||
checkArgument(years > 0, "Number of years must be positive");
|
||||
Money annualCost = getPremiumPriceForSld(domainName).or(getStandardCreateCost());
|
||||
return annualCost.multipliedBy(years);
|
||||
}
|
||||
|
||||
/** Returns the billing cost for renewing the specified domain name for this many years. */
|
||||
public Money getDomainRenewCost(String domainName, int years, DateTime now) {
|
||||
@SuppressWarnings("unused")
|
||||
public Money getDomainRenewCost(
|
||||
String domainName, DateTime priceTime, String clientIdentifier, int years) {
|
||||
checkArgument(years > 0, "Number of years must be positive");
|
||||
Money annualCost = getPremiumPriceForSld(domainName).or(getStandardRenewCost(now));
|
||||
Money annualCost = getPremiumPriceForSld(domainName).or(getStandardRenewCost(priceTime));
|
||||
return annualCost.multipliedBy(years);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue