Remove benefit "level" mixins #6378
Open
+329
−38
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.
Summary
This applies the same refactoring that was done in #6360 to benefits, which have a similar API (they only discount when they can discount, the same way conditions only check eligibility if they are applicable).
This work is extracted from #6371. If we get this in earlier, that work gets easier to review.
Note that I have not gone to the trouble to add deprecation warnings here. If anyone can show me real-world code that has actually created new benefits and that would benefit from a deprecation warning, I'll happily add them.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: