ChrisCScott / forecaster

A personal finances forecasting tool for Canadian retirement planning
Other
1 stars 2 forks source link

Handle transactions to contribution groups #5

Closed ChrisCScott closed 6 years ago

ChrisCScott commented 6 years ago

For accounts that share contribution room (e.g. RegisteredAccounts), TransactionStrategy needs to avoid overcontributing by ensuring that it limits contributions to an account if another account in the group is also receiving contributions.

If we were doing this directly in the logic of each strategy, it would likely need to be done differently in different strategies:

Rather than do it that way, which is likely to make subclassing harder, add handling code at the __call__ level by adding contribution_group-aware logic to _recurse_min and/or _recurse_max.

See #4 for a related issue.