feat: update currency_code to be optional #543
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Draft: this allows explicitly setting a quantity (e.g. a rate) as a dimenensionless number by not providing a currency_code
Previously we have insisted every contribution_amount be accompanied by a currency to avoid it being accidentally omitted.
However, this lead to a situation where people started placing non-monetary floats into the text field in order to avoid currency conversion. This in turn caused issues with ids that look like numbers: 1234E5432, 0001000 etc.
examples
anything else?
this change requires updating the amount field from integer to float - we may want a way to further validate the int status of monetary values
we may want to explicitly version this change as it means we will explicitly prohibit the use of contribution_text for numbers