cadrumo.domain.calculations.registry.detail_record_bindings module¶
Detail-record row-set registry binding helpers.
- class RelatedPartyOperationObservation(**data)[source]¶
Bases:
BaseModelOne related-party operation for modelo 232.
- Parameters:
data (Any)
- source_id: str¶
- counterparty_tax_id: TaxIdIdentityToken¶
- counterparty_legal_name: str¶
- country_code: CountryCodeAlpha2¶
- transaction_date: date¶
- operation_kind_code: Annotated[TipoOperacionVinculada, BeforeValidator(_hydrate_operation_kind_code)]¶
- transfer_pricing_method_code: Annotated[MetodoValoracion, BeforeValidator(_hydrate_transfer_pricing_method_code)]¶
- amount: Decimal¶
Validate a related-party-operation binding at registry-build time.
Accumulating
list[str]validator: validates the selector shape againstRelatedPartyOperationProviderand lifts the resolve-time op/fact invariant (row_fieldfact paired with therowsop and a namedrow_field) to build time, preserving the underlying pydantic field error.- Return type:
- Parameters:
binding (BindingDefinition)
- class Modelo720RowObservation(**data)[source]¶
Bases:
BaseModelOne foreign asset for modelo 720.
- Parameters:
data (Any)
- source_id: str¶
- asset_class_code: M720AssetClassCode¶
- country_code: CountryCodeAlpha2¶
- currency_code: str¶
- asset_identifier: str¶
- acquisition_date: date¶
- valuation_amount: Decimal¶
- validate_foreign_asset_binding(binding)[source]¶
Validate a foreign-asset binding at registry-build time.
Accumulating
list[str]validator: validates the selector againstForeignAssetProviderand lifts the resolve-time op/fact invariant to build time, preserving the underlying pydantic field error.- Return type:
- Parameters:
binding (BindingDefinition)
- resolve_foreign_asset_binding_row_values(revision, observations)[source]¶
Resolve row-producer foreign-asset bindings into per-row indexed values.
- Parameters:
revision (
ModeloRevision) – TheModeloRevisionwhose foreign-asset bindings are resolved.observations (
Iterable[Modelo720RowObservation]) – Modelo 720 row observations to group into rows.
- Return type:
- class AtributionMemberObservation(**data)[source]¶
Bases:
BaseModelOne (member, clave, subclave) atribuci�n row for modelo 184.
Every field below
base_imponible_assignedis the (member, clave, subclave) row-shape ADR’s clave/subclave-conditional fact set, and isNonewhenever the declaring clave does not license it – e.g.naturaleza_inmuebleis only ever populated for a clave-C row. ANonehere is a legitimate “this field does not apply to this row”, never a missing value.- Parameters:
data (Any)
- source_id: str¶
- member_tax_id: TaxIdIdentityToken¶
- member_legal_name: str¶
- country_code: CountryCodeAlpha2 | None¶
The party’s country, or
Nonewhen the source stated none.Nullable rather than defaulted to
ES, because these forms carry the NON-RESIDENT population by construction – a perceptor on a withholding form is routinely foreign, and an attribution member can be – so a default silently declares a foreign party Spanish on a filing surface.Absence propagates as an ABSENT KEY in the built row rather than as a value, so a binding that needs the country refuses with the shipped not-produced error naming itself. That is the visible failure the silent default replaced.
- transaction_date: date¶
- base_imponible_assigned: Decimal¶
- clave: str¶
- subclave: str | None¶
- codigo_provincia: str | None¶
- miembro_a_31_diciembre: str | None¶
"X"when the member remained one at 31 December, elseNone.A string flag rather than a bool: the dise�o’s own field (position 82) is text, marked
"X"or left blank – never a boolean literal – and this is the shape the fixed-width renderer’sdata_type = "text"field expects.
- dias_miembro: int | None¶
- domicilio_fiscal: str | None¶
- naturaleza_inmueble: str | None¶
- situacion_inmueble: str | None¶
- referencia_catastral: str | None¶
- clave_declarado: str | None¶
- porcentaje_titularidad_inmueble: Decimal | None¶
- dias_arrendamiento: int | None¶
- reduccion: Decimal | None¶
- rendimiento_neto_previo_eo: Decimal | None¶
- rendimiento_neto_minorado_agricola_eo: Decimal | None¶
- validate_atribucion_binding(binding)[source]¶
Validate an atribuci�n-member binding at registry-build time.
Accumulating
list[str]validator: validates the selector againstAtribucionMemberProviderand lifts the resolve-time op/fact invariant to build time, preserving the underlying pydantic field error.- Return type:
- Parameters:
binding (BindingDefinition)
- resolve_atribucion_binding_row_values(revision, observations)[source]¶
Resolve row-producer atribucion bindings into per-row indexed values.
- Parameters:
revision (
ModeloRevision) – TheModeloRevisionwhose atribucion bindings are resolved.observations (
Iterable[AtributionMemberObservation]) – Attribution member observations to group into rows.
- Return type:
- class RefundOperationObservation(**data)[source]¶
Bases:
BaseModelOne foreign-MS refund operation for modelo 360.
- Parameters:
data (Any)
- source_id: str¶
- member_state_code: CountryCodeAlpha2¶
- operation_kind_code: str¶
- operation_date: date¶
- supplier_tax_id: TaxIdIdentityToken¶
- refund_amount: Decimal¶
- class AtribucionMemberProvider(**data)[source]¶
Bases:
BaseModel- Parameters:
data (Any)
- kind: Literal[BindingSourceKind.ATRIBUCION_MEMBER]¶
- fact: Literal['row_field']¶
- row_field: _AtributionRowField | None¶
- grouping: str | None¶
- record: str | None¶
- data_type: ExportFieldDataType | None¶
Scalar type of the value this row field contributes to the export.
The same fact
BindingRowExportSelector.data_typecarries; declared here so the selector model admits the key, since a source-family selector is validated whole against its own strict model. Optional while the families adopt it.
- class ForeignAssetProvider(**data)[source]¶
Bases:
BaseModel- Parameters:
data (Any)
- kind: Literal[BindingSourceKind.FOREIGN_ASSET]¶
- fact: Literal['row_field']¶
- row_field: _ForeignAssetRowField | None¶
- asset_classes: tuple[str, ...]¶
- grouping: str | None¶
- record: str | None¶
- data_type: ExportFieldDataType | None¶
Scalar type of the value this row field contributes to the export.
The same fact
BindingRowExportSelector.data_typecarries; declared here so the selector model admits the key, since a source-family selector is validated whole against its own strict model. Optional while the families adopt it.
- class RefundOperationProvider(**data)[source]¶
Bases:
BaseModel- Parameters:
data (Any)
- kind: Literal[BindingSourceKind.REFUND_OPERATION]¶
- fact: Literal['row_field']¶
- row_field: _RefundRowField | None¶
- grouping: str | None¶
- record: str | None¶
- data_type: ExportFieldDataType | None¶
Scalar type of the value this row field contributes to the export.
The same fact
BindingRowExportSelector.data_typecarries; declared here so the selector model admits the key, since a source-family selector is validated whole against its own strict model. Optional while the families adopt it.
- class RelatedPartyOperationProvider(**data)[source]¶
Bases:
BaseModel- Parameters:
data (Any)
- kind: Literal[BindingSourceKind.RELATED_PARTY_OPERATION]¶
- fact: Literal['row_field']¶
- row_field: _RelatedPartyRowField | None¶
- grouping: str | None¶
- record: str | None¶
- data_type: ExportFieldDataType | None¶
Scalar type of the value this row field contributes to the export.
The same fact
BindingRowExportSelector.data_typecarries; declared here so the selector model admits the key, since a source-family selector is validated whole against its own strict model. Optional while the families adopt it.
- validate_refund_binding(binding)[source]¶
Validate a refund-operation binding at registry-build time.
Accumulating
list[str]validator: validates the selector againstRefundOperationProviderand lifts the resolve-time op/fact invariant to build time, preserving the underlying pydantic field error.- Return type:
- Parameters:
binding (BindingDefinition)