cadrumo.domain.calculations.registry.ledger_renta_gastos_estimacion_directa_bindings module¶
Canonical Renta estimacion directa ledger-gastos binding family.
- class RentaGastosEstimacionDirectaObservationProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolStructural protocol for first-slice Renta estimación directa gastos observations.
The registry only needs these four attributes to resolve
ledger_renta_gastos_estimacion_directa_aggregationbindings; the fullRentaDeductibleExpenseObservationsatisfies this protocol without any explicit declaration.Properties are declared read-only so that concrete attributes satisfy the protocol under strict covariant checking.
- validate_ledger_renta_gastos_estimacion_directa_aggregation_binding_definition(binding)[source]¶
Validate a
ledger_renta_gastos_estimacion_directa_aggregationbinding definition.- Return type:
- Parameters:
binding (BindingDefinition)
- resolve_ledger_renta_gastos_estimacion_directa_aggregation_binding_values(revision, observations)[source]¶
Resolve every
ledger_renta_gastos_estimacion_directa_aggregationbinding onrevision.Delegates the filter/aggregate skeleton to
resolve_ledger_family_binding_values(), shared by every ledger family resolver.- Parameters:
revision (
ModeloRevision) – TheModeloRevisionwhose gastos bindings to resolve.observations (
Iterable[RentaGastosEstimacionDirectaObservationProtocol]) – Typed gastos observations the bindings aggregate via their declaredselector.factandaggregation.op.
- Return type:
- unsupported_ledger_renta_gastos_estimacion_directa_observations(revision, observations)[source]¶
Return the
RentaGastosEstimacionDirectaObservationProtocolrows no binding onrevisioncan consume.Delegates the screen to
unsupported_ledger_family_observations()— see that function for the shared fail-closed contract (why an unmatched observation is a modelling gap, not a legitimate zero). This family’s own contribution is narrow: the (modelo, period, target_casilla_id) match predicate (reused from the resolver’s_renta_gastos_estimacion_directa_build_matcher) and a zero-deductible_amountfalse-fire guard. Noextra_exclusion.- Parameters:
revision (
ModeloRevision) – TheModeloRevisionwhose gastos bindings define the supported (modelo, period, target_casilla_id) triples.observations (
Iterable[RentaGastosEstimacionDirectaObservationProtocol]) – First-slice gastos observations to screen.
- Return type:
- Returns:
Tuple of observations whose non-zero deductible amount is selected by no
ledger_renta_gastos_estimacion_directa_aggregationbinding.
- renta_first_slice_binding_target_casillas(revision)[source]¶
Return the
target_casilla_idset this revision’s own bindings route to.Unlike the universal BOE-prescribed first-slice routing projection spanning every filing year the application supports), this returns only the casillas a
ledger_renta_gastos_estimacion_directa_aggregationbinding on THIS revision actually targets. Older Modelo 100 revisions (2020-2023) declare no such bindings at all – the first-slice ledger-aggregation mechanism did not yet exist for them – so their required set is legitimately empty even though the universal routing table’s codomain is wider. The snapshot-time referential-integrity gate (cadrumo.domain.renta.first_slice_routing_integrity) uses this per-revision set rather than the universal table so it only fails when a binding THIS revision actually declares points at a casilla absent from that same revision – the real defect class the gate exists to catch, not “does every filing year’s estimación directa casilla exist on every other filing year’s revision” (it does not, by BOE design: casillas are added, split, and renumbered across years).- Parameters:
revision (
ModeloRevision) – TheModeloRevisionwhose ownledger_renta_gastos_estimacion_directa_aggregationbinding selectors are inspected.- Return type:
frozenset[TypeAliasType]
- validate_ledger_renta_gastos_estimacion_directa_aggregation_binding(binding)[source]¶
Validate a
ledger_renta_gastos_estimacion_directa_aggregationbinding at registry-build time.Accumulating
list[str]validator overLedgerRentaGastosEstimacionDirectaProvider; runs the fact/aggregation-op invariant at build time throughinvariant_diagnostics(), whose raise-style body isvalidate_ledger_renta_gastos_estimacion_directa_aggregation_binding_definition().- Return type:
- Parameters:
binding (BindingDefinition)
- class LedgerRentaGastosEstimacionDirectaProvider(**data)[source]¶
Bases:
BaseModelValidated form of a ledger_renta_gastos_estimacion_directa_aggregation binding selector.
- Parameters:
data (Any)
- kind: Literal[BindingSourceKind.LEDGER_RENTA_GASTOS_ESTIMACION_DIRECTA_AGGREGATION]¶
- modelo: Modelo¶
- period: Literal['0A']¶
- target_casilla_id: CasillaId¶
- fact: Literal['deductible_amount_sum']¶