Add a bit more verification text when unrenewing domains

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=248150595
This commit is contained in:
gbrodman 2019-05-14 09:25:21 -07:00 committed by jianglai
parent a0040c5eda
commit 7f69ebc5d9

View file

@ -136,7 +136,18 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
@Override
protected String prompt() {
return String.format("Unrenew these domain(s) for %d years?", period);
StringBuilder resultBuilder = new StringBuilder();
DateTime now = clock.nowUtc();
for (String domainName : mainParameters) {
DomainBase domain = loadByForeignKey(DomainBase.class, domainName, now).get();
DateTime previousTime = domain.getRegistrationExpirationTime();
DateTime newTime = leapSafeSubtractYears(previousTime, period);
resultBuilder.append(
String.format(
"%s expiration time changed from %s to %s\n", domainName, previousTime, newTime));
}
resultBuilder.append(String.format("Unrenew these domains(s) for %d years?", period));
return resultBuilder.toString();
}
@Override