Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions robosystems_client/graphql/queries/ledger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,10 @@ def parse_mapping_coverage(data: dict[str, Any]) -> dict[str, Any] | None:
id elementId value periodStart periodEnd
periodType unit factScope factSetId
}
verificationSummary {
total passed failed errored skipped
byCategory { category total passed failed errored skipped }
}
}
}
""".strip()
Expand Down Expand Up @@ -654,6 +658,10 @@ def parse_information_block(data: dict[str, Any]) -> dict[str, Any] | None:
id elementId value periodStart periodEnd
periodType unit factScope factSetId
}
verificationSummary {
total passed failed errored skipped
byCategory { category total passed failed errored skipped }
}
}
}
""".strip()
Expand Down
4 changes: 4 additions & 0 deletions robosystems_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,9 @@
from .validation_error import ValidationError
from .validation_error_context import ValidationErrorContext
from .validation_lite import ValidationLite
from .verification_category_summary import VerificationCategorySummary
from .verification_result_lite import VerificationResultLite
from .verification_summary import VerificationSummary
from .view_axis_config import ViewAxisConfig
from .view_axis_config_element_labels_type_0 import ViewAxisConfigElementLabelsType0
from .view_axis_config_member_labels_type_0 import ViewAxisConfigMemberLabelsType0
Expand Down Expand Up @@ -1166,7 +1168,9 @@
"ValidationError",
"ValidationErrorContext",
"ValidationLite",
"VerificationCategorySummary",
"VerificationResultLite",
"VerificationSummary",
"ViewAxisConfig",
"ViewAxisConfigElementLabelsType0",
"ViewAxisConfigMemberLabelsType0",
Expand Down
25 changes: 14 additions & 11 deletions robosystems_client/models/attribution_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,20 @@ class AttributionFilter:
Attributes:
target_qname (str): QName of the flow concept this filter produces facts for — e.g. ``rs-
gaap:ProceedsFromIssuanceOfCommonStock``. Resolved to ``target_element_id`` at create time.
predicate (LineItemMetadataPredicate): Filter ledger LineItems whose ``metadata_[field]`` is in ``values``.

The single predicate kind shipped in Phase 2 MVP. Sufficient for any
source taxonomy that stamps a flow-tag column on each transaction
line — mini's ``TransactionDescriptionCode``, future XBRL GL
``GenericFlowCategory`` columns, custom tenant tags.

``field`` is the JSONB key under ``line_items.metadata`` (e.g.
``"transaction_description_code"``). ``values`` is the set of values
that route to the filter's target concept; matched LineItems aggregate
signed into the attributed fact for the period.
predicate (LineItemMetadataPredicate): Filter ledger LineItems by flow concept.

The single predicate kind shipped to date. ``values`` are flow-concept
qnames — mini's ``TransactionDescriptionCode`` values, rs-gaap flow
concepts (what the enrichment classifier emits for QuickBooks data),
future XBRL GL ``GenericFlowCategory`` codes. The engine resolves them
to element_ids and matches the first-class ``LineItem.flow_element_id``
FK; matched lines aggregate signed into the attributed fact for the
period.

``field`` is **legacy and ignored** — the flow tag used to live in
``line_items.metadata[field]`` but has been promoted to the typed
``flow_element_id`` FK. Retained for wire-compatibility; the engine no
longer reads it.
target_element_id (None | str | Unset): Resolved element id for ``target_qname``. Null at create time; populated
by the handler before persistence. Round-tripped in the envelope.
"""
Expand Down
4 changes: 2 additions & 2 deletions robosystems_client/models/classification_lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class ClassificationLite:
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-
seeded rows.
source (None | str | Unset): Provenance — 'arcrole_analysis', 'disclosure_mechanics', 'us-gaap-metamodel',
adapter name, etc.
source (None | str | Unset): Provenance — 'arcrole_analysis', 'disclosure_mechanics', 'fac-traits', adapter
name, etc.
"""

id: str
Expand Down
37 changes: 37 additions & 0 deletions robosystems_client/models/information_block_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from ..models.information_model_response import InformationModelResponse
from ..models.rule_lite import RuleLite
from ..models.verification_result_lite import VerificationResultLite
from ..models.verification_summary import VerificationSummary
from ..models.view_projections import ViewProjections


Expand Down Expand Up @@ -62,6 +63,9 @@ class InformationBlockEnvelope:
underlying block has no FactSet row yet — typically library-seeded statement Structures with no tenant-generated
facts, or Schedule rows written before the create-side FactSet stamping was added.
verification_results (list[VerificationResultLite] | Unset):
verification_summary (None | Unset | VerificationSummary): Server-computed aggregate over
``verification_results`` — overall pass/fail/error/skip counts plus a per-rule_category breakdown for the
grouped Verification Results panel. Null when the block has no verification results.
view (ViewProjections | Unset): Charlie's six ``type-of View`` arms, surfaced at the envelope boundary.

Each projection is computed server-side at envelope-build time when
Expand Down Expand Up @@ -95,11 +99,13 @@ class InformationBlockEnvelope:
dimensions: list[InformationBlockEnvelopeDimensionsItem] | Unset = UNSET
fact_set: FactSetLite | None | Unset = UNSET
verification_results: list[VerificationResultLite] | Unset = UNSET
verification_summary: None | Unset | VerificationSummary = UNSET
view: ViewProjections | Unset = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
from ..models.fact_set_lite import FactSetLite
from ..models.verification_summary import VerificationSummary

id = self.id

Expand Down Expand Up @@ -183,6 +189,14 @@ def to_dict(self) -> dict[str, Any]:
verification_results_item = verification_results_item_data.to_dict()
verification_results.append(verification_results_item)

verification_summary: dict[str, Any] | None | Unset
if isinstance(self.verification_summary, Unset):
verification_summary = UNSET
elif isinstance(self.verification_summary, VerificationSummary):
verification_summary = self.verification_summary.to_dict()
else:
verification_summary = self.verification_summary

view: dict[str, Any] | Unset = UNSET
if not isinstance(self.view, Unset):
view = self.view.to_dict()
Expand Down Expand Up @@ -220,6 +234,8 @@ def to_dict(self) -> dict[str, Any]:
field_dict["fact_set"] = fact_set
if verification_results is not UNSET:
field_dict["verification_results"] = verification_results
if verification_summary is not UNSET:
field_dict["verification_summary"] = verification_summary
if view is not UNSET:
field_dict["view"] = view

Expand All @@ -238,6 +254,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.information_model_response import InformationModelResponse
from ..models.rule_lite import RuleLite
from ..models.verification_result_lite import VerificationResultLite
from ..models.verification_summary import VerificationSummary
from ..models.view_projections import ViewProjections

d = dict(src_dict)
Expand Down Expand Up @@ -357,6 +374,25 @@ def _parse_fact_set(data: object) -> FactSetLite | None | Unset:

verification_results.append(verification_results_item)

def _parse_verification_summary(data: object) -> None | Unset | VerificationSummary:
if data is None:
return data
if isinstance(data, Unset):
return data
try:
if not isinstance(data, dict):
raise TypeError()
verification_summary_type_0 = VerificationSummary.from_dict(data)

return verification_summary_type_0
except (TypeError, ValueError, AttributeError, KeyError):
pass
return cast(None | Unset | VerificationSummary, data)

verification_summary = _parse_verification_summary(
d.pop("verification_summary", UNSET)
)

_view = d.pop("view", UNSET)
view: ViewProjections | Unset
if isinstance(_view, Unset):
Expand All @@ -382,6 +418,7 @@ def _parse_fact_set(data: object) -> FactSetLite | None | Unset:
dimensions=dimensions,
fact_set=fact_set,
verification_results=verification_results,
verification_summary=verification_summary,
view=view,
)

Expand Down
45 changes: 45 additions & 0 deletions robosystems_client/models/initial_entity_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ class InitialEntityData:
state_of_incorporation (None | str | Unset): State of incorporation
fiscal_year_end (None | str | Unset): Fiscal year end (MMDD)
ein (None | str | Unset): Employer Identification Number
entity_type (None | str | Unset): Entity legal form (e.g. 'corporation', 'llc' / 'limited_liability_company',
'partnership', 'sole_proprietorship', 'non_profit'). Drives the graph's default Reporting Style at creation —
partnership and llc get dedicated equity-form Styles; everything else defaults to corporate. Blank falls back to
corporate.
reporting_style_id (None | str | Unset): Optional explicit Reporting Style Structure id to pin on the graph,
overriding the entity_type-derived default. Leave blank to derive from entity_type. Change later via the change-
reporting-style operation.
"""

name: str
Expand All @@ -42,6 +49,8 @@ class InitialEntityData:
state_of_incorporation: None | str | Unset = UNSET
fiscal_year_end: None | str | Unset = UNSET
ein: None | str | Unset = UNSET
entity_type: None | str | Unset = UNSET
reporting_style_id: None | str | Unset = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
Expand Down Expand Up @@ -97,6 +106,18 @@ def to_dict(self) -> dict[str, Any]:
else:
ein = self.ein

entity_type: None | str | Unset
if isinstance(self.entity_type, Unset):
entity_type = UNSET
else:
entity_type = self.entity_type

reporting_style_id: None | str | Unset
if isinstance(self.reporting_style_id, Unset):
reporting_style_id = UNSET
else:
reporting_style_id = self.reporting_style_id

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
Expand All @@ -121,6 +142,10 @@ def to_dict(self) -> dict[str, Any]:
field_dict["fiscal_year_end"] = fiscal_year_end
if ein is not UNSET:
field_dict["ein"] = ein
if entity_type is not UNSET:
field_dict["entity_type"] = entity_type
if reporting_style_id is not UNSET:
field_dict["reporting_style_id"] = reporting_style_id

return field_dict

Expand Down Expand Up @@ -205,6 +230,24 @@ def _parse_ein(data: object) -> None | str | Unset:

ein = _parse_ein(d.pop("ein", UNSET))

def _parse_entity_type(data: object) -> None | str | Unset:
if data is None:
return data
if isinstance(data, Unset):
return data
return cast(None | str | Unset, data)

entity_type = _parse_entity_type(d.pop("entity_type", UNSET))

def _parse_reporting_style_id(data: object) -> None | str | Unset:
if data is None:
return data
if isinstance(data, Unset):
return data
return cast(None | str | Unset, data)

reporting_style_id = _parse_reporting_style_id(d.pop("reporting_style_id", UNSET))

initial_entity_data = cls(
name=name,
uri=uri,
Expand All @@ -216,6 +259,8 @@ def _parse_ein(data: object) -> None | str | Unset:
state_of_incorporation=state_of_incorporation,
fiscal_year_end=fiscal_year_end,
ein=ein,
entity_type=entity_type,
reporting_style_id=reporting_style_id,
)

initial_entity_data.additional_properties = d
Expand Down
45 changes: 25 additions & 20 deletions robosystems_client/models/line_item_metadata_predicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,57 +13,60 @@

@_attrs_define
class LineItemMetadataPredicate:
"""Filter ledger LineItems whose ``metadata_[field]`` is in ``values``.
"""Filter ledger LineItems by flow concept.

The single predicate kind shipped in Phase 2 MVP. Sufficient for any
source taxonomy that stamps a flow-tag column on each transaction
line — mini's ``TransactionDescriptionCode``, future XBRL GL
``GenericFlowCategory`` columns, custom tenant tags.
The single predicate kind shipped to date. ``values`` are flow-concept
qnames — mini's ``TransactionDescriptionCode`` values, rs-gaap flow
concepts (what the enrichment classifier emits for QuickBooks data),
future XBRL GL ``GenericFlowCategory`` codes. The engine resolves them
to element_ids and matches the first-class ``LineItem.flow_element_id``
FK; matched lines aggregate signed into the attributed fact for the
period.

``field`` is the JSONB key under ``line_items.metadata`` (e.g.
``"transaction_description_code"``). ``values`` is the set of values
that route to the filter's target concept; matched LineItems aggregate
signed into the attributed fact for the period.
``field`` is **legacy and ignored** — the flow tag used to live in
``line_items.metadata[field]`` but has been promoted to the typed
``flow_element_id`` FK. Retained for wire-compatibility; the engine no
longer reads it.

Attributes:
field (str): JSONB key under ``line_items.metadata`` to match against — e.g. ``transaction_description_code``.
The renderer performs an exact-string comparison on the JSONB-extracted text value.
values (list[str]): Metadata values that route to this filter's target concept. A LineItem matches when
``metadata[field] ∈ values`` AND the line falls within the rollforward's period.
values (list[str]): Flow-concept qnames that route to this filter's target concept. A LineItem matches when its
``flow_element_id`` is one of the elements named here AND the line falls within the rollforward's period.
kind (Literal['line_item_metadata_field'] | Unset): Discriminator value selecting this predicate shape. Default:
'line_item_metadata_field'.
field (str | Unset): Legacy/ignored. The flow tag now lives in the typed ``flow_element_id`` FK, not JSONB
metadata; the engine no longer reads this. Retained for wire-compatibility. Default:
'transaction_description_code'.
"""

field: str
values: list[str]
kind: Literal["line_item_metadata_field"] | Unset = "line_item_metadata_field"
field: str | Unset = "transaction_description_code"
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
field = self.field

values = self.values

kind = self.kind

field = self.field

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"field": field,
"values": values,
}
)
if kind is not UNSET:
field_dict["kind"] = kind
if field is not UNSET:
field_dict["field"] = field

return field_dict

@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
d = dict(src_dict)
field = d.pop("field")

values = cast(list[str], d.pop("values"))

kind = cast(Literal["line_item_metadata_field"] | Unset, d.pop("kind", UNSET))
Expand All @@ -72,10 +75,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
f"kind must match const 'line_item_metadata_field', got '{kind}'"
)

field = d.pop("field", UNSET)

line_item_metadata_predicate = cls(
field=field,
values=values,
kind=kind,
field=field,
)

line_item_metadata_predicate.additional_properties = d
Expand Down
Loading
Loading