aeat.adapters.outbound.aeat.sede._notifications module¶
Read-only notifications/messages reader for the authenticated AEAT sede.
Captured against a production account; the sede exposes two notification surfaces:
Summary (
/wlpl/GNNO-JDIT/ResumenInteresados) — unread notifications + unread communications, two tables keyed by número de certificado.Query (
/wlpl/GNNO-JDIT/SvInteresadosQuery?VEZ=BUSCAR1) — a full-text search form plus a results table with one row per (notification, communication, or pending) item.
Both surfaces are reachable on the www6 Cl@ve-dispatched
subdomain; an earlier assumption that notifications lived only on
www1 (cert-only) was wrong.
The reader is structurally read-only: no form submission, no
state-changing URL. Acknowledgement (acuse) is a strictly local
concern (the local inbox tracks read/unread); the reader never
tells AEAT “this was read”.
Public surface: RemoteNotification, NotificationsSnapshot,
parse_notifications_query(), parse_notifications_summary(),
fetch_notifications_query(), fetch_notifications_summary().
- class RemoteNotification(**data)[source]¶
Bases:
BaseModelOne row of AEAT’s notifications/communications surface.
tipodistinguishes a formalNotificación(legally binding, triggers the ten-dayacusewindow) from a lighter-weightComunicación. Thependientevalue marks the placeholder state AEAT shows for items that have been issued but not yet delivered.- Variables:
certificado_id –
Nº de certificado— 13-digit (or longer) AEAT identifier.tipo – Row class —
"notificacion"|"comunicacion"|"pendiente"|"unknown".concepto – Free-text concepto / subject line (may be empty for pending rows).
titular_nif – NIF / NIE of the titular (verbatim from AEAT).
titular_nombre – Free-text nombre / razón social of the titular.
destinatario_nif – NIF of the destinatario (may equal titular).
destinatario_nombre – Free-text nombre / razón social of the destinatario.
fecha_emision –
Fecha de emisiónas a local date.fecha_notificacion –
Fecha de notificaciónwhen the row has been delivered, elseNone.modo_notificacion – Text AEAT prints for the delivery channel, or
Nonewhen not yet delivered.leida –
Trueif AEAT marks the row as “Leída”,Falseotherwise,Nonefor pending rows with no column value.source_url – URL the row was scraped from.
mode – Structural read-only marker.
- Parameters:
certificado_id (str)
tipo (Literal['notificacion', 'comunicacion', 'pendiente', 'unknown'])
concepto (str)
titular_nif (str)
titular_nombre (str)
destinatario_nif (str)
destinatario_nombre (str)
fecha_emision (date)
fecha_notificacion (date | None)
modo_notificacion (str | None)
leida (bool | None)
source_url (AnyHttpUrl)
mode (Literal['read'])
- certificado_id: str¶
- tipo: Literal['notificacion', 'comunicacion', 'pendiente', 'unknown']¶
- concepto: str¶
- titular_nif: str¶
- titular_nombre: str¶
- destinatario_nif: str¶
- destinatario_nombre: str¶
- fecha_emision: date¶
- fecha_notificacion: date | None¶
- modo_notificacion: str | None¶
- leida: bool | None¶
- source_url: AnyHttpUrl¶
- mode: Literal['read']¶
- class NotificationsSnapshot(**data)[source]¶
Bases:
BaseModelOne sede-side capture of the entire notifications surface.
- Variables:
rows – Every notification / communication the sede returned.
captured_at – UTC timestamp at snapshot completion.
source_url – The sede URL the rows were scraped from (summary or query, depending on caller choice).
mode – Structural read-only marker.
- Parameters:
rows (tuple[RemoteNotification, ...])
captured_at (datetime)
source_url (AnyHttpUrl)
mode (Literal['read'])
- rows: tuple[RemoteNotification, ...]¶
- captured_at: datetime¶
- source_url: AnyHttpUrl¶
- mode: Literal['read']¶
- parse_notifications_query(html, *, source_url)[source]¶
Parse the full
SvInteresadosQueryresults table.This is the canonical list view; every row carries the full column set (
tipo,leída,modo de notificación, etc.). Prefer this overparse_notifications_summary()when a complete picture is needed.- Parameters:
- Return type:
- Returns:
A
NotificationsSnapshotwith one row per item.
- parse_notifications_summary(html, *, source_url)[source]¶
Parse the unread-summary
ResumenInteresadostables.The summary carries fewer columns per row (no
leída/modo), so the returnedRemoteNotificationrecords leave those asNone. Useful for a cheap unread count / dashboard view.- Parameters:
- Return type:
- Returns:
A
NotificationsSnapshotwith one row per item.
- async fetch_notifications_summary(session, *, settings=None)[source]¶
Live-fetch
ResumenInteresadosusing the authenticated session.- Parameters:
session (
AeatSession) – An authenticatedAeatSessionwhose encrypted browser state carries valid AEAT cookies.settings (
Settings|None) – Optionalcore.config.Settingsoverride.
- Return type:
- Returns:
A
NotificationsSnapshotparsed from the live HTML.
- async fetch_notifications_query(session, *, settings=None)[source]¶
Live-fetch
SvInteresadosQuery(the full table) using Cl@ve.- Parameters:
session (
AeatSession) – An authenticatedAeatSession.settings (
Settings|None) – Optionalcore.config.Settingsoverride.
- Return type:
- Returns:
A
NotificationsSnapshotparsed from the live HTML.