feat(web): add debt log tab and update docs#75
Conversation
25446c0 to
e593ba0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25446c0c33
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const totalPaidCents = payments.reduce((sum, payment) => sum + payment.amountCents, 0); | ||
| const remainingBalanceCents = Math.max(debt.startingBalanceCents - totalPaidCents, 0); | ||
| const progressPercent = debt.startingBalanceCents > 0 ? Math.min((totalPaidCents / debt.startingBalanceCents) * 100, 100) : 0; |
There was a problem hiding this comment.
Include accrued interest when computing remaining balance
getDebtMetrics computes remainingBalanceCents as startingBalanceCents - sum(payments) and never uses APR or payment dates, so the debt balance is treated as if no interest ever accrues. For any non-zero APR debt tracked over time (for example, a balance carried for a month before payment), the UI will understate current balance/progress and then send that understated totalDebt into /api/v1/debt/payoff, producing optimistic payoff projections.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
- Updated debt log balance metrics to accrue APR-based daily interest from the debt creation date through each logged payment date and then through today, instead of subtracting payments from principal only. This keeps the displayed remaining balance aligned with carried-balance interest. src/web/src/DebtLogPage.tsxL87-L129
- Adjusted payoff progress to use the interest-adjusted remaining balance, preventing overstated payoff progress when interest has accrued. src/web/src/DebtLogPage.tsxL130-L133
- Committed the fix on the current branch as
5b947cewith messagefix(web): accrue debt interest in remaining balance. - Created the follow-up PR metadata with title
fix(web): accrue debt interest in debt log balances. - I did not modify the pre-existing unrelated
pnpm-lock.yamlworking tree change. - Screenshot note: this is a frontend behavior change, but I could not take a screenshot because the required browser/screenshot tool was not available in this environment.
Testing
- ✅
pnpm --dir src/web build ⚠️ browser_container screenshot(not run because the browser/screenshot tool was unavailable in this environment)
No description provided.