mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Add an unrenew_domain command to nomulus tool
This is used to reduce the expiration time of domain(s) by some number of years (if enough length remains in the registration term to do so). This does not back out the previously saved BillingEvent entities as they may have already been sent out and invoiced, so any related refunds must be handled out of band. In addition to reducing the registration expiration time on the domain itself, this command writes out a new history entry, one-time poll message informing the registrar of this change, auto-renew billing event and poll message, and updates/ends the old auto-renew billing event and poll message. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=224999285
This commit is contained in:
parent
9c706e79fd
commit
f58211402a
21 changed files with 801 additions and 15 deletions
|
@ -77,4 +77,13 @@ public class DateTimeUtils {
|
|||
checkArgument(years >= 0);
|
||||
return years == 0 ? now : now.plusYears(1).plusYears(years - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtracts years from a date, in the {@code Duration} sense of semantic years. Use this instead
|
||||
* of {@link DateTime#minusYears} to ensure that we never end up on February 29.
|
||||
*/
|
||||
public static DateTime leapSafeSubtractYears(DateTime now, int years) {
|
||||
checkArgument(years >= 0);
|
||||
return years == 0 ? now : now.minusYears(1).minusYears(years - 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue