aeat.adapters.persistence.profile.filing_drafts module¶
Governed-persistence repository for filing drafts.
ModeloDraft records carry exact casilla
arithmetic and tax due values. They are stored as encrypted byte objects via
SecureObjectRepository at
FINANCIAL SensitivityClass and
serialised through an Envelope by
SecureBoundRepository; no plaintext
draft JSON or envelope file lands on disk.
This concrete repository is the persistence adapter behind the
ModeloDraftRepositoryProtocol port. It lives in
the persistence adapter (not in domain.filing) because its
SecureBoundRepository base is
SQL/crypto-coupled; the domain package owns only the typed
ModeloDraft payload and the narrow read/save
port that domain-facing service code depends on.
See also
ModeloDraftStrict filing payload persisted by this repository.
SecureBoundRepositoryGeneric encrypted-envelope repository base used for the draft store.
adapters.persistence.storage.FILING_DRAFTS_NAMESPACENamespace, sensitivity, schema-version, object-key, and custody contract for draft secure objects.
application.filingApplication review flow that reads and updates persisted drafts.
- class ModeloDraftRepository(*, bucket_id=None, objects=None)[source]¶
Bases:
SecureBoundRepository[ModeloDraft]Encrypted FINANCIAL repository for
ModeloDraftpayloads.The
SecureBoundRepositorybase wraps each draft in anEnvelopeand writes it underadapters.persistence.storage.FILING_DRAFTS_NAMESPACE. The draft id is the natural key, so list and iteration APIs expose draft aggregates rather than submission or amendment records. The namespace definition supplies theFINANCIALSensitivityClass, schema version, object-key grammar, and custody contract.- Parameters:
bucket_id (str | None)
objects (SecureObjectRepository | None)
- namespace: ClassVar[str]¶
- sensitivity: ClassVar[SensitivityClass]¶
- schema_version: ClassVar[int]¶
- classmethod payload_model()[source]¶
Return the
ModeloDraftencrypted payload model for filing drafts.- 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 (ModeloDraft)
- list_draft_ids()[source]¶
Return every draft id persisted in this repository, in lexicographic order.
- iter_drafts()[source]¶
Yield every persisted
ModeloDraft, in lexicographic id order.- Return type: