aeat.adapters.persistence.profile.justificante module¶
Governed-persistence repository for parsed justificante metadata.
Justificante metadata captures AEAT verification identifiers, operator
identity, timestamps, and verification URLs. The structured metadata is
stored as encrypted byte objects in the primary SQL backend at
SensitivityClass AUDIT
sensitivity; no plaintext metadata JSON or envelope file lands on disk.
This concrete repository is the persistence adapter for the
Justificante audit-sink record. It lives in
the persistence adapter (not in justificante) because its
base SecureBoundRepository is
SQL/crypto-coupled; the domain package owns only the pure record and its
parser. No domain-layer caller consumes the repository, so no domain port is
declared (the prior zero-consumer _protocols.py was removed on 2026-06-01);
the application layer constructs this concrete directly.
See also
JustificantePayload model encrypted by this repository.
SecureObjectRepositorySQL object store underlying the bound repository.
- class JustificanteRepository(*, bucket_id=None, objects=None, settings=None)[source]¶
Bases:
SecureBoundRepository[Justificante]Encrypted AUDIT repository for
Justificantemetadata.The
SecureBoundRepositorybase stores eachJustificantein aEnveloperow under the AUDIT justificante-metadata namespace. The AEAT CSV is the natural key, so list and iteration APIs expose persisted receipt metadata without reading plaintext metadata from disk.- Parameters:
bucket_id (str | None)
objects (SecureObjectRepository | None)
settings (Settings | None)
- namespace: ClassVar[str]¶
- sensitivity: ClassVar[SensitivityClass]¶
- schema_version: ClassVar[int]¶
- classmethod payload_model()[source]¶
Return the concrete Pydantic payload model for this repository.
- Return type:
- extract_identifier(payload)[source]¶
Return the natural id for
payload(used as the SQL object key).Subclasses MUST override. The base implementation raises
NotImplementedError.- Return type:
- Parameters:
payload (Justificante)
- list_csvs()[source]¶
Return every justificante CSV persisted in this repository, in lexicographic order.
- iter_justificantes()[source]¶
Yield every persisted justificante, in lexicographic CSV order.
- Return type:
- Returns:
Iterator over
Justificanterecords.