aeat.domain.portals._entries._common module¶
Shared helpers for constructing per-portal entries.
Each entry module in aeat.domain.portals._entries calls
build_entry() to turn a compact set of keyword arguments into a
fully validated PortalMetadata. Keeping this glue private
isolates the repetitive construction boilerplate from the per-portal
data tables.
- portal_path(portal)[source]¶
Return the centralized relative path for a portal catalogue entry.
The
Portalvalue addresses the external-constants portal path registry.
- build_entry(*, portal, subdomain, category, auth_methods, url_stability, label, purpose, url=None, path=None, active=True, replaced_by=None, notes=())[source]¶
Assemble a
PortalMetadataentry for a single portal.Exactly one of
urlorpathmust be supplied. Whenpathis given, the absolute origin is resolved from the external constants registry againstsubdomain; this keeps per-portal files free of host duplication.- Parameters:
subdomain (
PortalHost) – ThePortalHostthe URL is hosted on.category (
PortalCategory) – ThePortalCategoryclassification.auth_methods (
Iterable[AuthMethod]) – Iterable of acceptedAuthMethodvalues.url_stability (
UrlStability) – TheUrlStabilitytier.label (
str) – Multilingual display label key.purpose (
str) – Multilingual purpose description key.url (
str|None) – Canonical absolute HTTPS URL. Mutually exclusive withpath.path (
str|None) – Path component (must start with/). The host is resolved from the registry viasubdomain.active (
bool) – Whether the portal is currently in service.replaced_by (
Portal|None) – When retired, optionally thePortalmember that supersedes this one.
- Return type:
- Returns:
A validated, frozen
PortalMetadata.- Raises:
PortalValidationError – If neither or both of
urlandpathare supplied, or ifpathdoes not start with/.