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:

list[str]

Parameters:

modelo (ModeloDefinition)

validate_informative_class_invariant(modelo)[source]

Enforce that informative modelos carry no filing-grade computation artefacts.

Parameters:

modelo (ModeloDefinition) – The ModeloDefinition to validate against the informative-class invariant.

Return type:

list[str]

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 core M210_TIPO_RENTA_CODE_PROJECTION (each code’s TipoRentaIrnr rate 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) – The ModeloDefinition to check. Only revisions carrying an m210-tipo-renta-code- parameter are inspected; every other modelo is a no-op.

Return type:

list[str]

validate_dated_values(scope, parameter_id, values)[source]
Return type:

list[str]

Parameters:
validate_bracket_table_temporal_coverage(scope, revision)[source]

Surface bracket_table parameters whose windows gap the revision date range.

Every bracket_table parameter with bracket_axis = "filing_period" must have at least one bracket window covering every date in the revision’s [valid_from, valid_to] range (or from valid_from to the first bracket window’s valid_to when the revision is open-ended).

A gap detected here would otherwise surface at runtime as a bracket_no_window error 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) – The ModeloRevision whose bracket_table parameters are checked for temporal coverage gaps.

Return type:

list[str]

validate_reconciliation_total_closure(scope, revision)[source]
Return type:

list[str]

Parameters: