instead of autocontribution, implement and default to contributions of 2500 per month with 3% APY, 22500 401k per year

This commit is contained in:
Bel LaPointe
2023-10-27 19:53:31 -06:00
parent 7e7488af2e
commit aaa76347ba
2 changed files with 9 additions and 1 deletions

View File

@@ -65,7 +65,7 @@
<span>
<label for="prediction">prediction</label>
<input name="prediction" type="text" value="autoContributions=&prediction=interest=AssetAccount:Cash \$ 0.02"/>
<input name="prediction" type="text" value="interest=AssetAccount:Cash \$ 0.02&prediction=contributions=AssetAccount:Bonds $ 1875&prediction=contributions=AssetAccount:Monthly $ 2500&prediction=interest=AssetAccount:Monthly \$ 0.03"/>
</span>
<span>

View File

@@ -115,6 +115,14 @@ func main() {
prediction = append(prediction, ana.NewInterestPredictor(fields[0], fields[1], apy))
case "autoContributions":
prediction = append(prediction, ana.NewAutoContributionPredictor(register))
case "contributions":
name := fields[0]
currency := ledger.Currency(fields[1])
value, err := strconv.ParseFloat(fields[2], 64)
if err != nil {
panic(err)
}
prediction = append(prediction, ana.NewContributionPredictor(ledger.Balances{name: ledger.Balance{currency: value}}))
default:
panic(k)
}