[WSAPI-12] Expose security symbol/exchange/name/price on GET /positions #11

Merged
chris merged 6 commits from feature/WSAPI-12 into main 2026-09-25 09:46:16 -06:00
Owner

Ticket

WSAPI-12 Expose security symbol/exchange/name/price on GET /positions

Summary

GET /positions now exposes nullable symbol/name/primaryExchange/primaryMic/price/currency per position (price is a sync-time snapshot) for HOMELAB-150's intraday valuation.

  • securities resolver parses name/primaryExchange/primaryMic (empty/missing → null, never fails the batch)
  • sync/balances persists the resolved lookup as securities on the balances cache
  • /positions enriches each position by securityId (nulls for unresolved and legacy docs)
  • docs updated

Known/accepted:

  • unpriced securities stay unresolved (null symbol)
  • a failed quote fetch caches securities: [] for that day
  • live verification of the stock sub-shape happens after deploy
  • the lib/config test fails locally only because of the machine's .env

🤖 Generated with Claude Code

## Ticket [WSAPI-12](http://192.168.2.100:7123/home/browse/WSAPI-12/) Expose security symbol/exchange/name/price on GET /positions ## Summary `GET /positions` now exposes nullable `symbol`/`name`/`primaryExchange`/`primaryMic`/`price`/`currency` per position (`price` is a sync-time snapshot) for HOMELAB-150's intraday valuation. - securities resolver parses name/primaryExchange/primaryMic (empty/missing → null, never fails the batch) - sync/balances persists the resolved lookup as `securities` on the balances cache - /positions enriches each position by securityId (nulls for unresolved and legacy docs) - docs updated Known/accepted: - unpriced securities stay unresolved (null symbol) - a failed quote fetch caches `securities: []` for that day - live verification of the stock sub-shape happens after deploy - the lib/config test fails locally only because of the machine's `.env` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Fix a regression: empty-string name/primaryExchange/primaryMic now normalize to
null instead of failing zod validation for the whole page (which degraded every
holding to cash-only). Update stale comments/docs invalidated by that fix and by
the securities-cache addition. Strengthen test coverage: empty-string
normalization, securities-lookup assertions on the cash-only/zero-account/
partial-pricing sync paths, a mixed enriched/unresolved GET /positions case, full
document toEqual assertions in the balances-cache tests, and a shared quote()
test factory in lib/wealthsimple/balances/.test.ts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reword a test comment that mischaracterized GraphQL's actual response shape
(an omitted key is a defensive tolerance check, not something a real response
sends). Extend the empty-string regression test to cover primaryExchange as
well as name/primaryMic. Drop the now-redundant `?? null` in the securities
resolver's mapping. Remove unneeded type casts on two toEqual assertions in
the balances-cache tests by assigning the expected value to a local const
first, which sidesteps the excess-property literal check without a cast.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
[WSAPI-12] Compress CLAUDE.md additions.
All checks were successful
server / check (pull_request) Successful in 31s
de8ae9bcaf
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
chris merged commit 387ecb72dc into main 2026-09-25 09:46:16 -06:00
chris deleted branch feature/WSAPI-12 2026-09-25 09:46:16 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
chris/wealthsimple-api!11
No description provided.