[WSAPI-9] Fix balances sync: string simpleReturns.rate #7

Merged
chris merged 3 commits from bug/WSAPI-9 into main 2026-09-16 10:40:11 -06:00
Owner

Ticket

WSAPI-9 Fix balances sync: FetchAllAccountFinancials schema rejects string simpleReturns.rate

Summary

  • Widened simpleReturns.rate in lib/wealthsimple/accounts/index.ts from z.number().nullable() to numericAmountSchema.nullable(), matching the tolerance every other numeric field in this query already has for Wealthsimple's number-vs-numeric-string drift.
  • Reproduced the drift in accounts-page-1.json (tfsa account's rate as a string) and added test coverage for both the string-rate coercion and a null rate parsing to null rather than 0 or throwing.
  • Updated schema.ts's and the nested CLAUDE.md's descriptions of numericAmountSchema to include rates alongside money amounts and security quantities, matching the actual consumer set.

🤖 Generated with Claude Code

## Ticket [WSAPI-9](http://192.168.2.100:7123/home/browse/WSAPI-9/) Fix balances sync: FetchAllAccountFinancials schema rejects string simpleReturns.rate ## Summary - Widened `simpleReturns.rate` in `lib/wealthsimple/accounts/index.ts` from `z.number().nullable()` to `numericAmountSchema.nullable()`, matching the tolerance every other numeric field in this query already has for Wealthsimple's number-vs-numeric-string drift. - Reproduced the drift in `accounts-page-1.json` (tfsa account's `rate` as a string) and added test coverage for both the string-rate coercion and a `null` rate parsing to `null` rather than `0` or throwing. - Updated `schema.ts`'s and the nested `CLAUDE.md`'s descriptions of `numericAmountSchema` to include rates alongside money amounts and security quantities, matching the actual consumer set. 🤖 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>
[WSAPI-9] Fix inaccurate schema.ts comment wording.
All checks were successful
server / check (pull_request) Successful in 31s
522f4cdf69
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
chris merged commit d8abceb7d0 into main 2026-09-16 10:40:11 -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!7
No description provided.