Add new Savings.fs module for ISA projections, fixed-term deposits and Premium Bonds#67
Draft
Copilot wants to merge 2 commits into
Draft
Add new Savings.fs module for ISA projections, fixed-term deposits and Premium Bonds#67Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…remium Bonds Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/160cd874-3514-4a8a-a882-8983afe56823 Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
Author
Done. Commit 1. Regular savings / ISA projections (
2. Fixed-term deposits (
3. Premium Bonds (
21 new tests added in |
Copilot
AI
changed the title
[WIP] Add new module Savings.fs for ISA projections and deposits
Add new Savings.fs module for ISA projections, fixed-term deposits and Premium Bonds
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new
Savingsmodule (src/Savings.fs) covering all three areas from the issue. All monetary values use the library's existingint64<Cent>precision model.Changes Made
1. Regular savings / ISA projections
projectreturns a month-by-monthSavingsProjectionEntry arraytracking opening/closing balance, contribution, interest earned, and running totalsCompoundingFrequency:Daily,Monthly,Quarterly,AnnuallyTaxWrapper:None,Isa(tax-free label, amounts unchanged),Lisa(25% government bonus applied to each contribution),PensionSalarySacrifice(configurable employer match rate)SavingsRate:Fixed(single rate for the full term) orStepped(array of{ FromMonth; AnnualRate }entries for variable/stepped-rate projections)2. Fixed-term deposits
projectDepositreturns a full per-monthDepositProjectionEntryschedule and aDepositMaturityResultInterestPaymentTiming:AtMaturity(interest compounds monthly, paid as a lump sum at the end),Monthly/Annually(simple interest paid out periodically; principal stays fixed)grossToAer/aerToGross— AER ↔ gross rate conversion using the FCA-standard formulaAER = (1 + r/n)^n − 1earlyWithdrawal— calculates gross interest to date, a configurable month-count penalty, and the net amount returned to the depositor3. Premium Bonds expected return (stretch goal)
premiumBondsExpectedReturn— expected annual prize income based on the NS&I prize fund ratecomparePremiumBonds— returns aPremiumBondsComparisonwith: expected PB return, equivalent gross rate needed on a taxable account to match after tax, after-tax return on a taxable savings account at the same rate, and cash ISA returnTesting
tests/SavingsTests.fscovering all sub-modules