Cancel Allowance Compat Issue
PROGRAMMING TASK
Description of Task
Update how the /renter POST
endpoint handles cancelling the allowance.
Reason or Need for Change
There are some compatibility concerns with cancelling the allowance with the current set up of using the /renter POST
endpoint. Since the API can't assume that empty fields are nil values, the user has to explicitly submit the nil values for all the allowance fields in order to cancel the allowance. If the endpoint assumed empty fields were nil values then anytime the endpoint was used for something other than the allowance the allowance would be cancelled.
Since we allow the user to submit partial allowance settings, we set empty fields to the default values. This means when we add new fields to the allowance, we set them to the defaults for a user that might not know about them and therefore isn't setting them. So when they user goes to cancel the allowance, they submit a request with the nil values of the fields they know about. This would get handled like a partial allowance setting and therefore wouldn't fully cancel the allowance.
Design / Proposal
Add an explicit cancel allowance endpoint and update /renter POST
to cancel the allowance if the required fields are set to zero.