mirror of
https://github.com/google/nomulus.git
synced 2025-07-23 19:20:44 +02: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:
parent
3fc7271145
commit
633b30725a
10 changed files with 138 additions and 12 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue