From 41045cf6044b630f3792456307ea604e28f2a35c Mon Sep 17 00:00:00 2001 From: "Joseph T. French" Date: Fri, 15 May 2026 23:42:56 -0500 Subject: [PATCH] Refactor reporting structure terminology from 'structure_type' to 'block_type' across models and queries --- .../op_change_reporting_style.py | 8 +-- robosystems_client/clients/ledger_client.py | 10 ++-- .../graphql/queries/ledger/__init__.py | 32 +++++------ robosystems_client/models/__init__.py | 8 +-- .../models/artifact_response.py | 22 ++++---- .../models/change_reporting_style_op.py | 4 +- .../models/classification_lite.py | 2 +- .../models/information_model_response.py | 3 +- robosystems_client/models/rule_lite.py | 55 ++++++++++++++++--- .../models/structure_summary.py | 12 ++-- .../models/taxonomy_block_structure.py | 12 ++-- .../taxonomy_block_structure_request.py | 18 +++--- ...omy_block_structure_request_block_type.py} | 2 +- tests/test_ledger_client.py | 20 +++---- 14 files changed, 123 insertions(+), 85 deletions(-) rename robosystems_client/models/{taxonomy_block_structure_request_structure_type.py => taxonomy_block_structure_request_block_type.py} (88%) diff --git a/robosystems_client/api/graph_operations/op_change_reporting_style.py b/robosystems_client/api/graph_operations/op_change_reporting_style.py index 9d2b725..57dcb8e 100644 --- a/robosystems_client/api/graph_operations/op_change_reporting_style.py +++ b/robosystems_client/api/graph_operations/op_change_reporting_style.py @@ -126,7 +126,7 @@ def sync_detailed( Switches the graph to a different Reporting Style. The target Style must be a library- or customer-authored Structure with - ``structure_type='reporting_style'`` and a complete composition + ``block_type='reporting_style'`` and a complete composition (one Network per required statement type — BS / IS / CF / SE). Filed Reports are unaffected because each ``Report`` already pins its own ``structure_id`` per FactSet at create-time; new reports use the new @@ -177,7 +177,7 @@ def sync( Switches the graph to a different Reporting Style. The target Style must be a library- or customer-authored Structure with - ``structure_type='reporting_style'`` and a complete composition + ``block_type='reporting_style'`` and a complete composition (one Network per required statement type — BS / IS / CF / SE). Filed Reports are unaffected because each ``Report`` already pins its own ``structure_id`` per FactSet at create-time; new reports use the new @@ -223,7 +223,7 @@ async def asyncio_detailed( Switches the graph to a different Reporting Style. The target Style must be a library- or customer-authored Structure with - ``structure_type='reporting_style'`` and a complete composition + ``block_type='reporting_style'`` and a complete composition (one Network per required statement type — BS / IS / CF / SE). Filed Reports are unaffected because each ``Report`` already pins its own ``structure_id`` per FactSet at create-time; new reports use the new @@ -272,7 +272,7 @@ async def asyncio( Switches the graph to a different Reporting Style. The target Style must be a library- or customer-authored Structure with - ``structure_type='reporting_style'`` and a complete composition + ``block_type='reporting_style'`` and a complete composition (one Network per required statement type — BS / IS / CF / SE). Filed Reports are unaffected because each ``Report`` already pins its own ``structure_id`` per FactSet at create-time; new reports use the new diff --git a/robosystems_client/clients/ledger_client.py b/robosystems_client/clients/ledger_client.py index 5dad74b..abec0b8 100644 --- a/robosystems_client/clients/ledger_client.py +++ b/robosystems_client/clients/ledger_client.py @@ -802,13 +802,13 @@ def list_structures( self, graph_id: str, taxonomy_id: str | None = None, - structure_type: str | None = None, + block_type: str | None = None, ) -> list[dict[str, Any]]: """List reporting structures (IS, BS, CF, schedules) with optional filters.""" data = self._query( graph_id, LIST_STRUCTURES_QUERY, - {"taxonomyId": taxonomy_id, "structureType": structure_type}, + {"taxonomyId": taxonomy_id, "blockType": block_type}, ) return parse_structures(data) @@ -1598,16 +1598,16 @@ def get_report_package(self, graph_id: str, report_id: str) -> dict[str, Any] | return parse_report_package(data) def get_statement( - self, graph_id: str, report_id: str, structure_type: str + self, graph_id: str, report_id: str, block_type: str ) -> dict[str, Any] | None: """Render a financial statement — facts viewed through a structure. - `structure_type`: income_statement, balance_sheet, cash_flow_statement, ... + `block_type`: income_statement, balance_sheet, cash_flow_statement, ... """ data = self._query( graph_id, GET_STATEMENT_QUERY, - {"reportId": report_id, "structureType": structure_type}, + {"reportId": report_id, "blockType": block_type}, ) return parse_statement(data) diff --git a/robosystems_client/graphql/queries/ledger/__init__.py b/robosystems_client/graphql/queries/ledger/__init__.py index 50ea329..cf91344 100644 --- a/robosystems_client/graphql/queries/ledger/__init__.py +++ b/robosystems_client/graphql/queries/ledger/__init__.py @@ -527,10 +527,10 @@ def parse_unmapped_elements(data: dict[str, Any]) -> list[dict[str, Any]]: # ── Structures / mappings ───────────────────────────────────────────── LIST_STRUCTURES_QUERY = """ -query ListLedgerStructures($taxonomyId: String, $structureType: String) { - structures(taxonomyId: $taxonomyId, structureType: $structureType) { +query ListLedgerStructures($taxonomyId: String, $blockType: String) { + structures(taxonomyId: $taxonomyId, blockType: $blockType) { structures { - id name description structureType taxonomyId isActive + id name description blockType taxonomyId isActive } } } @@ -546,7 +546,7 @@ def parse_structures(data: dict[str, Any]) -> list[dict[str, Any]]: query ListLedgerMappings { mappings { structures { - id name description structureType taxonomyId isActive + id name description blockType taxonomyId isActive } } } @@ -561,7 +561,7 @@ def parse_mappings(data: dict[str, Any]) -> list[dict[str, Any]]: GET_MAPPING_QUERY = """ query GetLedgerMapping($mappingId: String!) { mapping(mappingId: $mappingId) { - id name structureType taxonomyId totalAssociations + id name blockType taxonomyId totalAssociations associations { id structureId fromElementId fromElementName fromElementQname @@ -602,7 +602,7 @@ def parse_mapping_coverage(data: dict[str, Any]) -> dict[str, Any] | None: id blockType name displayName category taxonomyId taxonomyName informationModel { conceptArrangement memberArrangement } - artifact { topic parentheticalNote template mechanics } + artifact { topic rendererNote template mechanics } elements { id qname name code elementType isAbstract isMonetary balanceType periodType @@ -641,7 +641,7 @@ def parse_information_block(data: dict[str, Any]) -> dict[str, Any] | None: id blockType name displayName category taxonomyId taxonomyName informationModel { conceptArrangement memberArrangement } - artifact { topic parentheticalNote template mechanics } + artifact { topic rendererNote template mechanics } elements { id qname name code elementType isAbstract isMonetary balanceType periodType @@ -717,7 +717,7 @@ def parse_period_drafts(data: dict[str, Any]) -> dict[str, Any] | None: categories { label items { - id name itemType structureType reportId status + id name itemType blockType reportId status } } } @@ -760,7 +760,7 @@ def parse_fiscal_calendar(data: dict[str, Any]) -> dict[str, Any] | None: createdAt lastGenerated entityName sourceGraphId sourceReportId sharedAt periods { start end label } - structures { id name structureType } + structures { id name blockType } } } } @@ -781,7 +781,7 @@ def parse_reports(data: dict[str, Any]) -> list[dict[str, Any]]: filingStatus filedAt filedBy supersedesId supersededById sourceGraphId sourceReportId sharedAt periods { start end label } - structures { id name structureType } + structures { id name blockType } } } """.strip() @@ -795,7 +795,7 @@ def parse_report(data: dict[str, Any]) -> dict[str, Any] | None: # Report rehydrated as a package — Report metadata + N rendered # `InformationBlock` envelopes (one per attached FactSet). Drives the # `/reports/[id]` package viewer and replaces the per-statement -# `getStatement(reportId, structureType)` round-trip flow. +# `getStatement(reportId, blockType)` round-trip flow. GET_REPORT_PACKAGE_QUERY = """ query GetLedgerReportPackage($reportId: String!) { reportPackage(reportId: $reportId) { @@ -812,7 +812,7 @@ def parse_report(data: dict[str, Any]) -> dict[str, Any] | None: id blockType name displayName category taxonomyId taxonomyName informationModel { conceptArrangement memberArrangement } - artifact { topic parentheticalNote template mechanics } + artifact { topic rendererNote template mechanics } elements { id qname name code elementType isAbstract isMonetary balanceType periodType @@ -826,7 +826,7 @@ def parse_report(data: dict[str, Any]) -> dict[str, Any] | None: periodType unit factScope factSetId } rules { - id ruleCategory rulePattern ruleExpression + id ruleCategory rulePattern ruleCheckKind ruleExpression ruleMessage ruleSeverity ruleOrigin } factSet { @@ -861,9 +861,9 @@ def parse_report_package(data: dict[str, Any]) -> dict[str, Any] | None: GET_STATEMENT_QUERY = """ -query GetLedgerStatement($reportId: String!, $structureType: String!) { - statement(reportId: $reportId, structureType: $structureType) { - reportId structureId structureName structureType unmappedCount +query GetLedgerStatement($reportId: String!, $blockType: String!) { + statement(reportId: $reportId, blockType: $blockType) { + reportId structureId structureName blockType unmappedCount periods { start end label } rows { elementId elementQname elementName trait diff --git a/robosystems_client/models/__init__.py b/robosystems_client/models/__init__.py index 72bbf57..5986355 100644 --- a/robosystems_client/models/__init__.py +++ b/robosystems_client/models/__init__.py @@ -574,12 +574,12 @@ ) from .taxonomy_block_structure import TaxonomyBlockStructure from .taxonomy_block_structure_request import TaxonomyBlockStructureRequest +from .taxonomy_block_structure_request_block_type import ( + TaxonomyBlockStructureRequestBlockType, +) from .taxonomy_block_structure_request_metadata import ( TaxonomyBlockStructureRequestMetadata, ) -from .taxonomy_block_structure_request_structure_type import ( - TaxonomyBlockStructureRequestStructureType, -) from .tier_capacity import TierCapacity from .token_pricing import TokenPricing from .transaction_preview import TransactionPreview @@ -1062,8 +1062,8 @@ "TaxonomyBlockRuleRequestVariablesItem", "TaxonomyBlockStructure", "TaxonomyBlockStructureRequest", + "TaxonomyBlockStructureRequestBlockType", "TaxonomyBlockStructureRequestMetadata", - "TaxonomyBlockStructureRequestStructureType", "TierCapacity", "TokenPricing", "TransactionPreview", diff --git a/robosystems_client/models/artifact_response.py b/robosystems_client/models/artifact_response.py index 364f32a..a322e5c 100644 --- a/robosystems_client/models/artifact_response.py +++ b/robosystems_client/models/artifact_response.py @@ -25,7 +25,7 @@ class ArtifactResponse: Attributes: mechanics (MetricMechanics | ScheduleMechanics | StatementMechanics): topic (None | str | Unset): Structure.description — the block's human-readable topic. - parenthetical_note (None | str | Unset): e.g. 'in thousands', 'except per share'. + renderer_note (None | str | Unset): e.g. 'in thousands', 'except per share'. template (ArtifactResponseTemplateType0 | None | Unset): Reusable layout (ordering, subtotals, styling) when attached. First-class templates are not yet implemented; this field is always null on currently-shipped block types. @@ -33,7 +33,7 @@ class ArtifactResponse: mechanics: MetricMechanics | ScheduleMechanics | StatementMechanics topic: None | str | Unset = UNSET - parenthetical_note: None | str | Unset = UNSET + renderer_note: None | str | Unset = UNSET template: ArtifactResponseTemplateType0 | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -56,11 +56,11 @@ def to_dict(self) -> dict[str, Any]: else: topic = self.topic - parenthetical_note: None | str | Unset - if isinstance(self.parenthetical_note, Unset): - parenthetical_note = UNSET + renderer_note: None | str | Unset + if isinstance(self.renderer_note, Unset): + renderer_note = UNSET else: - parenthetical_note = self.parenthetical_note + renderer_note = self.renderer_note template: dict[str, Any] | None | Unset if isinstance(self.template, Unset): @@ -79,8 +79,8 @@ def to_dict(self) -> dict[str, Any]: ) if topic is not UNSET: field_dict["topic"] = topic - if parenthetical_note is not UNSET: - field_dict["parenthetical_note"] = parenthetical_note + if renderer_note is not UNSET: + field_dict["renderer_note"] = renderer_note if template is not UNSET: field_dict["template"] = template @@ -131,14 +131,14 @@ def _parse_topic(data: object) -> None | str | Unset: topic = _parse_topic(d.pop("topic", UNSET)) - def _parse_parenthetical_note(data: object) -> None | str | Unset: + def _parse_renderer_note(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data return cast(None | str | Unset, data) - parenthetical_note = _parse_parenthetical_note(d.pop("parenthetical_note", UNSET)) + renderer_note = _parse_renderer_note(d.pop("renderer_note", UNSET)) def _parse_template(data: object) -> ArtifactResponseTemplateType0 | None | Unset: if data is None: @@ -160,7 +160,7 @@ def _parse_template(data: object) -> ArtifactResponseTemplateType0 | None | Unse artifact_response = cls( mechanics=mechanics, topic=topic, - parenthetical_note=parenthetical_note, + renderer_note=renderer_note, template=template, ) diff --git a/robosystems_client/models/change_reporting_style_op.py b/robosystems_client/models/change_reporting_style_op.py index 7550ba0..740602c 100644 --- a/robosystems_client/models/change_reporting_style_op.py +++ b/robosystems_client/models/change_reporting_style_op.py @@ -15,7 +15,7 @@ class ChangeReportingStyleOp: Switches the graph to a different Reporting Style. The target Style must be a library- or customer-authored Structure with - ``structure_type='reporting_style'`` and a complete composition + ``block_type='reporting_style'`` and a complete composition (one Network per required statement type — BS / IS / CF / SE). Filed Reports are unaffected because each ``Report`` already pins its own ``structure_id`` per FactSet at create-time; new reports use the new @@ -24,7 +24,7 @@ class ChangeReportingStyleOp: Attributes: reporting_style_id (str): Structure id of the target Reporting Style (e.g., `025f5d48-12ce-5d65-b9eb-4f137a10ef06` for the library-seeded Default Style). Must resolve to a Structure with - structure_type='reporting_style' that has a complete composition in the graph's tenant schema. + block_type='reporting_style' that has a complete composition in the graph's tenant schema. """ reporting_style_id: str diff --git a/robosystems_client/models/classification_lite.py b/robosystems_client/models/classification_lite.py index bf4a94a..2360f8f 100644 --- a/robosystems_client/models/classification_lite.py +++ b/robosystems_client/models/classification_lite.py @@ -29,7 +29,7 @@ class ClassificationLite: id (str): Classification vocabulary row id. category (str): One of the 3 association-level categories in the `public.classifications` CHECK constraint: 'concept_arrangement', 'member_arrangement', or 'named_disclosure'. - identifier (str): Vocabulary identifier within the category — e.g. 'RollUp', 'aggregation', 'AssetsRollUp'. + identifier (str): Vocabulary identifier within the category — e.g. 'RollUp', 'whole_part', 'AssetsRollUp'. is_primary (bool | Unset): Whether this is the canonical classification for the (association|element, category) pair. Non-primary rows capture alternates / AI suggestions alongside the chosen primary. Default: True. confidence (float | None | Unset): AI/adapter-supplied confidence (0.0-1.0). Null for deterministic library- diff --git a/robosystems_client/models/information_model_response.py b/robosystems_client/models/information_model_response.py index 338579e..d78040c 100644 --- a/robosystems_client/models/information_model_response.py +++ b/robosystems_client/models/information_model_response.py @@ -18,7 +18,8 @@ class InformationModelResponse: Attributes: concept_arrangement (None | str | Unset): roll_up | roll_forward | variance | adjustment | set | arithmetic | textblock. Null for block types where the concept arrangement is implicit in their mechanics. - member_arrangement (None | str | Unset): aggregation | nonaggregation, or null if non-hypercube. + member_arrangement (None | str | Unset): is_a | whole_part | nested_whole_part | two_dimension_aggregation | + complex_aggregating_whole_part, or null if non-hypercube. """ concept_arrangement: None | str | Unset = UNSET diff --git a/robosystems_client/models/rule_lite.py b/robosystems_client/models/rule_lite.py index c18d70d..167f1a9 100644 --- a/robosystems_client/models/rule_lite.py +++ b/robosystems_client/models/rule_lite.py @@ -31,9 +31,15 @@ class RuleLite: rule_category (str): One of 8 cm:VerificationRule subclasses — AutomatedAccountingAndReportingChecks, FundamentalAccountingConceptRelation, PeerConsistencyRule, PriorPeriodConsistencyRule, ReportLevelModelStructureRule, ReportingSystemSpecificRule, ToDoManualTask, XBRLTechnicalSyntaxRule. - rule_pattern (str): One of 10 cm:BusinessRulePattern mechanisms — Adjustment, CoExists, EqualTo, Exists, - GreaterThan, GreaterThanOrEqualToZero, LessThan, RollForward, RollUp, Variance. rule_expression (str): + rule_pattern (None | str | Unset): Arithmetic / logical pattern evaluated over fact values. One of 11 + cm:BusinessRulePattern mechanisms — Adjustment, CoExists, EqualTo, Exists, GreaterThan, + GreaterThanOrEqualToZero, LessThan, RollForward, RollUp, SumEquals, Variance. Null when the rule is a structural + check (see rule_check_kind). + rule_check_kind (None | str | Unset): Model-structure check kind evaluated over the association graph. One of 6 + kinds — LeafHasClassification, LibraryOriginImmutability, NoCycles, NoOrphanArcs, ParentBeforeChild, + UniqueQNameInTaxonomy. Null when the rule is an arithmetic pattern (see rule_pattern). Exactly one of + rule_pattern / rule_check_kind is non-null per rule. rule_target (None | RuleTargetLite | Unset): rule_variables (list[RuleVariableLite] | Unset): rule_message (None | str | Unset): @@ -46,8 +52,9 @@ class RuleLite: id: str rule_category: str - rule_pattern: str rule_expression: str + rule_pattern: None | str | Unset = UNSET + rule_check_kind: None | str | Unset = UNSET rule_target: None | RuleTargetLite | Unset = UNSET rule_variables: list[RuleVariableLite] | Unset = UNSET rule_message: None | str | Unset = UNSET @@ -62,10 +69,20 @@ def to_dict(self) -> dict[str, Any]: rule_category = self.rule_category - rule_pattern = self.rule_pattern - rule_expression = self.rule_expression + rule_pattern: None | str | Unset + if isinstance(self.rule_pattern, Unset): + rule_pattern = UNSET + else: + rule_pattern = self.rule_pattern + + rule_check_kind: None | str | Unset + if isinstance(self.rule_check_kind, Unset): + rule_check_kind = UNSET + else: + rule_check_kind = self.rule_check_kind + rule_target: dict[str, Any] | None | Unset if isinstance(self.rule_target, Unset): rule_target = UNSET @@ -97,10 +114,13 @@ def to_dict(self) -> dict[str, Any]: { "id": id, "rule_category": rule_category, - "rule_pattern": rule_pattern, "rule_expression": rule_expression, } ) + if rule_pattern is not UNSET: + field_dict["rule_pattern"] = rule_pattern + if rule_check_kind is not UNSET: + field_dict["rule_check_kind"] = rule_check_kind if rule_target is not UNSET: field_dict["rule_target"] = rule_target if rule_variables is not UNSET: @@ -124,10 +144,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: rule_category = d.pop("rule_category") - rule_pattern = d.pop("rule_pattern") - rule_expression = d.pop("rule_expression") + def _parse_rule_pattern(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rule_pattern = _parse_rule_pattern(d.pop("rule_pattern", UNSET)) + + def _parse_rule_check_kind(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rule_check_kind = _parse_rule_check_kind(d.pop("rule_check_kind", UNSET)) + def _parse_rule_target(data: object) -> None | RuleTargetLite | Unset: if data is None: return data @@ -170,8 +206,9 @@ def _parse_rule_message(data: object) -> None | str | Unset: rule_lite = cls( id=id, rule_category=rule_category, - rule_pattern=rule_pattern, rule_expression=rule_expression, + rule_pattern=rule_pattern, + rule_check_kind=rule_check_kind, rule_target=rule_target, rule_variables=rule_variables, rule_message=rule_message, diff --git a/robosystems_client/models/structure_summary.py b/robosystems_client/models/structure_summary.py index 173f90e..ddc6620 100644 --- a/robosystems_client/models/structure_summary.py +++ b/robosystems_client/models/structure_summary.py @@ -20,13 +20,13 @@ class StructureSummary: Attributes: id (str): Structure identifier. name (str): Human-readable structure name. - structure_type (str): Structure category: `balance_sheet`, `income_statement`, `cash_flow_statement`, + block_type (str): Structure category: `balance_sheet`, `income_statement`, `cash_flow_statement`, `equity_statement`, `schedule`. """ id: str name: str - structure_type: str + block_type: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - structure_type = self.structure_type + block_type = self.block_type field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: { "id": id, "name": name, - "structure_type": structure_type, + "block_type": block_type, } ) @@ -55,12 +55,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") - structure_type = d.pop("structure_type") + block_type = d.pop("block_type") structure_summary = cls( id=id, name=name, - structure_type=structure_type, + block_type=block_type, ) structure_summary.additional_properties = d diff --git a/robosystems_client/models/taxonomy_block_structure.py b/robosystems_client/models/taxonomy_block_structure.py index dc5d065..ffd193d 100644 --- a/robosystems_client/models/taxonomy_block_structure.py +++ b/robosystems_client/models/taxonomy_block_structure.py @@ -18,14 +18,14 @@ class TaxonomyBlockStructure: Attributes: id (str): name (str): - structure_type (str): + block_type (str): description (None | str | Unset): role_uri (None | str | Unset): """ id: str name: str - structure_type: str + block_type: str description: None | str | Unset = UNSET role_uri: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - structure_type = self.structure_type + block_type = self.block_type description: None | str | Unset if isinstance(self.description, Unset): @@ -55,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: { "id": id, "name": name, - "structure_type": structure_type, + "block_type": block_type, } ) if description is not UNSET: @@ -72,7 +72,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") - structure_type = d.pop("structure_type") + block_type = d.pop("block_type") def _parse_description(data: object) -> None | str | Unset: if data is None: @@ -95,7 +95,7 @@ def _parse_role_uri(data: object) -> None | str | Unset: taxonomy_block_structure = cls( id=id, name=name, - structure_type=structure_type, + block_type=block_type, description=description, role_uri=role_uri, ) diff --git a/robosystems_client/models/taxonomy_block_structure_request.py b/robosystems_client/models/taxonomy_block_structure_request.py index 7513daa..35bd2df 100644 --- a/robosystems_client/models/taxonomy_block_structure_request.py +++ b/robosystems_client/models/taxonomy_block_structure_request.py @@ -6,8 +6,8 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.taxonomy_block_structure_request_structure_type import ( - TaxonomyBlockStructureRequestStructureType, +from ..models.taxonomy_block_structure_request_block_type import ( + TaxonomyBlockStructureRequestBlockType, ) from ..types import UNSET, Unset @@ -26,8 +26,8 @@ class TaxonomyBlockStructureRequest: Attributes: name (str): Envelope-local structure name (unique within envelope). - structure_type (TaxonomyBlockStructureRequestStructureType): DB ``structures.structure_type`` enum. CoA blocks - use ``chart_of_accounts``; reporting extensions use the statement family or ``custom``; custom ontology uses + block_type (TaxonomyBlockStructureRequestBlockType): DB ``structures.block_type`` enum. CoA blocks use + ``chart_of_accounts``; reporting extensions use the statement family or ``custom``; custom ontology uses ``custom``. description (None | str | Unset): role_uri (None | str | Unset): @@ -35,7 +35,7 @@ class TaxonomyBlockStructureRequest: """ name: str - structure_type: TaxonomyBlockStructureRequestStructureType + block_type: TaxonomyBlockStructureRequestBlockType description: None | str | Unset = UNSET role_uri: None | str | Unset = UNSET metadata: TaxonomyBlockStructureRequestMetadata | Unset = UNSET @@ -44,7 +44,7 @@ class TaxonomyBlockStructureRequest: def to_dict(self) -> dict[str, Any]: name = self.name - structure_type = self.structure_type.value + block_type = self.block_type.value description: None | str | Unset if isinstance(self.description, Unset): @@ -67,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "name": name, - "structure_type": structure_type, + "block_type": block_type, } ) if description is not UNSET: @@ -88,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - structure_type = TaxonomyBlockStructureRequestStructureType(d.pop("structure_type")) + block_type = TaxonomyBlockStructureRequestBlockType(d.pop("block_type")) def _parse_description(data: object) -> None | str | Unset: if data is None: @@ -117,7 +117,7 @@ def _parse_role_uri(data: object) -> None | str | Unset: taxonomy_block_structure_request = cls( name=name, - structure_type=structure_type, + block_type=block_type, description=description, role_uri=role_uri, metadata=metadata, diff --git a/robosystems_client/models/taxonomy_block_structure_request_structure_type.py b/robosystems_client/models/taxonomy_block_structure_request_block_type.py similarity index 88% rename from robosystems_client/models/taxonomy_block_structure_request_structure_type.py rename to robosystems_client/models/taxonomy_block_structure_request_block_type.py index 3d7cef3..c650966 100644 --- a/robosystems_client/models/taxonomy_block_structure_request_structure_type.py +++ b/robosystems_client/models/taxonomy_block_structure_request_block_type.py @@ -1,7 +1,7 @@ from enum import Enum -class TaxonomyBlockStructureRequestStructureType(str, Enum): +class TaxonomyBlockStructureRequestBlockType(str, Enum): BALANCE_SHEET = "balance_sheet" CASH_FLOW_STATEMENT = "cash_flow_statement" CHART_OF_ACCOUNTS = "chart_of_accounts" diff --git a/tests/test_ledger_client.py b/tests/test_ledger_client.py index c65b767..f482eec 100644 --- a/tests/test_ledger_client.py +++ b/tests/test_ledger_client.py @@ -201,7 +201,7 @@ def test_list_mappings_unwraps_structures(self, mock_execute, mock_config, graph "id": "map_1", "name": "CoA → GAAP", "description": None, - "structureType": "coa_mapping", + "blockType": "coa_mapping", "taxonomyId": "tax_usgaap", "isActive": True, } @@ -211,7 +211,7 @@ def test_list_mappings_unwraps_structures(self, mock_execute, mock_config, graph client = LedgerClient(mock_config) mappings = client.list_mappings(graph_id) assert len(mappings) == 1 - assert mappings[0]["structure_type"] == "coa_mapping" + assert mappings[0]["block_type"] == "coa_mapping" @patch("robosystems_client.graphql.client.GraphQLClient.execute") def test_get_fiscal_calendar(self, mock_execute, mock_config, graph_id): @@ -1060,7 +1060,7 @@ def test_list_structures(self, mock_execute, mock_config, graph_id): "id": "str_1", "name": "Income Statement", "description": None, - "structureType": "income_statement", + "blockType": "income_statement", "taxonomyId": "tax_usgaap", "isActive": True, } @@ -1068,11 +1068,11 @@ def test_list_structures(self, mock_execute, mock_config, graph_id): } } client = LedgerClient(mock_config) - result = client.list_structures(graph_id, structure_type="income_statement") + result = client.list_structures(graph_id, block_type="income_statement") assert len(result) == 1 - assert result[0]["structure_type"] == "income_statement" + assert result[0]["block_type"] == "income_statement" variables = mock_execute.call_args[0][2] - assert variables["structureType"] == "income_statement" + assert variables["blockType"] == "income_statement" @patch("robosystems_client.graphql.client.GraphQLClient.execute") def test_get_mapping(self, mock_execute, mock_config, graph_id): @@ -1080,7 +1080,7 @@ def test_get_mapping(self, mock_execute, mock_config, graph_id): "mapping": { "id": "map_1", "name": "CoA → GAAP", - "structureType": "coa_mapping", + "blockType": "coa_mapping", "taxonomyId": "tax_usgaap", "totalAssociations": 2, "associations": [ @@ -1151,7 +1151,7 @@ def test_list_information_blocks(self, mock_execute, mock_config, graph_id): }, "artifact": { "topic": None, - "parentheticalNote": None, + "rendererNote": None, "template": None, "mechanics": { "kind": "closing_entry_generator", @@ -1190,7 +1190,7 @@ def test_get_information_block(self, mock_execute, mock_config, graph_id): }, "artifact": { "topic": None, - "parentheticalNote": None, + "rendererNote": None, "template": None, "mechanics": {"kind": "closing_entry_generator"}, }, @@ -1284,7 +1284,7 @@ def test_get_closing_book_structures(self, mock_execute, mock_config, graph_id): "id": "str_1", "name": "Depreciation", "itemType": "schedule", - "structureType": "schedule", + "blockType": "schedule", "reportId": None, "status": None, }