cadrumo.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 the pure record and the JustificanteRepositoryProtocol port.

See also

Justificante

Payload model encrypted by this repository.

SecureObjectRepository

SQL object store underlying the bound repository.

class JustificanteRepository(*, bucket_id=None, objects=None, settings=None)[source]

Bases: SecureBoundRepository[Justificante]

Encrypted AUDIT repository for Justificante metadata.

The SecureBoundRepository base stores each Justificante in a Envelope row 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:
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:

type[Justificante]

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:

str

Parameters:

payload (Justificante)

iter_justificantes()[source]

Yield every persisted justificante, in lexicographic CSV order.

Return type:

Iterator[Justificante]

Returns:

Iterator over Justificante records.