aeat.adapters.outbound.aeat.sede package

Read-only driver for the authenticated AEAT sede electrónica.

This subpackage models the authenticated AEAT surface through typed read-only records, URL templates, selectors, and parser outputs.

Public API:

from aeat.adapters.outbound.aeat.sede import (
    # Records
    Declaracion,
    Expediente,
    FiledDeclaracionArtefact,
    FiledDeclaracionObservation,
    JustificanteRef,
    NotificationsSnapshot,
    ObservedCasillaValue,
    RemoteNotification,
    SedeCapture,
    # Errors
    ExpedienteNotFoundError,
    JustificanteFetchError,
    SedeError,
    SedeNavigationError,
    SedeParseError,
    # Declaraciones-presentadas register surface
    capture_declaration,
    capture_filed_declaration_observation,
    walk_declarations_register,
    # Mis Expedientes (procedure-tree) surface
    capture_justificante,
    find_expediente,
    resolve_justificante_ref,
    walk_expedientes_tree,
    # Notifications / Comunicaciones surface
    fetch_notifications_query,
    fetch_notifications_summary,
    # Parsers (offline-testable)
    parse_expediente_detail,
    parse_notifications_query,
    parse_notifications_summary,
    parse_resumen_tree,
)

The surface is structurally read-only: every boundary-crossing record carries mode: Literal["read"] and public operations are limited to navigation, download, parsing, and observation.

Navigation flow:

  1. page.goto("/wlpl/TEWV-CORE/ResumenVlt") — Mis Expedientes renders a category tree (AEAT procedure categories, not modelo codes). Expedientes live at the leaves.

  2. Tree nodes lazy-load on click of javascript:mostrarListado(...) onclick handlers. Expanded leaves expose an <a> whose text is the expediente id and whose href is the per-filing-family endpoint (for IRPF: /wlpl/DASR-CORE/AccesoDR<YYYY>RVlt?exp=<id>).

  3. On the expediente detail page, the authoritative justificante (a PDF signed by AEAT) is reachable through the Grabación de la declaración — Consulta / Copia link at /wlpl/KATA-APLI/cotejo/CotejoIdSv?CSV=<csv>.

  4. The raw PDF body is served at /wlpl/KATA-APLI/cotejo/CotejoDocIdSv?CSV=<csv> and must be fetched via APIRequestContext — browser goto wraps the response in Chrome’s PDF viewer shell.

Submodules