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 Portal member or its canonical string value. Any failure — unknown identifier, failed coercion — raises UnknownPortalError.

Parameters:

portal (Portal | str) – A Portal member or its string value.

Return type:

PortalMetadata

Returns:

The authoritative PortalMetadata for portal.

Raises:

UnknownPortalError – If portal is 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_modelo is a filing-dispatch helper, and the censo procedures (Modelo 036/037) live in their own category so callers can look them up with portals_by_category() when needed.

Parameters:

code (ModeloCode | str) – A aeat.domain.modelos.ModeloCode member or its string value.

Return type:

tuple[PortalMetadata, ...]

Returns:

A tuple of matching PortalMetadata entries declared by validated registry definitions and sorted by Portal value for deterministic output.

Raises:

PortalValidationError – If code is not a recognised modelo identifier.

portals_by_category(category)[source]

Return every portal in category sorted by Portal value.

Parameters:

category (PortalCategory) – The PortalCategory to filter by.

Return type:

tuple[PortalMetadata, ...]

Returns:

A tuple of matching PortalMetadata entries.