cadrumo.application.aggregation.modelo_bindings_retenciones module

Per-perceptor retenciones source resolver for modelo calculation bindings.

class RetencionesAggregationSourceResolver(*, ports)[source]

Bases: object

Source mesh resolver for the dedicated per-perceptor retención store.

Reads the bucket-scoped per-perceptor retención observations (RetencionObservationRepository) for the modelo’s period and materialises the declared retenciones aggregation bindings through the matching validated aggregator. Modelo 115 consumes the quarterly URBAN_RENTAL count/base; annual summary modelos consume the same family store for their distinct-NIF count. Modelo 190’s percepciones count is handled by WithholdingSourceResolver.

Parameters:

ports (RetencionObservationPorts)

resolver_id: ClassVar[str]
owned_sources: ClassVar[tuple[BindingSourceKind, ...]]
static aggregate(modelo, observations, *, period)[source]

Aggregate per-perceptor retención observations for modelo.

The ONE canonical retenciones aggregation entry point. Both this resolver’s live calculate path (resolve()) and the per-modelo aggregation service (aggregate_per_modelo(), the CLI aggregate / pull surface) route through this single method over the shared _RETENCIONES_AGGREGATORS dispatch, so the calculate and pull surfaces produce byte-identical aggregation and cannot drift (aeat-calculation-aggregation). Raises KeyError for a non-retenciones modelo, matching the prior service dispatch.

Return type:

RetencionesAggregation

Parameters:
static supports_modelo(modelo)[source]

Return whether this canonical retenciones dispatcher owns modelo.

Return type:

bool

Parameters:

modelo (str)

resolve(context)[source]

Resolve the retenciones binding values for the declared modelo context.

Return type:

CalculationSourceResolution

Parameters:

context (CalculationSourceContext)