aeat.domain.portals._metadata module

Define PortalMetadata for one Portal catalogue entry.

The model binds each URL to its PortalHost, PortalCategory, accepted AuthMethod values, and UrlStability tier before registry assembly.

class PortalMetadata(**data)[source]

Bases: BaseModel

Curated metadata for a single AEAT portal.

One instance per Portal member in the registry. The model is strict, frozen, and rejects unknown keys. Structural cross-reference invariants that span the registry as a whole are enforced at registry-assembly time by aeat.domain.portals._registry._finalise_registry() rather than here, so individual entries can be constructed in isolation.

Variables:
  • portal – The Portal this entry describes.

  • url – Canonical HTTPS URL.

  • subdomain – The PortalHost the URL is hosted on. Must match url.host.

  • categoryPortalCategory the portal belongs to.

  • auth_methods – Non-empty frozenset of accepted AuthMethod values. AuthMethod.ANONYMOUS is mutually exclusive with every other method.

  • url_stabilityUrlStability tier for read-only portal monitoring priority.

  • label – Translation key for the display label.

  • purpose – Translation key for the purpose description.

  • activeFalse marks retired portals preserved for historical lookup.

  • replaced_by – When active is False, optionally points to the Portal member that supersedes this one. When None and active is False, notes must carry a non-empty discontinuation rationale.

  • notes – Tuple of translation keys for notes.

Parameters:
portal: Portal
url: HttpUrl
subdomain: PortalHost
category: PortalCategory
auth_methods: frozenset[AuthMethod]
url_stability: UrlStability
label: tr
purpose: tr
active: bool
replaced_by: Portal | None
notes: tuple[tr, ...]