Add early settlement calculations and early repayment charges in Quotes.fs#58
Draft
Copilot wants to merge 4 commits into
Draft
Add early settlement calculations and early repayment charges in Quotes.fs#58Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/80eed1b3-eef2-45be-a577-e32b96e49092 Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/80eed1b3-eef2-45be-a577-e32b96e49092 Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
…e parameters Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/f5aaa990-6385-44d0-a4b6-a7287fea67ca Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
Author
Continued and completed the implementation. Commit f1a286a adds
|
Copilot
AI
changed the title
[WIP] Add early settlement calculations and early repayment charges in Quotes.fs
Add early settlement calculations and early repayment charges in Quotes.fs
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.
Extends
Quotes.fswith early settlement calculations required in UK consumer credit.Changes Made
src/Quotes.fsEarlySettlementMethod– discriminated union with three methods:Actuarial,RuleOf78,FCAEarlyRepaymentChargeType– discriminated union with two charge types:TieredPercentage of (int * Percent) arrayandFixedMonthsInterest of intEarlySettlementResult– record bundlingOutstandingPrincipal,InterestRebate,SettlementFigure,EarlyRepaymentCharge, andNetSettlementFigureruleOf78Settlement(private) – sum-of-digits rebate computed from the original basic schedulefcaSettlement(private) – statutory rebate via the existingInterest.calculateRebatefunction (Consumer Credit Act s.94 / Consumer Credit (Early Settlement) Regulations 2004)calculateEarlyRepaymentCharge(public) – computes the ERC for either a tiered-percentage or a fixed-months-interest charge typegetEarlySettlementQuote(public) – top-level function combining all three settlement methods with an optional ERC, returning anEarlySettlementResulttests/EarlySettlementTests.fsNew test file (12 tests) covering:
getQuoteoutputcalculateEarlyRepaymentChargefor both charge typesTesting
Interest.Rate.ToString()HTML generation bug) are unaffected