Chart an account's value over time in its detail view #389
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 542 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.377
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #389"
general
weight: 0.35
ethanteng
What
The account detail modal on
/financesnow opens on a chart of that account's value over time: its balance, what it owes, or what it is worth. It shows the latest value, the change over the selected range, and 1M/3M/6M/1Y/All buttons. A caption under the line says where the series came from.Why it is built this way
No provider gives Linc a balance history, and nothing here stored one per account (
FinancialSummaryHistoryheld only totals). So each series has exactly one source, never a blend:| Account | Series |
| --- | --- |
| Connected checking, savings, credit card | Rebuilt from posted transactions, working back day by day from the reported balance. A full history right away. |
| Investment, retirement, loan, mortgage, hand-entered | Values Linc records from now on. Each daily history row stores every account's Finances-page value with when its provider reported it. |
source_amount, positive when money leaves) in whole cents. It leaves pending transactions out, as the reported balance does, and starts at the earliest posted transaction, because before that the balance is unknown, not zero. It falls back to recorded values rather than guessing when a transaction is in another currency or lacks a date or amount.lastSyncedAt), not when Linc read it. An account the institution hasn't refreshed adds no new day, and an unconfirmed account adds none. This is the same rule the account's "Updated" line follows. A day's row is rewritten when any account moves, even with totals unchanged (a transfer between two cash accounts), but not when the stored JSON differs only in key order.Full write-up:
docs/ACCOUNT_VALUE_HISTORY.md(and a short CLAUDE.md section).Changes
prisma: nullableaccountValuesJSONB onfinancial_summary_history, plus migration20261121120000_add_history_account_values.src/services/account-value-history.ts: new. It builds the series (transaction rebuild or recorded values) and the per-account values to store.src/services/financial-history-service.ts/summary-cache-service.ts: the daily history write storesaccountValues.src/auth/finances-routes.ts: newGET /api/finances/accounts/:id/history.finances-overview-service.ts: exportsaccountIdand a newfindFinancesAccount, shared by the details and history routes.frontend/src/components/finances/AccountValueChart.tsx: new. It loads on its own, so it never waits on holdings and transactions, and is mounted at the top ofAccountDetailModal. Y-axis labels stay exact to the dollar ($21.75K, not every tick reading$22K).Reviewer notes
npm run migrate:deploybefore this backend goes out. Without the column, the history write fails (caught and logged, non-fatal) and the chart shows "unavailable".Testing
account-value-history.test.ts(14),account-value-history-route.test.ts(4) andAccountValueChart.test.tsx(17).financial-history-service.test.tsgains 4 tests for the per-account write, andAccountDetailModal.test.tsxgains 1 for the mounted chart.type-checkand frontendtscare clean, and eslint has no errors.market-news,plaid-security,feedback, 21 tests). They fail identically onmain.next devwith sample data for an investment account, a checking account, a credit card and a single recorded value, at desktop and phone width (no horizontal overflow).🤖 Generated with Claude Code