Add statement generation to Amortisation.fs#59
Draft
Copilot wants to merge 4 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/7d70f64a-926f-4ae2-9c4a-e95bcea2f44b Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/938c1a2f-9e28-4df7-8573-460e2c7f7775 Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
…aping test Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/938c1a2f-9e28-4df7-8573-460e2c7f7775 Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
Author
Completed. The implementation adds
Commits: |
Copilot
AI
changed the title
[WIP] Add statement generation function to Formatting.fs
Add statement generation to Amortisation.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.
Adds a month-by-month account statement generation feature to
Amortisation.fs, as a prerequisite for regulatory disclosure documents (e.g. SECCI, CCA s.77A).Changes Made
src/Amortisation.fsStatementLinerecord: 12 fields coveringDate,OpeningBalance,Advance,InterestCharged,ChargesIncurred,Payment,PrincipalPortion,FeePortion,InterestPortion,ChargesPortion,ClosingBalance, andCumulativeInterestPaidStatement.generate: converts anAmortisationScheduleinto aStatementLine array, carrying forward opening/closing balances and a running cumulative interest totalStatement.toPlainText: renders the statement as a fixed-width right-aligned plain-text table (suitable for inclusion in a letter or email)Statement.toCsv: renders the statement as RFC 4180-compliant CSV, quoting any field that contains a comma, double-quote, or newlinetests/StatementTests.fs(new file)23 tests covering:
generate: line count, opening/closing balance chain, zero opening balance, zero final closing balance when fully repaid, monotonically non-decreasing cumulative interest, date alignment, advance amount, cumulative interest equals sum of interest portions; add-on interest variantstoPlainText: header column names, separator row, line count, fixed-width table invariant, day-0 data row contenttoCsv: header prefix, header column count, line count, comma-containing amounts are quoted, day-0 CSV row content, RFC 4180-aware column-count invariant (correct""escape handling)tests/FSharp.Finance.Personal.Tests.fsprojStatementTests.fsin the compile listTesting
netstandard2.0andnetstandard2.1