cadrumo.application.calculations.m303_carry_ingress module¶
Canonical Modelo 303 carry ingress for authoritative filing evidence.
The declaration’s Tipo de declaración is evidence in the submitted-file
header, not a registry casilla. This module is the only place that turns that
evidence (or the local filing boundary’s already-resolved equivalent) into the
typed envelope disposition used to normalize the carry pair. It intentionally
does not make any annual, history, or wallet decision: those later consumers
must read this persisted contract rather than recover an election themselves.
Core types:
CasillaObservation.
- m303_declaration_type_header_key(*, filing_year, period, operation)[source]¶
Resolve the declaration-type header key for one governed M303 filing scope.
- Return type:
- Parameters:
filing_year (int)
period (str)
operation (PinnedAuthorityOperation)
- M303_CARRY_ERROR_NAMESPACE¶
The one namespace every M303 carry ingress refusal is keyed under.
- exception M303CarryIngressError(message=None, *, context=None, translated_message=None, precondition_verdict=None)[source]¶
Bases:
TerminalPreconditionErrorMixin,CoreValidationErrorModelo 303 carry evidence was insufficient or internally contradictory.
A refusal reporting two sources of the same declared amount that disagree attaches a SAFETY
PreconditionVerdict, because choosing either side silently changes the compensación the taxpayer carries forward. An evidence-incomplete refusal carries no verdict: the operator fixes it by supplying the missing evidence.- Parameters:
- Return type:
None
- code¶
- normalize_m303_carry_observation_envelope(envelope, *, operation)[source]¶
Resolve and persist the sole disposition-aware M303 carry projection.
Official AEAT evidence must contain exactly one registry-selected header. Local app evidence must carry the typed result determined at the filing boundary. Both paths converge here, where the result sign, supplied typed projection, and the normalized available/generated pair are checked before a later reader can treat the observation as carry evidence.
- Return type:
- Parameters:
envelope (ObservationEnvelopePayload)
operation (PinnedAuthorityOperation)
- validate_normalized_m303_carry_observation_envelope(envelope, *, operation)[source]¶
Require an envelope to already carry the canonical M303 pair.
History consumes persisted evidence rather than performing a second normalization. Re-running the ingress independently establishes what the canonical projection would be; requiring it to equal the supplied envelope prevents a caller from selecting either semantic amount after validation. Every supported Modelo 303 writer produces this canonical shape; an unnormalized payload is invalid persisted state, not a compatibility form.
- Return type:
- Parameters:
envelope (ObservationEnvelopePayload)
operation (PinnedAuthorityOperation)
- resolve_available_compensation_formula_id(revision, derivation, *, registry_mapping=None)[source]¶
Return the registry formula id backing a generated-basis available projection.
A resultado-basis derivation carries no operands and so cites no formula.
Core types:
ModeloRevision.- Return type:
- Parameters:
revision (ModeloRevision)
derivation (M303CompensationAvailableDerivation)