Skip to content

Add new module: Disclosure.fs (FCA CONC, EU SECCI, US TILA)#68

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-disclosure-module
Draft

Add new module: Disclosure.fs (FCA CONC, EU SECCI, US TILA)#68
Copilot wants to merge 3 commits into
mainfrom
copilot/add-disclosure-module

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 28, 2026

Adds a new Disclosure.fs module that computes the key regulatory metrics required for consumer credit documentation across UK, EU and US regimes.

Changes Made

src/Disclosure.fs (new)

Three public disclosure functions, each accepting Amortisation.Schedule as their primary input so all figures remain consistent with the amortisation model:

Function Regime Key figures
ukConc aprPrecision schedule UK FCA MCOB / CONC App 1.2 APR, Total Cost of Credit, Total Amount Payable, Representative APR
euSecci aprPrecision schedule EU Directive 2008/48/EC (SECCI) APR, TCC, TAP
euSecciRepaymentSchedule schedule EU SECCI repayment schedule EuSecciRepaymentEntry array — date and amount per payment
usTila aprPrecision schedule US TILA / Regulation Z (12 CFR Part 1026 Appendix J) Finance Charge, Amount Financed (principal minus prepaid day-0 fees), APR

APR for each regime is computed using the existing Apr.calculate infrastructure with the appropriate method (UnitedKingdom, EuropeanUnion, UsActuarial). TCC is derived directly from the schedule's InterestPortion + FeePortion + ChargesPortion per-item totals.

tests/DisclosureTests.fs (new)

22 unit tests across UkConcTests, EuSecciTests, and UsTilaTests covering:

  • TAP = principal + TCC invariant
  • TCC equals BasicSchedule.Stats.InterestTotal for fee-free loans
  • APR positivity and consistency with InitialApr from BasicSchedule
  • Repayment schedule length, positive amounts, ascending dates, and total matching TAP
  • TILA amount-financed equals principal when there are no prepaid fees

Testing

  • ✅ Build succeeds with 0 warnings/errors
  • ✅ All 22 new disclosure tests pass
  • ✅ No regressions introduced (219 pre-existing failures in HTML-generation code remain unchanged)

Copilot AI linked an issue Apr 28, 2026 that may be closed by this pull request
Copilot AI requested a review from simontreanor April 28, 2026 23:32
Copy link
Copy Markdown
Owner

@simontreanor simontreanor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot continue

Copilot AI and others added 2 commits April 29, 2026 22:34
Copy link
Copy Markdown
Author

Copilot AI commented Apr 29, 2026

@copilot continue

Done — commit 43f64e1 adds the full Disclosure.fs module (and DisclosureTests.fs). Here's a summary of what was implemented:

src/Disclosure.fs — three public functions, each accepting Amortisation.Schedule as primary input:

Function Regime Returns
ukConc aprPrecision schedule UK FCA CONC App 1.2 UkConc — APR, TCC, Total Amount Payable, Representative APR
euSecci aprPrecision schedule EU Directive 2008/48/EC EuSecci — APR, TCC, Total Amount Payable
euSecciRepaymentSchedule schedule EU SECCI sheet EuSecciRepaymentEntry array — (date, amount) pairs
usTila aprPrecision schedule US TILA / Reg Z UsTila — Finance Charge, Amount Financed (principal minus day-0 prepaid fees), APR

APR for each regime is computed using the existing Apr.calculate infrastructure with the appropriate method (UnitedKingdom, EuropeanUnion, UsActuarial). TCC is derived directly from the schedule's InterestPortion + FeePortion + ChargesPortion totals.

tests/DisclosureTests.fs — 22 passing unit tests covering all three regimes, including invariant checks (TAP = principal + TCC), consistency with BasicSchedule.Stats, and APR range assertions.

Copilot AI changed the title [WIP] Add new module: Disclosure.fs for regulatory metrics Add new module: Disclosure.fs (FCA CONC, EU SECCI, US TILA) Apr 29, 2026
Copilot AI requested a review from simontreanor April 29, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New module: Disclosure.fs (FCA CONC, EU SECCI, US TILA)

2 participants