Rework debts: every debt type, projections, strategies, and a redesigned UI - #54
Merged
Conversation
…rojections Schema v9 adds per-type debt fields (APR in basis points, loan payment/ principal, revolving statement profile, informal due date) and a principal/ interest split on installments (existing BNPL rows backfilled as 100% principal). New amortization engine (integer half-up interest kernel, annuity payment solve, balance-walk schedule generation with residual-absorbing final payment). Loans book principal-only originations and pay via 3-leg splits (principal draws the liability, interest is expensed as paid), with extra payments that shorten the term or re-amortize. Revolving debts attach or create an on-budget card account with no schedule or envelope; interest lands via a monthly statement-review flow, payments are budget-neutral transfers. Informal debts are envelope-backed balances with arbitrary payments. Payoff projections, snowball-vs-avalanche comparison, and an overview aggregate (weighted APR, 12-month history) run as pure simulations sharing the interest kernel, capped with explicit feasibility flags. DeleteDebt now restores linked transactions' original postings and detaches (never deletes) revolving history.
…gies The Debts screen gains an overview dashboard (total owed, balance-weighted APR, due now, debt-free date, 12-month trend) and a statement-review banner. Each debt kind gets its own detail pane: loans show principal/interest columns, payoff pills and an extra-payment dialog with live preview; revolving cards show utilization, minimum due, statement review and recent activity; informal IOUs show the owed balance with arbitrary payments. The add/edit form is type-driven — pick a kind and only its fields appear, with a live plan preview (computed payment or term, payoff date, total interest). A strategies dialog compares snowball vs avalanche with payoff order and totals. The Add Transaction 'Pay debt' path now handles schedule-less debts with a free amount defaulted to the minimum due or remaining balance.
The Debts tab header now shows total owed, weighted APR, and the debt-free date; cards are per-kind (schedule progress, card utilization with minimum due, IOU balance with due date), with a statement-review banner and a payoff strategies page. The add/edit form is type-driven with a live plan preview. Detail pages match the desktop: loans get payoff/interest figures, the principal/interest split per installment and an extra-payment page; cards get balance vs limit, statement review, record-payment and recent activity; IOUs get arbitrary payments and settlement state. Deleting a revolving debt explains that the account and its transactions stay.
… debt rework The demo document gains a mid-term car loan, upgrades its credit card to a tracked revolving debt by attaching the existing account, and adds a partly-repaid IOU. AmortizedPayment now rounds up so a solved payment never spills into an extra installment past the requested term, and an informal debt's due date now serves as its payoff projection so the dashboard's debt-free date covers IOUs. CHANGELOG under [Unreleased]; ROADMAP moves in-depth debt management from 'upcoming' to shipped; README feature list and usage notes updated.
The dashboard keeps the four stat cards (total owed, average APR, due now, debt-free by); the 12-month history line and its core plumbing (DebtOverview.History, debtHistory, MonthBalance) are dropped.
…dion Adding a debt now asks only for the bare minimum per kind — BNPL: name, total, installments, first due; loan: name, principal, APR, term; card: name, balance, APR; IOU: name, amount — each with its live plan preview. Everything optional (lender, pay-from account, dates, frequency, card statement/minimum profile, attach-account, deposited-to, note) folds into a collapsed 'Advanced setup' accordion with defaults that just work: pay-from picks the first account, dates default to today, frequency to Monthly, statement day to 1. Desktop and mobile alike; edit forms are unchanged.
The tab-per-debt master/detail becomes a single compact table — one row per debt with kind, APR, balance, a progress/utilization bar, and a status line (next due, overdue count, statement to review, min due, settled) tinted when it needs attention. Tapping a row selects it and opens its detail pane below; the selection persists across rebuilds like the old tabs did. Detail panes drop their inner scrolls to flow with the page. Mobile is unchanged.
Tapping a table row now opens the debt's detail pane in a popup. A single per-store subscriber repaints the open dialog after every store mutation — paying, undoing, editing, statements — and closes it when the debt itself is deleted from within. The Debts screen is left as just the dashboard and the compact table.
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.
Summary
Reworks the Debts module from BNPL-only into full debt tracking — the #1 item on the post-1.0 roadmap. Existing
.financyfiles migrate automatically (schema v8 → v9, column-adds only, with the usual pre-migration backup); BNPL debts behave exactly as before.Debt types
Projections & strategies
UI (desktop + mobile parity)
Fixes
AmortizedPaymentrounds up so a solved payment never spills into an extra installment past the requested term.Engineering notes
🤖 Generated with Claude Code