Repository navigation
feat: entity scope on the ledger facade (entity_id, create_entity) - #240
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Threads the multi-entity step 2 server surface (robosystems #1714, v1.16.4) through the
LedgerClientfacade, 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=Noneon 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 (Nonevariables are stripped, as the facade already did).entity_id(keyword):close_period,set_close_target,reopen_period,initialize_ledger,initialize_chart_of_accounts. Left out, the field staysUNSETand off the wire.create_entity(graph_id, body)besideupdate_entity, returningLedgerEntityResponse.reportingStyleIdandownershipPctselected onentity;ownershipPctonentities;entityIdonsummary,fiscalCalendar,reportsandreport.just generate-graphqlfrom the checked-in schema (already at the v1.16.4 shape since 2.8.0), so the drift gate is clean.live_financial_statementneeded nothing: its body already carriesentity_idandconsolidatedfrom 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 theentityIdvariable on reads (and its absence by default),entity_idon the close writes, andcreate_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
🤖 Generated with Claude Code
https://claude.ai/code/session_01BY3uYE5zMjjFHnjiZfiJu8