cadrumo.domain.calculations.registry.retenciones_bindings module¶
Retenciones-aggregation registry binding helpers (RET-1).
The per-family module for the retenciones_aggregation binding source — the
calc-mesh source that materialises retenciones-family scalars from the dedicated
per-perceptor retención store.
Extracted as its own family module per aeat-architecture-boundaries;
the cross-family validator dispatch in bindings registers this family’s
validate(binding) -> list[str] entry.
The materialisation depends on a _RetencionesAggregationProtocol rather
than the application-layer RetencionesAggregation, so the domain layer stays
independent of the application aggregation service.
The resolver walks the declared ModeloRevision bindings and emits only
canonical binding values for this source family.
- class RetencionesAggregationFact(*values)[source]¶
Bases:
StrEnumA figure a retenciones aggregation binding totals across matched rows.
- PERCEPTOR_COUNT_DISTINCT¶
- TAXABLE_BASE_SUM¶
- RETENCION_AMOUNT_SUM¶
- validate_retenciones_aggregation_binding(binding)[source]¶
Accumulating registry-build validator for a
retenciones_aggregationbinding.Validates the selector shape against
RetencionesAggregationProvider(the single build-time contract peraeat-registry-bindings), preserving the underlying pydantic field message in the diagnostic.- Return type:
- Parameters:
binding (BindingDefinition)
- resolve_retenciones_aggregation_binding_values(revision, aggregation, *, authority=None)[source]¶
Materialise every
retenciones_aggregationbinding on aModeloRevision.Returns a binding value for every binding whose
sourceisBindingSourceKind.RETENCIONES_AGGREGATION, keyed by the selector’s declared fact.- Return type:
- Parameters:
revision (ModeloRevision)
aggregation (_RetencionesAggregationProtocol)
authority (GovernedFactSource | None)
- class RetencionesAggregationProvider(**data)[source]¶
Bases:
BaseModelValidated form of a
retenciones_aggregationbinding selector.Carries the target casilla id and the scalar fact this source serves. Annual summary modelos still keep their monetary totals on relation-prefill bindings; Modelo 115 uses the same per-perceptor store directly for its quarterly perceptor count and taxable base.
- Parameters:
data (Any)
- kind: Literal[BindingSourceKind.RETENCIONES_AGGREGATION]¶
- target_casilla_id: CasillaId¶
- schemes: Annotated[tuple[RetencionScheme, ...], BeforeValidator(coerce_enum_tuple(RetencionScheme))]¶
- fact: RetencionesAggregationFactField¶