Adding withdrawal to contribution limits
This PR calculates limits not only from deposits but from withdrawals also.
The solution is tested locally.
Closes https://github.com/afadil/wealthfolio/issues/338
@vaishsriram, thanks for the contribution! I'm not sure about this, though.
Actually, contribution limits are used to track and enforce legal caps on how much users can deposit into regulated (tax-advantaged) accounts annually (e.g., RRSP, TFSA, FHSA in Canada or 401(k), IRA, HSA in the U.S.). These limits are defined by tax law and vary by account type.
- Only deposits count against the limit
- Withdrawals do not affect current-year room
- For some accounts, TFSA withdrawals restore room in the following year, not the current year.
@vaishsriram, thanks for the contribution! I'm not sure about this, though. Actually, contribution limits are used to track and enforce legal caps on how much users can deposit into regulated (tax-advantaged) accounts annually (e.g., RRSP, TFSA, FHSA in Canada or 401(k), IRA, HSA in the U.S.). These limits are defined by tax law and vary by account type.
- Only deposits count against the limit
- Withdrawals do not affect current-year room
- For some accounts, TFSA withdrawals restore room in the following year, not the current year.
@afadil thanks for the detailed response, and apologies for the delay in getting back.
I see what you mean for regulated, tax-advantaged accounts (RRSP, TFSA, 401k, etc.) where withdrawals don’t affect contribution room. That makes sense.
That said, I was thinking more about a different use case: after-tax contribution accounts where a user might still want to set an annual limit for themselves, and both deposits and withdrawals would affect that limit.
From your suggestion, it sounds like modeling this as a goal with time constraints (e.g., yearly savings goals) could be a better fit. The one wrinkle I see is that the same account can’t be assigned to multiple goals today, so I’m curious if you think extending the goal system (or making contribution limits a first-class property of an account) would be a more flexible path forward.
Do you think goals with dates offer a more flexible alternative, or is the current setup still the better option?