Save number of years in DomainApplication

Right now, DomainApplicationCreateFlow checks to make sure that the registration period is in years, but doesn't store it in the DomainApplication explicitly. Instead, when DomainAllocateFlow runs later, it goes back to the XML in the HistoryEntry to get the number of years. Corey suggests that it would be cleaner to store the number of years in the DomainApplication. This is stage one of a data migration; we store the value, but don't actually read it anywhere except in tests. If we have any outstanding domain applications, we will then need to write a scrap tool to populate the years field, after which we can start relying on the field.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137317739
This commit is contained in:
mountford 2016-10-26 14:11:30 -07:00 committed by Ben McIlwain
parent 1b7cee61a5
commit 748dd34385
5 changed files with 21 additions and 0 deletions

View file

@ -69,6 +69,10 @@ public class DomainApplication extends DomainBase {
@XmlTransient
LaunchPhase phase;
/** The requested number of years of registration. */
@XmlTransient
int years;
/** The current status of this application. */
@XmlTransient
ApplicationStatus applicationStatus;
@ -94,6 +98,10 @@ public class DomainApplication extends DomainBase {
return phase;
}
public int getYears() {
return years;
}
public ApplicationStatus getApplicationStatus() {
return applicationStatus;
}
@ -150,6 +158,11 @@ public class DomainApplication extends DomainBase {
getInstance().phase = phase;
return this;
}
public Builder setYears(int years) {
getInstance().years = years;
return this;
}
public Builder setApplicationStatus(ApplicationStatus applicationStatus) {
getInstance().applicationStatus = applicationStatus;