You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c34f3ed
Browse filesBrowse the repository at this point in the historyBrowse files
feat: entity scope on the ledger facade (entity_id, create_entity) (#240)
## Summary
Threads the multi-entity step 2 server surface (robosystems #1714,
v1.16.4) through the `LedgerClient` facade, so a caller can read and
close one entity of a reporting group without dropping to the generated
tier. Additive; no existing signature changes. Ships as a patch on 2.8:
the minor for this effort was 2.8.0. Twin of
robosystems-typescript-client #255.
## Changes
- **`entity_id=None`** on every GraphQL-backed read whose server field
takes it: `get_entity`, `get_summary`, `list_accounts`,
`get_account_tree`, `get_account_rollups`, `list_transactions`,
`list_journal_entries`, `list_event_blocks`, `get_trial_balance`,
`get_period_close_status`, `list_period_drafts`,
`get_closing_book_structures`, `get_fiscal_calendar`,
`list_reconciliations`, `list_reports`. Omitted, a call is about the
group parent and sends exactly what it sent before (`None` variables are
stripped, as the facade already did).
- **Close writes carry `entity_id`** (keyword): `close_period`,
`set_close_target`, `reopen_period`, `initialize_ledger`,
`initialize_chart_of_accounts`. Left out, the field stays `UNSET` and
off the wire.
- **`create_entity(graph_id, body)`** beside `update_entity`, returning
`LedgerEntityResponse`.
- **Entity shape**: `reportingStyleId` and `ownershipPct` selected on
`entity`; `ownershipPct` on `entities`; `entityId` on `summary`,
`fiscalCalendar`, `reports` and `report`.
- **Generated models** regenerated with `just generate-graphql` from the
checked-in schema (already at the v1.16.4 shape since 2.8.0), so the
drift gate is clean.
- `live_financial_statement` needed nothing: its body already carries
`entity_id` and `consolidated` from 2.8.0.
## Breaking Changes
None. Stable tier grows; nothing moves or is removed. The integration
template's emit path is untouched.
## Testing
`just test-all` (664 passed, ruff format and lint, basedpyright) passes
locally. New tests cover the `entityId` variable on reads (and its
absence by default), `entity_id` on the close writes, and
`create_entity`'s body and envelope. Five existing mocks gained the keys
the regenerated models now require (`reportingStyleId`, `ownershipPct`,
`entityId`), as the server returns them.
## Rollout
The documents select fields and pass arguments that exist from server
v1.16.4. Marked ready with the v1.16.4 production deploy in flight; the
apps pin the client by lockfile, so nothing moves until a bump.
## Certification
- [x] I have the right to submit this work under the Apache 2.0 license,
and do so. Where any part of it is owned by my employer, I have their
permission.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01BY3uYE5zMjjFHnjiZfiJu8
0 commit comments