Skip to content

Commit 5259713

Browse files
committed
feat(ledger): the entity's treatment and membership, and scope on the live statement
Regenerated against robosystems main at the merge of #1846. The entity carries `consolidation_method`, `entity_role`, `joined_on` and `left_on`, and the facade's entity reads select them; `live-financial-statement` takes `scope` (entity | combined | consolidated) and says which it rendered. The drift since the last regeneration rides along: the fact row's `period_role`, `extends_network` on a taxonomy block's structures, the `consolidation` chart template, a block's own name on summaries, and the `flow_qname` copy. Claude-Session: https://claude.ai/code/session_01M6TRefZ8MTAxax6pMxer4q
1 parent e5d71f0 commit 5259713

28 files changed

Lines changed: 693 additions & 42 deletions

‎robosystems_client/api/robo_ledger_analytical_views/live_financial_statement.py‎

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,10 @@ def sync_detailed(
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
120120
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-
123-
statement-analysis` instead.
121+
group parent. On the parent, `scope: combined` sums every member consolidated in full at the rs-gaap
122+
concepts for the months each was a member, nothing eliminated, and `scope: consolidated` adds the
123+
consolidation entity's entries — the eliminations and noncontrolling interest. Rejected on shared-
124+
repository graphs; those should use `financial-statement-analysis` instead.
124125
125126
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
126127
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -164,9 +165,10 @@ def sync(
164165
Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active
165166
CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph
166167
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-
169-
statement-analysis` instead.
168+
group parent. On the parent, `scope: combined` sums every member consolidated in full at the rs-gaap
169+
concepts for the months each was a member, nothing eliminated, and `scope: consolidated` adds the
170+
consolidation entity's entries — the eliminations and noncontrolling interest. Rejected on shared-
171+
repository graphs; those should use `financial-statement-analysis` instead.
170172
171173
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
172174
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -205,9 +207,10 @@ async def asyncio_detailed(
205207
Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active
206208
CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph
207209
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-
210-
statement-analysis` instead.
210+
group parent. On the parent, `scope: combined` sums every member consolidated in full at the rs-gaap
211+
concepts for the months each was a member, nothing eliminated, and `scope: consolidated` adds the
212+
consolidation entity's entries — the eliminations and noncontrolling interest. Rejected on shared-
213+
repository graphs; those should use `financial-statement-analysis` instead.
211214
212215
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
213216
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -249,9 +252,10 @@ async def asyncio(
249252
Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active
250253
CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph
251254
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-
254-
statement-analysis` instead.
255+
group parent. On the parent, `scope: combined` sums every member consolidated in full at the rs-gaap
256+
concepts for the months each was a member, nothing eliminated, and `scope: consolidated` adds the
257+
consolidation entity's entries — the eliminations and noncontrolling interest. Rejected on shared-
258+
repository graphs; those should use `financial-statement-analysis` instead.
255259
256260
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
257261
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

‎robosystems_client/api/robo_ledger_setup/create_entity.py‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ def sync_detailed(
121121
omitting it means the group parent. The Reporting Style follows `entity_type` unless
122122
`reporting_style_id` names one. `ticker` prefixes the entity's account names and must be unique in
123123
the graph (409). There is no cap on entities: a graph is one reporting group, and everyone with
124-
access to it sees every entity.
124+
access to it sees every entity. `ownership_pct` implies the `consolidation_method` (50 and above
125+
full, 20 to 50 equity, below 20 cost) unless one is given; `entity_role: consolidation` makes this
126+
the group's entity for consolidating entries, read by the consolidated statements only; `joined_on`
127+
dates an acquired subsidiary's membership.
125128
126129
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
127130
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -176,7 +179,10 @@ def sync(
176179
omitting it means the group parent. The Reporting Style follows `entity_type` unless
177180
`reporting_style_id` names one. `ticker` prefixes the entity's account names and must be unique in
178181
the graph (409). There is no cap on entities: a graph is one reporting group, and everyone with
179-
access to it sees every entity.
182+
access to it sees every entity. `ownership_pct` implies the `consolidation_method` (50 and above
183+
full, 20 to 50 equity, below 20 cost) unless one is given; `entity_role: consolidation` makes this
184+
the group's entity for consolidating entries, read by the consolidated statements only; `joined_on`
185+
dates an acquired subsidiary's membership.
180186
181187
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
182188
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -226,7 +232,10 @@ async def asyncio_detailed(
226232
omitting it means the group parent. The Reporting Style follows `entity_type` unless
227233
`reporting_style_id` names one. `ticker` prefixes the entity's account names and must be unique in
228234
the graph (409). There is no cap on entities: a graph is one reporting group, and everyone with
229-
access to it sees every entity.
235+
access to it sees every entity. `ownership_pct` implies the `consolidation_method` (50 and above
236+
full, 20 to 50 equity, below 20 cost) unless one is given; `entity_role: consolidation` makes this
237+
the group's entity for consolidating entries, read by the consolidated statements only; `joined_on`
238+
dates an acquired subsidiary's membership.
230239
231240
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
232241
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -279,7 +288,10 @@ async def asyncio(
279288
omitting it means the group parent. The Reporting Style follows `entity_type` unless
280289
`reporting_style_id` names one. `ticker` prefixes the entity's account names and must be unique in
281290
the graph (409). There is no cap on entities: a graph is one reporting group, and everyone with
282-
access to it sees every entity.
291+
access to it sees every entity. `ownership_pct` implies the `consolidation_method` (50 and above
292+
full, 20 to 50 equity, below 20 cost) unless one is given; `entity_role: consolidation` makes this
293+
the group's entity for consolidating entries, read by the consolidated statements only; `joined_on`
294+
dates an acquired subsidiary's membership.
283295
284296
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
285297
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

‎robosystems_client/api/robo_ledger_setup/update_entity.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ def sync_detailed(
116116
Update an entity of the graph's reporting group. Only provided (non-null) fields are updated. Omit
117117
`entity_id` to target the group parent; name a subsidiary's id to edit it. `ownership_pct` is
118118
refused on the group parent (422), and `ticker` must stay unique in the graph (409).
119+
`consolidation_method` overrides the treatment the share implies (a new share re-derives it unless
120+
both are given), `entity_role: consolidation` marks the group's entity for consolidating entries,
121+
and `joined_on` / `left_on` bound its membership by month — set `left_on` when a subsidiary leaves
122+
the group and its history stays readable under it.
119123
120124
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
121125
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -164,6 +168,10 @@ def sync(
164168
Update an entity of the graph's reporting group. Only provided (non-null) fields are updated. Omit
165169
`entity_id` to target the group parent; name a subsidiary's id to edit it. `ownership_pct` is
166170
refused on the group parent (422), and `ticker` must stay unique in the graph (409).
171+
`consolidation_method` overrides the treatment the share implies (a new share re-derives it unless
172+
both are given), `entity_role: consolidation` marks the group's entity for consolidating entries,
173+
and `joined_on` / `left_on` bound its membership by month — set `left_on` when a subsidiary leaves
174+
the group and its history stays readable under it.
167175
168176
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
169177
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -207,6 +215,10 @@ async def asyncio_detailed(
207215
Update an entity of the graph's reporting group. Only provided (non-null) fields are updated. Omit
208216
`entity_id` to target the group parent; name a subsidiary's id to edit it. `ownership_pct` is
209217
refused on the group parent (422), and `ticker` must stay unique in the graph (409).
218+
`consolidation_method` overrides the treatment the share implies (a new share re-derives it unless
219+
both are given), `entity_role: consolidation` marks the group's entity for consolidating entries,
220+
and `joined_on` / `left_on` bound its membership by month — set `left_on` when a subsidiary leaves
221+
the group and its history stays readable under it.
210222
211223
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
212224
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -253,6 +265,10 @@ async def asyncio(
253265
Update an entity of the graph's reporting group. Only provided (non-null) fields are updated. Omit
254266
`entity_id` to target the group parent; name a subsidiary's id to edit it. `ownership_pct` is
255267
refused on the group parent (422), and `ticker` must stay unique in the graph (409).
268+
`consolidation_method` overrides the treatment the share implies (a new share re-derives it unless
269+
both are given), `entity_role: consolidation` marks the group's entity for consolidating entries,
270+
and `joined_on` / `left_on` bound its membership by month — set `left_on` when a subsidiary leaves
271+
the group and its history stays readable under it.
256272
257273
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
258274
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

‎robosystems_client/api/robo_ledger_taxonomy_mapping/create_taxonomy_block.py‎

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,15 @@ def sync_detailed(
117117
elements, associations, and rules. Dispatches by `taxonomy_type` — `chart_of_accounts` (declarative
118118
tenant CoA), `reporting_extension`, and `custom_ontology` are supported; `reporting_standard` is
119119
library-origin (501). `reporting_extension` / `custom_ontology` authoring may be disabled per
120-
environment (TAXONOMY_AUTHORING_ENABLED) — disabled surfaces 403. NOT the path for a functional
121-
close schedule: a structure with block_type='schedule' here is a bare ontology row with none of the
122-
schedule machinery (per-period facts, schedule_entry_due obligations, closing-entry generator). To
123-
create a working schedule use create-information-block(block_type='schedule').
120+
environment (TAXONOMY_AUTHORING_ENABLED) — disabled surfaces 403. A `reporting_extension` structure
121+
with `extends_network` adds rows to the entity's balance sheet, income statement, cash flow or
122+
equity statement: its arcs layer onto that Reporting Style network, anchored and checked when
123+
authored (refused with a reason, 422). Prefer an rs-gaap concept for a row — any library concept may
124+
be named, including ones not yet in this graph — and give a tenant concept a `parent_ref` to the rs-
125+
gaap concept it refines. NOT the path for a functional close schedule: a structure with
126+
block_type='schedule' here is a bare ontology row with none of the schedule machinery (per-period
127+
facts, schedule_entry_due obligations, closing-entry generator). To create a working schedule use
128+
create-information-block(block_type='schedule').
124129
125130
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
126131
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -172,10 +177,15 @@ def sync(
172177
elements, associations, and rules. Dispatches by `taxonomy_type` — `chart_of_accounts` (declarative
173178
tenant CoA), `reporting_extension`, and `custom_ontology` are supported; `reporting_standard` is
174179
library-origin (501). `reporting_extension` / `custom_ontology` authoring may be disabled per
175-
environment (TAXONOMY_AUTHORING_ENABLED) — disabled surfaces 403. NOT the path for a functional
176-
close schedule: a structure with block_type='schedule' here is a bare ontology row with none of the
177-
schedule machinery (per-period facts, schedule_entry_due obligations, closing-entry generator). To
178-
create a working schedule use create-information-block(block_type='schedule').
180+
environment (TAXONOMY_AUTHORING_ENABLED) — disabled surfaces 403. A `reporting_extension` structure
181+
with `extends_network` adds rows to the entity's balance sheet, income statement, cash flow or
182+
equity statement: its arcs layer onto that Reporting Style network, anchored and checked when
183+
authored (refused with a reason, 422). Prefer an rs-gaap concept for a row — any library concept may
184+
be named, including ones not yet in this graph — and give a tenant concept a `parent_ref` to the rs-
185+
gaap concept it refines. NOT the path for a functional close schedule: a structure with
186+
block_type='schedule' here is a bare ontology row with none of the schedule machinery (per-period
187+
facts, schedule_entry_due obligations, closing-entry generator). To create a working schedule use
188+
create-information-block(block_type='schedule').
179189
180190
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
181191
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -222,10 +232,15 @@ async def asyncio_detailed(
222232
elements, associations, and rules. Dispatches by `taxonomy_type` — `chart_of_accounts` (declarative
223233
tenant CoA), `reporting_extension`, and `custom_ontology` are supported; `reporting_standard` is
224234
library-origin (501). `reporting_extension` / `custom_ontology` authoring may be disabled per
225-
environment (TAXONOMY_AUTHORING_ENABLED) — disabled surfaces 403. NOT the path for a functional
226-
close schedule: a structure with block_type='schedule' here is a bare ontology row with none of the
227-
schedule machinery (per-period facts, schedule_entry_due obligations, closing-entry generator). To
228-
create a working schedule use create-information-block(block_type='schedule').
235+
environment (TAXONOMY_AUTHORING_ENABLED) — disabled surfaces 403. A `reporting_extension` structure
236+
with `extends_network` adds rows to the entity's balance sheet, income statement, cash flow or
237+
equity statement: its arcs layer onto that Reporting Style network, anchored and checked when
238+
authored (refused with a reason, 422). Prefer an rs-gaap concept for a row — any library concept may
239+
be named, including ones not yet in this graph — and give a tenant concept a `parent_ref` to the rs-
240+
gaap concept it refines. NOT the path for a functional close schedule: a structure with
241+
block_type='schedule' here is a bare ontology row with none of the schedule machinery (per-period
242+
facts, schedule_entry_due obligations, closing-entry generator). To create a working schedule use
243+
create-information-block(block_type='schedule').
229244
230245
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
231246
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -275,10 +290,15 @@ async def asyncio(
275290
elements, associations, and rules. Dispatches by `taxonomy_type` — `chart_of_accounts` (declarative
276291
tenant CoA), `reporting_extension`, and `custom_ontology` are supported; `reporting_standard` is
277292
library-origin (501). `reporting_extension` / `custom_ontology` authoring may be disabled per
278-
environment (TAXONOMY_AUTHORING_ENABLED) — disabled surfaces 403. NOT the path for a functional
279-
close schedule: a structure with block_type='schedule' here is a bare ontology row with none of the
280-
schedule machinery (per-period facts, schedule_entry_due obligations, closing-entry generator). To
281-
create a working schedule use create-information-block(block_type='schedule').
293+
environment (TAXONOMY_AUTHORING_ENABLED) — disabled surfaces 403. A `reporting_extension` structure
294+
with `extends_network` adds rows to the entity's balance sheet, income statement, cash flow or
295+
equity statement: its arcs layer onto that Reporting Style network, anchored and checked when
296+
authored (refused with a reason, 422). Prefer an rs-gaap concept for a row — any library concept may
297+
be named, including ones not yet in this graph — and give a tenant concept a `parent_ref` to the rs-
298+
gaap concept it refines. NOT the path for a functional close schedule: a structure with
299+
block_type='schedule' here is a bare ontology row with none of the schedule machinery (per-period
300+
facts, schedule_entry_due obligations, closing-entry generator). To create a working schedule use
301+
create-information-block(block_type='schedule').
282302
283303
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
284304
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

‎robosystems_client/graphql/generated/get_ledger_entity.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ class GetLedgerEntityEntity(BaseModel):
3333
is_parent: bool = Field(alias="isParent")
3434
parent_entity_id: Optional[str] = Field(alias="parentEntityId")
3535
ownership_pct: Optional[float] = Field(alias="ownershipPct")
36+
consolidation_method: str = Field(alias="consolidationMethod")
37+
entity_role: str = Field(alias="entityRole")
38+
joined_on: Optional[str] = Field(alias="joinedOn")
39+
left_on: Optional[str] = Field(alias="leftOn")
3640
source: str
3741
source_id: Optional[str] = Field(alias="sourceId")
3842
source_graph_id: Optional[str] = Field(alias="sourceGraphId")

‎robosystems_client/graphql/generated/list_ledger_entities.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ class ListLedgerEntitiesEntities(BaseModel):
2121
is_parent: bool = Field(alias="isParent")
2222
parent_entity_id: Optional[str] = Field(alias="parentEntityId")
2323
ownership_pct: Optional[float] = Field(alias="ownershipPct")
24+
consolidation_method: str = Field(alias="consolidationMethod")
25+
entity_role: str = Field(alias="entityRole")
26+
joined_on: Optional[str] = Field(alias="joinedOn")
27+
left_on: Optional[str] = Field(alias="leftOn")
2428
source: str
2529
source_graph_id: Optional[str] = Field(alias="sourceGraphId")
2630
connection_id: Optional[str] = Field(alias="connectionId")

0 commit comments

Comments
 (0)