aeat.domain.calculations.registry._export module¶
Resolved export layouts for registry-backed AEAT record designs.
Resolves export layouts declared on a ModeloRevision and verifies
them against a RegistrySnapshot. The resolved layout is a
ResolvedExportLayout ready for fixed-width filing assembly.
- class ResolvedExportLayout(**data)[source]¶
Bases:
RegistryModelA selected, validated export layout ready for read-only filing assembly.
- Parameters:
layout (ExportLayoutDefinition)
ordered_fields (tuple[ExportFieldDefinition, ...])
fields_by_id (Mapping[ExportFieldId, ExportFieldDefinition])
fields_by_casilla (Mapping[CasillaId, tuple[ExportFieldDefinition, ...]])
- layout: ExportLayoutDefinition¶
- ordered_fields: tuple[ExportFieldDefinition, ...]¶
- fields_by_id: Mapping[ExportFieldId, ExportFieldDefinition]¶
- fields_by_casilla: Mapping[CasillaId, tuple[ExportFieldDefinition, ...]]¶
- resolve_export_layout(snapshot, layout_id=None)[source]¶
Resolve one export layout from a validated registry snapshot.
- Parameters:
snapshot (
RegistrySnapshot) – TheRegistrySnapshotto resolve the layout from.layout_id (
str|None) – Identifier of the export layout to resolve. May beNonewhen the revision declares exactly one layout; otherwise required to disambiguate.
- Return type:
- Returns:
The
ResolvedExportLayoutfor the selected layout.
- derive_export_layouts_from_bindings(revision)[source]¶
Return revision export layouts with binding-derived fields resolved.
Some official AEAT record designs expose structured filing records that are already represented as registry bindings. In those cases the export layout declares the record-level intent via
binding_recordand this resolver derives field coordinates from the binding selectors instead of requiring a second coordinate table in TOML.- Parameters:
revision (
ModeloRevision) – TheModeloRevisionwhose export layouts and bindings are used to derive the resolved field coordinates.- Return type:
- Returns:
Tuple of
ExportLayoutDefinitionwith binding-derived fields populated.
- export_fields_for_casilla(resolved, casilla_id)[source]¶
Return all
ExportFieldDefinitionentries mapped tocasilla_id.- Return type:
- Parameters:
resolved (ResolvedExportLayout)
casilla_id (CasillaId)