[WSAPI-13] Include household-visible accounts (Sarah's RRSP) in the balances sync #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/WSAPI-13"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plane: WSAPI-13
Summary
Adds household-visible Wealthsimple accounts (Sarah's RRSP,
rrsp-ZFgB7yct0Q) to the nightlysync/balances, taggedscope: 'household', merged with own accounts by id (own wins, no double-counting — Chris's TFSA is not household-shared).FetchIdentityPositionswithaccountScope: HOUSEHOLD(newlib/wealthsimple/household).FetchAccountsWithBalance500s for household accounts, so cash = latest daily net liquidation value (FetchIdentityHistoricalFinancials) − holdings, priced with the same merged quote map used for valuation. Non-CAD / stale / unparseable NLV and non-CAD quotes fall back to cash 0 with a warning.householdBalancesjob on/status; a household failure never fails the own-account sync, butSessionDeadErrorstill halts it.householdSyncedAt, and dropped after 7 days without a fresh sync.scopeandhouseholdSyncedAtexposed on/positions,/accounts,/balance.Limitation: a household account holding only cash (no positions) isn't discovered.
Verification
bun test: 455 pass, 0 fail; type-check, lint, format:check clean.bb91c7a,59ba6c2,8d65534).Follow-up
HOMELAB-151 — home-assistant-api counts household accounts ("RRSP (Sarah)") and flags stale household data.
🤖 Generated with Claude Code
CachedAccount (AccountBalances & { scope? }) in lib/account-balances-cache, and AccountTotal/accountTotalFor thread a scope ('own' default, explicit 'household') through lib/wealthsimple/balances, so /balance's per-account rows can carry which sync path produced them. Downstream test literals in routes/balance and sync/balances updated to the new required field. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>Each account row now carries scope: 'own' | 'household' ('own' for a legacy cache document with no scope at all), so a consumer (e.g. home-assistant-api's investments total) can tell a household-visible account like Sarah's RRSP apart from Chris's own accounts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>