Change disable invoicing flag to enable invoicing flag (#783)

* Change disable invoicing flag to enable invoicing flag

This flag will be the sole determinor on if invoicing is enabled,
regardless of TLD types.

Once this PR is deployed we will need to run the nomulus command to
update this flag on all launched open TLDs.

For context on why this change is made, see b/159626744.

* Rename enableInvoicing to InvoicingEnabled
This commit is contained in:
Lai Jiang 2020-09-09 19:37:41 -04:00 committed by GitHub
parent fb7ba80b86
commit 125f509b46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 17 deletions

View file

@ -55,9 +55,7 @@ FROM (
FROM
`%PROJECT_ID%.%DATASTORE_EXPORT_DATA_SET%.%REGISTRY_TABLE%`
WHERE
-- TODO(b/18092292): Add a filter for tldState (not PDT/PREDELEGATION)
tldType = 'REAL'
AND disableInvoicing is not TRUE) ) AS BillingEvent
enableInvoicing IS TRUE) ) AS BillingEvent
-- Gather billing ID from registrar table
-- This is a 'JOIN' as opposed to 'LEFT JOIN' to filter out
-- non-billable registrars

View file

@ -340,12 +340,12 @@ public class Registry extends ImmutableObject implements Buildable {
TldType tldType = TldType.REAL;
/**
* Whether to disable invoicing for a {@link TldType#REAL} TLD.
* Whether to enable invoicing for this TLD.
*
* <p>Note that invoicing is always disabled for {@link TldType#TEST} TLDs. Setting this field has
* no effect for {@link TldType#TEST} TLDs.
* <p>Note that this boolean is the sole determiner on whether invoices should be generated for a
* TLD. This applies to {@link TldType#TEST} TLDs as well.
*/
boolean disableInvoicing = false;
boolean invoicingEnabled = false;
/**
* A property that transitions to different TldStates at different times. Stored as a list of
@ -646,8 +646,8 @@ public class Registry extends ImmutableObject implements Buildable {
return this;
}
public Builder setDisableInvoicing(boolean disableInvoicing) {
getInstance().disableInvoicing = disableInvoicing;
public Builder setInvoicingEnabled(boolean invoicingEnabled) {
getInstance().invoicingEnabled = invoicingEnabled;
return this;
}

View file

@ -118,10 +118,10 @@ abstract class CreateOrUpdateTldCommand extends MutatingCommand {
@Nullable
@Parameter(
names = "--disable_invoicing",
description = "Whether invoicing is disabled for a REAL tld.",
names = "--invoicing_enabled",
description = "Whether invoicing is enabled for this tld.",
arity = 1)
private Boolean disableInvoicing;
private Boolean invoicingEnabled;
@Nullable
@Parameter(
@ -327,7 +327,7 @@ abstract class CreateOrUpdateTldCommand extends MutatingCommand {
Optional.ofNullable(serverStatusChangeCost)
.ifPresent(builder::setServerStatusChangeBillingCost);
Optional.ofNullable(tldType).ifPresent(builder::setTldType);
Optional.ofNullable(disableInvoicing).ifPresent(builder::setDisableInvoicing);
Optional.ofNullable(invoicingEnabled).ifPresent(builder::setInvoicingEnabled);
Optional.ofNullable(lordnUsername).ifPresent(u -> builder.setLordnUsername(u.orElse(null)));
Optional.ofNullable(claimsPeriodEnd).ifPresent(builder::setClaimsPeriodEnd);
Optional.ofNullable(numDnsPublishShards).ifPresent(builder::setNumDnsPublishLocks);

View file

@ -55,9 +55,7 @@ FROM (
FROM
`my-project-id.latest_datastore_export.Registry`
WHERE
-- TODO(b/18092292): Add a filter for tldState (not PDT/PREDELEGATION)
tldType = 'REAL'
AND disableInvoicing is not TRUE) ) AS BillingEvent
enableInvoicing IS TRUE) ) AS BillingEvent
-- Gather billing ID from registrar table
-- This is a 'JOIN' as opposed to 'LEFT JOIN' to filter out
-- non-billable registrars

View file

@ -618,9 +618,9 @@ enum google.registry.model.registrar.RegistrarContact$Type {
class google.registry.model.registry.Registry {
@Id java.lang.String tldStrId;
@Parent com.googlecode.objectify.Key<google.registry.model.common.EntityGroupRoot> parent;
boolean disableInvoicing;
boolean dnsPaused;
boolean escrowEnabled;
boolean invoicingEnabled;
com.googlecode.objectify.Key<google.registry.model.registry.label.PremiumList> premiumList;
google.registry.model.CreateAutoTimestamp creationTime;
google.registry.model.common.TimedTransitionProperty<google.registry.model.registry.Registry$TldState, google.registry.model.registry.Registry$TldStateTransition> tldStateTransitions;