mirror of
https://github.com/google/nomulus
synced 2026-08-27 19:37:07 +00:00
Handle Purchase Order numbers explicitly in billing pipeline
Note that these aren't used for most registrars. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=213631863
This commit is contained in:
@@ -310,6 +310,10 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
|
||||
@Nullable
|
||||
Long billingIdentifier;
|
||||
|
||||
/** Purchase Order number used for invoices in external billing system, if applicable. */
|
||||
@Nullable
|
||||
String poNumber;
|
||||
|
||||
/**
|
||||
* Map of currency-to-billing account for the registrar.
|
||||
*
|
||||
@@ -422,6 +426,10 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
|
||||
return billingIdentifier;
|
||||
}
|
||||
|
||||
public Optional<String> getPoNumber() {
|
||||
return Optional.ofNullable(poNumber);
|
||||
}
|
||||
|
||||
public ImmutableMap<CurrencyUnit, String> getBillingAccountMap() {
|
||||
if (billingAccountMap == null) {
|
||||
return ImmutableMap.of();
|
||||
@@ -644,20 +652,25 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setIanaIdentifier(Long ianaIdentifier) {
|
||||
public Builder setIanaIdentifier(@Nullable Long ianaIdentifier) {
|
||||
checkArgument(ianaIdentifier == null || ianaIdentifier > 0,
|
||||
"IANA ID must be a positive number");
|
||||
getInstance().ianaIdentifier = ianaIdentifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setBillingIdentifier(Long billingIdentifier) {
|
||||
public Builder setBillingIdentifier(@Nullable Long billingIdentifier) {
|
||||
checkArgument(billingIdentifier == null || billingIdentifier > 0,
|
||||
"Billing ID must be a positive number");
|
||||
getInstance().billingIdentifier = billingIdentifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPoNumber(Optional<String> poNumber) {
|
||||
getInstance().poNumber = poNumber.orElse(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setBillingAccountMap(@Nullable Map<CurrencyUnit, String> billingAccountMap) {
|
||||
if (billingAccountMap == null) {
|
||||
getInstance().billingAccountMap = null;
|
||||
|
||||
Reference in New Issue
Block a user