Skip to content

fix(account): rename ReservedBalance.amounts to availableAmounts - #176

Merged
FranDisalvo90 merged 1 commit into
masterfrom
fix/reserved-balance-available-amounts
Jul 22, 2026
Merged

fix(account): rename ReservedBalance.amounts to availableAmounts#176
FranDisalvo90 merged 1 commit into
masterfrom
fix/reserved-balance-available-amounts

Conversation

@FranDisalvo90

Copy link
Copy Markdown
Contributor

Summary

  • The API returns availableAmounts for each entry in bankData.reservedBalances — see the ReservedBalance schema in https://api.pluggy.ai/oas3.json, where it is a required property. The SDK typed it as amounts.
  • The client does no key remapping, so the field always read as undefined at runtime and reserved balances ("caixinhas") rendered empty for anyone using the SDK types.
  • Adds unit coverage for the reserved-balance shape, including the null case.

This is a breaking rename at the type level, but no working consumer code can depend on amounts — it was never present in an API response. Released as a patch on that basis.

The same field name is wrong in pluggy-java and pluggy-net; fixes for those are opened separately.

Test plan

  • pnpm test — 56/56 pass
  • pnpm build clean
  • pnpm exec eslint . clean
  • Verified the new test fails if the field is renamed back: the Account-typed fixture produces TS2353/TS2339 under tsc. Note this does not surface in pnpm test, since isolatedModules: true makes ts-jest transpile without type-checking.

Each entry in `bankData.reservedBalances` is returned by the API with an
`availableAmounts` array — see the `ReservedBalance` schema in
https://api.pluggy.ai/oas3.json, where it is a required property. The SDK
typed it as `amounts`, and since the client does no key remapping the field
always read as `undefined` at runtime, making reserved balances look empty.

Type-level this is a breaking rename, but no working consumer code can be
relying on `amounts`: it was never present in an API response.

Adds unit coverage for the reserved-balance shape. The fixture is typed as
`Account` so renaming the field back is a compile error — note this only
surfaces under `tsc`, as `isolatedModules: true` makes ts-jest transpile
without type-checking.
@FranDisalvo90
FranDisalvo90 merged commit a763c24 into master Jul 22, 2026
2 checks passed
@FranDisalvo90
FranDisalvo90 deleted the fix/reserved-balance-available-amounts branch July 22, 2026 14:55
pluggy-github-app Bot pushed a commit that referenced this pull request Jul 22, 2026
# [0.90.0](v0.89.0...v0.90.0) (2026-07-22)

### Bug Fixes

* **account:** rename ReservedBalance.amounts to availableAmounts ([#176](#176)) ([a763c24](a763c24))
* **deps:** patch undici, js-yaml and brace-expansion advisories ([#177](#177)) ([85ececd](85ececd))

### Features

* **cc:** adding cc bill dates ([#175](#175)) ([1a60c64](1a60c64))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants