aeat.domain.calculations.registry._validate_orden_aplicabilidad module¶
The D3 orden_aplicabilidad gate for a ModeloRevision.
D3 / Ruling 4 (period-revision-resolution ADR)¶
Every revision’s orden_aplicabilidad field declares the legal-catalogue
LegalReference id(s) of
the ordenes ministeriales that approve or amend the modelo form for this
revision’s applicability window. The gate is strict:
Every revision MUST declare at least one entry; missing entries are a hard failure.
Every declared entry MUST resolve in the legal catalogue with a
corpus_ref(perregistry-calculation-legal-grounding).Every declared entry MUST also appear in (or be merged into)
legal_refsso existing snapshot ref-collection carries it.
- S24 / Ruling 5 boundary (R3):
For
*-y-siguientes(open-ended) revisions theorden_aplicabilidadMUST cite the orden establishing the open-ended applicability — the connective gate ensuring even the “y siguientes” claim is BOE-anchored. Per-year norm values inside the open-ended revision (rate brackets, thresholds) are the parameter-bracket layer’s responsibility gated byvalidate_bracket_table_temporal_coverage(); a wrong-but-present bracket value is a legal-grounding defect, NOT a resolution defect.
- validate_orden_aplicabilidad(scope, modelo_id, revision, legal_catalogue)[source]¶
Validate the
orden_aplicabilidadgate for one revision.Returned failures MUST block registry load: missing applicability Ordenes, dangling entries, corpus-less entries, and entries absent from
legal_refsare all current-data defects.- S24 connective gate (Ruling 5 boundary):
For open-ended
*-y-siguientesrevisions (valid_to is Noneandperiod_selector.year_fromis set) theorden_aplicabilidadMUST be non-empty — the open-ended applicability claim MUST be BOE-anchored.
- Parameters:
scope (
str) – Diagnostic scope string prefixed to each message.modelo_id (
str) – The modelo identifier.revision (
ModeloRevision) – TheModeloRevisionto validate.legal_catalogue (
Mapping[str,LegalReference]) – The loaded legal-reference catalogue mapping.
- Return type:
- Returns:
A list of load-blocking failures.
- orden_aplicabilidad_hard_failures(scope, modelo_id, revision, legal_catalogue)[source]¶
Return load-blocking failures of the
orden_aplicabilidadgate.- Parameters:
scope (
str) – Diagnostic scope string prefixed to each message.modelo_id (
str) – The modelo identifier.revision (
ModeloRevision) – TheModeloRevisionto validate.legal_catalogue (
Mapping[str,LegalReference]) – The loadedLegalReferencecatalogue mapping.
- Return type:
- Returns:
A list of load-blocking failures.