aeat.domain.calculations.registry._validate_revision_rules module¶
Revision-level invariant validation helpers.
Validates temporal window overlap, informative-class invariants, bracket-table
coverage, and reconciliation-total closure for a ModeloRevision within
its ModeloDefinition.
The D3 orden_aplicabilidad gate lives in its sibling module
aeat.domain.calculations.registry._validate_orden_aplicabilidad.
- validate_revision_windows(modelo)[source]¶
- Return type:
- Parameters:
modelo (ModeloDefinition)
- validate_informative_class_invariant(modelo)[source]¶
Enforce that informative modelos carry no filing-grade computation artefacts.
- Parameters:
modelo (
ModeloDefinition) – TheModeloDefinitionto validate against the informative-class invariant.- Return type:
- validate_m210_tipo_renta_code_projection_parity(modelo)[source]¶
Enforce bidirectional parity between the registry code set and the core projection.
The official Modelo 210 tipo-de-renta code axis is declared in two places that MUST agree: the registry parameter
m210-tipo-renta-code-<year>(which codes the revision accepts, carrying the registry legal-grounding) and the coreM210_TIPO_RENTA_CODE_PROJECTION(each code’sTipoRentaIrnrrate concept). This gate fails the registry build in BOTH directions: a code declared in the registry with no core projection, and a code the core projects that the registry does not declare. It keeps the two axes from drifting so no declared code resolves to a fabricated rate and no projected code silently lacks a grounded home.- Parameters:
modelo (
ModeloDefinition) – TheModeloDefinitionto check. Only revisions carrying anm210-tipo-renta-code-parameter are inspected; every other modelo is a no-op.- Return type:
- validate_bracket_table_temporal_coverage(scope, revision)[source]¶
Surface bracket_table parameters whose windows gap the revision date range.
Every
bracket_tableparameter withbracket_axis = "filing_period"must have at least one bracket window covering every date in the revision’s[valid_from, valid_to]range (or fromvalid_fromto the first bracket window’svalid_towhen the revision is open-ended).A gap detected here would otherwise surface at runtime as a
bracket_no_windowerror when an operator files for a period in the uncovered range — this validator promotes that to a registry-load failure.- Parameters:
scope (
str) – Diagnostic scope string prefixed to each failure message.revision (
ModeloRevision) – TheModeloRevisionwhose bracket_table parameters are checked for temporal coverage gaps.
- Return type: