aeat.domain.portals._registry module¶
Registry assembly for the portal catalogue.
Imports every _entries/portal_*.py module, collects its module-level
ENTRY object, and freezes the result as the public
PORTAL_REGISTRY mapping. Structural invariants are enforced at
import time via _finalise_registry(); any violation raises
aeat.domain.portals._errors.PortalIntegrityError and aborts package
import.
- get_portal(portal)[source]¶
Return the registry entry for a portal.
Accepts either a
Portalmember or its canonical string value. Any failure — unknown identifier, failed coercion — raisesUnknownPortalError.- Parameters:
portal (
Portal|str) – APortalmember or its string value.- Return type:
- Returns:
The authoritative
PortalMetadataforportal.- Raises:
UnknownPortalError – If
portalis not a registered portal.
- portals_for_modelo(code)[source]¶
Return every FILING or BORRADOR portal linked to
code.CENSO portals are intentionally excluded:
portals_for_modelois a filing-dispatch helper, and the censo procedures (Modelo 036/037) live in their own category so callers can look them up withportals_by_category()when needed.- Parameters:
code (
ModeloCode|str) – Aaeat.domain.modelos.ModeloCodemember or its string value.- Return type:
- Returns:
A tuple of matching
PortalMetadataentries declared by validated registry definitions and sorted byPortalvalue for deterministic output.- Raises:
PortalValidationError – If
codeis not a recognised modelo identifier.
- portals_by_category(category)[source]¶
Return every portal in
categorysorted byPortalvalue.- Parameters:
category (
PortalCategory) – ThePortalCategoryto filter by.- Return type:
- Returns:
A tuple of matching
PortalMetadataentries.