Skip to content

feat: entity scope on the ledger facade (entity_id, create_entity) - #240

Merged
jfrench9 merged 1 commit into
mainfrom
feature/entity-facades
Oct 7, 2026
Merged

jfrench9 merged 1 commit into
mainfrom
feature/entity-facades

Conversation

@jfrench9

@jfrench9 jfrench9 commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

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

  • 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.ai/code/session_01BY3uYE5zMjjFHnjiZfiJu8

Every ledger read and close write the facade wraps takes an optional
entity_id: omitted, a call is about the group parent and sends exactly what
it sent before; named, it is about that entity's books, chart and calendar.
create_entity lands beside update_entity. The GraphQL documents pass
entityId on the fields that accept it and select the new entityId,
ownershipPct and reportingStyleId fields; the REST bodies carry entity_id.
Additive; no signature changes.

Claude-Session: https://claude.ai/code/session_01BY3uYE5zMjjFHnjiZfiJu8
@jfrench9
jfrench9 marked this pull request as ready for review October 7, 2026 14:46
@jfrench9
jfrench9 merged commit c34f3ed into main Oct 7, 2026
4 checks passed
@jfrench9
jfrench9 deleted the feature/entity-facades branch October 7, 2026 14:47
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.

1 participant