Forbid negative premium prices#3108
Conversation
This hasn't been an issue, but it seems like a good idea. Note that I'm allowing prices of 0 here just in case there's some shenanigans at some point in time where we want a domain to technically be premium without having a cost.
CydeWeys
left a comment
There was a problem hiding this comment.
I wonder if there's anywhere else in the codebase we should enforce prices/fees being non-negative? Maybe in the Fee classes, and something in the Tld class that sets the standard create/renewal price?
@CydeWeys made 1 comment.
Reviewable status: 0 of 2 files reviewed, all discussions resolved.
CydeWeys
left a comment
There was a problem hiding this comment.
@CydeWeys reviewed 2 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on gbrodman).
gbrodman
left a comment
There was a problem hiding this comment.
TLDs are an odd case because those are just loaded automatically from the YAML. For Fees, we do already verify that it's nonnegative.
@gbrodman made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on gbrodman).
CydeWeys
left a comment
There was a problem hiding this comment.
But we could throw an error on negative values when loading from the YAML, right? Also the YAML doesn't even have to be checked into source control (for non-production domains).
@CydeWeys made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on gbrodman).
gbrodman
left a comment
There was a problem hiding this comment.
it's not quite that simple but kinda yeah, doing that in a separate PR
@gbrodman made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on gbrodman).
This hasn't been an issue, but it seems like a good idea. Note that I'm allowing prices of 0 here just in case there's some shenanigans at some point in time where we want a domain to technically be premium without having a cost.
This change is