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

@ -92,13 +92,12 @@ public final class DomainTransferUtils {
Trid trid,
String gainingClientId,
Money transferCost,
int years,
DateTime now) {
String targetId = existingDomain.getFullyQualifiedDomainName();
// Create a TransferData for the server-approve case to use for the speculative poll messages.
TransferData serverApproveTransferData =
createTransferDataBuilder(
existingDomain, trid, gainingClientId, automaticTransferTime, years, now)
existingDomain, trid, gainingClientId, automaticTransferTime, now)
.setTransferStatus(TransferStatus.SERVER_APPROVED)
.build();
Registry registry = Registry.get(existingDomain.getTld());
@ -110,8 +109,7 @@ public final class DomainTransferUtils {
targetId,
gainingClientId,
registry,
transferCost,
years))
transferCost))
.addAll(
createOptionalAutorenewCancellation(
automaticTransferTime, historyEntry, targetId, existingDomain)
@ -255,14 +253,13 @@ public final class DomainTransferUtils {
String targetId,
String gainingClientId,
Registry registry,
Money transferCost,
int years) {
Money transferCost) {
return new BillingEvent.OneTime.Builder()
.setReason(Reason.TRANSFER)
.setTargetId(targetId)
.setClientId(gainingClientId)
.setCost(transferCost)
.setPeriodYears(years)
.setPeriodYears(1)
.setEventTime(automaticTransferTime)
.setBillingTime(automaticTransferTime.plus(registry.getTransferGracePeriodLength()))
.setParent(historyEntry)
@ -274,15 +271,13 @@ public final class DomainTransferUtils {
Trid trid,
String gainingClientId,
DateTime automaticTransferTime,
int years,
DateTime now) {
return new TransferData.Builder()
.setTransferRequestTrid(trid)
.setTransferRequestTime(now)
.setGainingClientId(gainingClientId)
.setLosingClientId(existingDomain.getCurrentSponsorClientId())
.setPendingTransferExpirationTime(automaticTransferTime)
.setExtendedRegistrationYears(years);
.setPendingTransferExpirationTime(automaticTransferTime);
}
private DomainTransferUtils() {}