Remove obsolete TransferData.extendedRegistrationYears

Now that transfers are always restricted to 1 year, it's unnecessary to store
extendedRegistrationYears on TransferData - it will always be equal to 1.  This
simplifies logic in a few other places, e.g. RdeDomainImportAction.

I verified in BigQuery that no DomainBases exist with extendedRegistrationYears
values that aren't either null or equal to 1.  At some point we should remove
the persisted fields from datastore via e.g. resaving all those domains, but
it's low priority and can wait until we have some more pressing migration.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150373897
This commit is contained in:
nickfelt 2017-03-16 15:03:18 -07:00 committed by Ben McIlwain
parent 70fbdccea2
commit 09f619cce2
29 changed files with 54 additions and 215 deletions

View file

@ -247,9 +247,8 @@ public class DomainResource extends DomainBase
cloneProjectedAtTime(transferExpirationTime.minusMillis(1));
// If we are within an autorenew grace period, the transfer will subsume the autorenew. There
// will already be a cancellation written in advance by the transfer request flow, so we don't
// need to worry about billing, but we do need to reduce the number of years added to the
// expiration time by one to account for the year added by the autorenew.
int extraYears = transferData.getExtendedRegistrationYears();
// need to worry about billing, but we do need to cancel out the expiration time increase.
int extraYears = 1; // All transfers are one year.
if (domainAtTransferTime.getGracePeriodStatuses().contains(GracePeriodStatus.AUTO_RENEW)) {
extraYears--;
}

View file

@ -81,12 +81,6 @@ public class TransferData extends BaseTransferObject implements Buildable {
/** The transaction id of the most recent transfer request (or null if there never was one). */
Trid transferRequestTrid;
/**
* The number of years to add to the registration expiration time if this transfer is approved.
* Can be null if never transferred, or for resource types where it's not applicable.
*/
Integer extendedRegistrationYears;
public ImmutableSet<Key<? extends TransferServerApproveEntity>> getServerApproveEntities() {
return nullToEmptyImmutableCopy(serverApproveEntities);
}
@ -107,10 +101,6 @@ public class TransferData extends BaseTransferObject implements Buildable {
return transferRequestTrid;
}
public Integer getExtendedRegistrationYears() {
return extendedRegistrationYears;
}
@Override
public Builder asBuilder() {
return new Builder(clone(this));
@ -155,12 +145,6 @@ public class TransferData extends BaseTransferObject implements Buildable {
getInstance().transferRequestTrid = transferRequestTrid;
return this;
}
/** Set the years to add to the registration if this transfer completes. */
public Builder setExtendedRegistrationYears(Integer extendedRegistrationYears) {
getInstance().extendedRegistrationYears = extendedRegistrationYears;
return thisCastToDerived();
}
}
/**