export existing contribution predictor

This commit is contained in:
Bel LaPointe
2023-10-27 19:28:48 -06:00
parent 04a79add26
commit 7e7488af2e
2 changed files with 4 additions and 4 deletions

View File

@@ -44,10 +44,10 @@ func NewInterestPredictor(namePattern string, currencyPattern string, apy float6
func NewAutoContributionPredictor(reg ledger.Register) Predictor {
monthlyRate := getMonthlyAutoContributionRates(reg)
return newAutoContributionPredictor(monthlyRate)
return NewContributionPredictor(monthlyRate)
}
func newAutoContributionPredictor(monthlyRate map[string]ledger.Balance) Predictor {
func NewContributionPredictor(monthlyRate ledger.Balances) Predictor {
return func(given ledger.Balances, delta time.Duration) ledger.Balances {
months := float64(delta) / float64(month)
result := make(ledger.Balances)