mirror of
https://github.com/google/nomulus
synced 2026-09-05 15:46:55 +00:00
Add the ability to nullify the entire billing account map (#1630)
This commit is contained in:
@@ -173,7 +173,8 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand {
|
||||
"Registrar Billing Account key-value pairs (formatted as key=value[,key=value...]), "
|
||||
+ "where key is a currency unit (USD, JPY, etc) and value is the registrar's billing "
|
||||
+ "account id for that currency. During update, only the pairs that need updating "
|
||||
+ "need to be provided.",
|
||||
+ "need to be provided, except when an empty string is provided, in which case the"
|
||||
+ "entire map is nullified.",
|
||||
converter = CurrencyUnitToStringMap.class,
|
||||
validateWith = CurrencyUnitToStringMap.class)
|
||||
private Map<CurrencyUnit, String> billingAccountMap;
|
||||
@@ -368,7 +369,9 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand {
|
||||
Optional.ofNullable(poNumber).ifPresent(builder::setPoNumber);
|
||||
if (billingAccountMap != null) {
|
||||
LinkedHashMap<CurrencyUnit, String> newBillingAccountMap = new LinkedHashMap<>();
|
||||
if (oldRegistrar != null && oldRegistrar.getBillingAccountMap() != null) {
|
||||
if (oldRegistrar != null
|
||||
&& oldRegistrar.getBillingAccountMap() != null
|
||||
&& !billingAccountMap.isEmpty()) {
|
||||
newBillingAccountMap.putAll(oldRegistrar.getBillingAccountMap());
|
||||
}
|
||||
newBillingAccountMap.putAll(billingAccountMap);
|
||||
|
||||
Reference in New Issue
Block a user