Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TransferAllowance an interface #889

Open
mattwigway opened this issue Sep 13, 2023 · 0 comments
Open

Make TransferAllowance an interface #889

mattwigway opened this issue Sep 13, 2023 · 0 comments

Comments

@mattwigway
Copy link
Contributor

The base TransferAllowance class isn't really useful in any real-world system where there are differing transfer allowances per route/route type, because it only counts the number of transfer remaining, not what those transfers are to. I propose making it an interface that just has a boolean method atLeastAsGoodForAllFutureRedemptions, and let every individual transfer allowance handle its state internally. This would avoid confusion when new fare calculators are implemented; I know of at least two cases where this confusion has caused an issue - in the Boston calculator, where we were incorrectly cloning TransferAllowances and losing all Boston-specific information, and in the r5r fare calculator where the targets of the transfers were not being correctly tracked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant