Skip to content

Commit d3ec1e4

Browse files
authored
feat: regenerate for multi-entity step 2 (create_entity, entity_id, combined statement) (#239)
## Summary Regenerated client for the API's multi-entity step (robosystems #1714, with the two surface moves of #1708 and #1715). A graph is one reporting group, and every ledger operation can now name which entity of it to act on. Shipping ahead of the production release: every new field is optional and defaults server-side, and the one removed call already met a 404 on the API. ## Changes - **Regenerated `api/` and `models/`** (`just generate-sdk` against the current backend): `api.robo_ledger_setup.create_entity` with `CreateEntityRequest`; `entity_id` as a new optional field on the close, setup, report, event-block and live-statement request models; `consolidated` on `LiveFinancialStatementRequest` with `entity_id`, `consolidated` and `combined_entity_ids` on its response; `ownership_pct` on `LedgerEntityResponse`; `entity_id` on `FiscalCalendarResponse` and `ReportResponse`. Sync and async paths are both generated. `api.graphs.select_graph` is gone (the API removed the endpoint `set_selected_graph` replaced); `validate_schema` moved from `api.schema` to `api.graphs` with its tag. - **GraphQL schema snapshot** refreshed (`entityId` on the ledger reads, `ownershipPct` on `LedgerEntity`, `entityId` on `LedgerSummary`). `just generate-graphql` is clean against it: the checked-in operations use none of the new arguments yet, so `graphql/generated/` has no diff. - **Facades** (`clients/`): untouched. None wrapped `select_graph` or `validate_schema`. - **Release notes:** `.github/release-notes/v2.8.0.md` names the removal and the path move, as the policy requires before the release dispatch. ## Compatibility ADDITIVE on the stable tier, with one generated-tier removal and one generated-tier path move: - `api.graphs.select_graph` is removed. The API deprecated the call in favour of `set_selected_graph` (shipped in 2.7.0) and has now removed the endpoint, so the generated function could only meet a 404. No facade wraps it and `robosystems-integration-template/src/integration/emit/*.py` never imported it. - `api.schema.validate_schema` is now `api.graphs.validate_schema`; the function and its models are unchanged. Same checks: no facade, not in the template's emit path. Both ride a minor (2.8.0) with the release notes as the record. No model field became required or was dropped: every new request field is optional and defaults server-side to the group parent, so existing calls behave as before. ## Testing `just test-all` (pytest → format → lint → typecheck): 654 passed, 17 skipped; ruff, format and basedpyright clean. `just generate-graphql` run and clean. The regeneration itself was run against the local backend at the merged `main`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01BY3uYE5zMjjFHnjiZfiJu8
2 parents 9428f75 + 8f70ac2 commit d3ec1e4

28 files changed

Lines changed: 1477 additions & 300 deletions

‎.github/release-notes/v2.8.0.md‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
The generated tier catches up with the API's multi-entity step: a graph is
2+
one reporting group, and every ledger operation can name which entity of it
3+
to act on. Nothing on the stable tier changes shape; one generated-tier
4+
removal and one path move are named below.
5+
6+
## New: entities in a reporting group
7+
8+
`api.robo_ledger_setup.create_entity` with `CreateEntityRequest`
9+
(`POST /extensions/roboledger/{graph_id}/operations/create-entity`) adds a
10+
subsidiary to the graph's group: a name, its legal form, the share the parent
11+
holds (`ownership_pct`), an optional `parent_entity_id` to nest it under
12+
another subsidiary, and an optional `ticker`, which prefixes the entity's
13+
account names and must be unique in the graph (409). `LedgerEntityResponse`
14+
gains `ownership_pct`.
15+
16+
`entity_id` is a new optional field on `UpdateEntityRequest`,
17+
`InitializeLedgerRequest`, `SetCloseTargetOperation`, `ClosePeriodOperation`,
18+
`ReopenPeriodOperation`, `BackfillPlanHistoryOperation`,
19+
`InitializeChartOfAccountsRequest`, `CreateReportRequest`,
20+
`LinkEntityTaxonomyRequest`, `CreateEventBlockRequest` and
21+
`LiveFinancialStatementRequest`. Omitted, each acts on the group parent, so
22+
every existing call behaves as before. `FiscalCalendarResponse` and
23+
`ReportResponse` carry `entity_id`.
24+
25+
`LiveFinancialStatementRequest.consolidated` renders the group's combined
26+
statement on the parent — every entity under the parent's Reporting Style,
27+
summed per concept, with nothing eliminated between them — and
28+
`LiveFinancialStatementResponse` carries `entity_id`, `consolidated` and
29+
`combined_entity_ids`.
30+
31+
The checked-in GraphQL schema gains `entityId` on `entity`,
32+
`fiscalCalendar`, `periodCloseStatus`, `periodDrafts`, `openReceivables`,
33+
`openPayables`, `openReceivablesByAgent`, `openPayablesByAgent`,
34+
`eventBlocks`, `summary`, `accounts`, `accountTree`, `accountRollups`,
35+
`reconciliations`, `trialBalance`, `transactions`, `closingBookStructures`,
36+
`journalEntries` and `reports`; `LedgerEntity` gains `ownershipPct` and
37+
`LedgerSummary` `entityId`. The checked-in operations are unchanged, so the
38+
generated GraphQL models are too.
39+
40+
## Removed: `api.graphs.select_graph`
41+
42+
The API deprecated the graph-scoped select in favour of `set_selected_graph`
43+
— the replacement 2.7.0 shipped — and has now removed the endpoint, so the
44+
generated function would only ever have met a 404. No facade wrapped it and
45+
the integration template's emit path never imported it; this is a
46+
generated-tier removal riding a minor. `api.user.set_selected_graph` is the
47+
call.
48+
49+
## Moved: `validate_schema`
50+
51+
`api.schema.validate_schema` is now `api.graphs.validate_schema`: the API
52+
retagged the operation under Graphs, and a package path follows its tag. The
53+
function, its request and its response are unchanged; update the import. No
54+
facade wrapped it and the template never imported it.

‎robosystems_client/api/graphs/select_graph.py‎

Lines changed: 0 additions & 204 deletions
This file was deleted.
File renamed without changes.

‎robosystems_client/api/robo_ledger_analytical_views/live_financial_statement.py‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ def sync_detailed(
117117
118118
Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active
119119
CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph
120-
materialization required. Rejected on shared-repository graphs; those should use `financial-
120+
materialization required. One entity's books: `entity_id` names a subsidiary, omitted means the
121+
group parent; `consolidated` on the parent combines every entity of the group at the rs-gaap
122+
concepts, with no eliminations. Rejected on shared-repository graphs; those should use `financial-
121123
statement-analysis` instead.
122124
123125
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
@@ -161,7 +163,9 @@ def sync(
161163
162164
Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active
163165
CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph
164-
materialization required. Rejected on shared-repository graphs; those should use `financial-
166+
materialization required. One entity's books: `entity_id` names a subsidiary, omitted means the
167+
group parent; `consolidated` on the parent combines every entity of the group at the rs-gaap
168+
concepts, with no eliminations. Rejected on shared-repository graphs; those should use `financial-
165169
statement-analysis` instead.
166170
167171
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
@@ -200,7 +204,9 @@ async def asyncio_detailed(
200204
201205
Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active
202206
CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph
203-
materialization required. Rejected on shared-repository graphs; those should use `financial-
207+
materialization required. One entity's books: `entity_id` names a subsidiary, omitted means the
208+
group parent; `consolidated` on the parent combines every entity of the group at the rs-gaap
209+
concepts, with no eliminations. Rejected on shared-repository graphs; those should use `financial-
204210
statement-analysis` instead.
205211
206212
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
@@ -242,7 +248,9 @@ async def asyncio(
242248
243249
Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active
244250
CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph
245-
materialization required. Rejected on shared-repository graphs; those should use `financial-
251+
materialization required. One entity's books: `entity_id` names a subsidiary, omitted means the
252+
group parent; `consolidated` on the parent combines every entity of the group at the rs-gaap
253+
concepts, with no eliminations. Rejected on shared-repository graphs; those should use `financial-
246254
statement-analysis` instead.
247255
248256
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours

0 commit comments

Comments
 (0)