Allow a credit of 0 when deleting a domain during a grace period (#1984)

There can be situations (anchor tenants, test tokens, other ways of
getting a domain to cost $0) where we may want to delete a domain during
the add grace period but the credit applied is 0. We should not fail on
those cases.

See b/277115241 for an example.
This commit is contained in:
gbrodman
2023-04-06 15:58:53 -04:00
committed by GitHub
parent 20c673840e
commit bd65c6eee6
3 changed files with 31 additions and 1 deletions
@@ -34,7 +34,7 @@ public class Credit extends BaseFee {
BigDecimal cost, FeeType type, String description) {
Credit instance = new Credit();
instance.cost = checkNotNull(cost);
checkArgument(instance.cost.signum() < 0);
checkArgument(instance.cost.signum() <= 0, "A credit cannot have a positive cost");
instance.type = checkNotNull(type);
instance.description = description;
return instance;