aeat.domain.calculations.registry._citation_blocklist module¶
Known-bad Spanish-tax legal citation guardrails for registry validation.
- CitationSource¶
Closed set of Spanish-law source types a registry legal citation may reference.
Maps to the
sourcefield onlegal_refsentries in the modelo registry TOML authoring tree. Values are lowercase identifiers:"ley"— primary legislation (e.g. LIRPF, LIS, LIVA)."real_decreto"— Royal Decree (e.g. RIRPF, RIS)."real_decreto_legislativo"— consolidated legislative text approved by royal legislative decree (e.g. TRLIRNR)."orden"— Ministerial Order (HAC/EHA prefixes)."reglamento"— secondary regulation."manual"— AEAT published guidance manual."instruction"— AEAT instruction document.
alias of
Literal[‘ley’, ‘real_decreto’, ‘real_decreto_legislativo’, ‘orden’, ‘reglamento’, ‘manual’, ‘instruction’]
- class KnownBadCitation(source, article, role_substring, reason)[source]¶
Bases:
NamedTupleA guardrail entry recording one mis-cited Spanish-tax legal reference.
- Variables:
source – The
CitationSourcecategory of the misfiring citation (e.g."ley","reglamento").article – The article number string as it appears in registry TOML (e.g.
"103","100.3.a").role_substring – A translatable substring that the casilla’s
rolefield must contain to trigger this guard. Matching is done after Unicode diacritic folding and case folding.reason – Human-readable explanation of why the citation is wrong and which article should be used instead. Used in validation error messages surfaced to the registry author.
- Parameters:
source (Literal['ley', 'real_decreto', 'real_decreto_legislativo', 'orden', 'reglamento', 'manual', 'instruction'])
article (str)
role_substring (Translatable)
reason (str)
-
source:
Literal['ley','real_decreto','real_decreto_legislativo','orden','reglamento','manual','instruction']¶ Alias for field number 0
-
role_substring:
Translatable¶ Alias for field number 2
- known_bad_citations()[source]¶
Return the reviewed
KnownBadCitationguardrail entries.- Return type:
- find_known_bad(source, article, role_text)[source]¶
Return the first blocklist entry that matches the supplied citation, or
None.Matching is performed after diacritic folding:
role_textand everyKnownBadCitation.role_substringare lowercased and stripped of combining diacritics before the substring test runs, so"cuota íntegra"and"cuota integra"compare as equal.- Parameters:
source (
Literal['ley','real_decreto','real_decreto_legislativo','orden','reglamento','manual','instruction']) – TheCitationSourcecategory of the citation being validated.article (
str) – The article number string as written in registry TOML.role_text (
str) – The free-textrolefield of the casilla being validated.
- Return type:
- Returns:
The matching
KnownBadCitationentry, orNoneif the citation is not on the blocklist.