Closed ChrisCScott closed 5 years ago
Rather than pass around dicts of {timing: amount} pairs (or lists of [timing] vals), I've generalized the existing nper
logic in the Account
class by moving it to utility
and using it in Person
and Debt
to add a payment_frequency
property.
This makes it easy to specify the number of payments each year, which we'll assume are evenly spaced. For single-transaction items (asset sale, tax refund), add a payment_timing
property that uses the when
logic (previously moved over to utility
).
We will likely need to make changes to the ContributionStrategy
class, perhaps to return a dict (and ingest more information, e.g. a Person
ref instead of simply their net income as a Money
object?)
To accurately model flows to/from savings over the year, it's necessary to know when those transactions occur. In particular, we need to know:
Tax
identify a timing; forTaxCanada
this could be set incanada.constants
to t=1/3)Person
?)DebtPaymentStrategy.timing
; revise to give each debt a payment schedule as a list or dict?)In some of these cases, we want money to flow to/from an account multiple times in a year. Think about how to accommodate transaction schedules, especially for debts and income.
Should classes like
DebtPaymentStrategy
return adict[Debt, dict[Decimal, transaction] ]
mapping instead (whereDecimal
is the timing)? If so, how can we be sure that debt minimum payments are not being shifted in time - record them first inForecast
, via a separate call toDebtPaymentStrategy
? (This is probably the way to do it.)