ChrisCScott / forecaster

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

Add generic `TaxMultiJurisdiction` class #50

Closed ChrisCScott closed 5 years ago

ChrisCScott commented 6 years ago

TaxCanada presents a very common use-case: it needs to combine provincial and federal taxes. It doesn't need to subclass Tax, but should conform to roughly the same interface as Tax.

Consider adding a TaxMultiJurisdiction class which generically combines 2 (or more?) Tax objects in a sensible way (e.g. add together their tax liability, calculate combined marginal brackets and rates, etc.). This could completely replace TaxCanada, except that we might want to subclass it just to name the federal and provincial members for ease of access.

Consider also formally defining a ITax interface to define functionality to be made available to client code, since at least some Tax methods likely don't need to be.