Use outstanding_entry_fees_with_donation instead of entry_fee_with_donation - #15406
Open
FinnIckler wants to merge 2 commits into
Open
Use outstanding_entry_fees_with_donation instead of entry_fee_with_donation#15406FinnIckler wants to merge 2 commits into
FinnIckler wants to merge 2 commits into
Conversation
gregorbg
reviewed
Aug 21, 2026
| def entry_fee_with_donation(iso_donation_amount = 0) | ||
| entry_fee + Money.new(iso_donation_amount, entry_fee.currency) | ||
| def outstanding_entry_fees_with_donation(iso_donation_amount = 0) | ||
| outstanding_entry_fees + Money.new(iso_donation_amount.clamp(0..), competition.currency_code) |
Member
There was a problem hiding this comment.
What's the exact point of using outstanding_entry_fees as opposed to entry_fee here?
I think I understand the gist of it from the method names already, but why didn't this blow up into our faces already six million times?
Member
Author
There was a problem hiding this comment.
It's a very rare case which why I assumed this has never happened:
- User pays x money for their registration
- User actually has to pay y for their registration so needs to pay again
- It doesn't take into account what he has already paid
This can only happen when registration fee was changed or the user was partially refunded, but then is not eligible for that refund anymore.
gregorbg
reviewed
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The non hotfix parts of #15405.
Adds some tests and removes dead code.