aeat.adapters.persistence.profile.submission module¶
Governed-persistence repository for submission audit records.
Submission audit records keep the local or imported
domain.submission.ModeloPresentado lifecycle: draft id, modelo,
period, taxpayer identity, AEAT receipt metadata when observed, and attempt
summaries. They are stored as encrypted byte objects in the primary SQL backend
at AUDIT SensitivityClass; no
plaintext submission JSON or envelope file lands on disk.
This concrete repository is the persistence adapter behind the read-side
domain.submission.SubmissionRepositoryProtocol. It lives in the
persistence adapter (not in domain.submission) because its base
SecureBoundRepository is
SQL/crypto-coupled; the domain package depends only on the structural port.
See also
domain.submission.ModeloPresentadoPayload model encrypted by this repository.
domain.submission.SubmissionRepositoryProtocolDomain-facing read port this repository satisfies structurally.
adapters.persistence.storage.SecureObjectRepositorySQL object store underlying the bound repository.
- class SubmissionRepository(*, bucket_id=None, objects=None, settings=None)[source]¶
Bases:
SecureBoundRepository[ModeloPresentado]Encrypted AUDIT repository for
ModeloPresentadorecords.The
SecureBoundRepositorybase stores eachModeloPresentadoin aEnveloperow under the AUDIT submission-records namespace. The natural key is the submission id, so the list and iteration APIs expose historical filing attempts rather than any live submission capability.See also
domain.submission.SubmissionRepositoryProtocolDomain read port this class satisfies.
SecureObjectRepositorySQL object store composed by the bound repository base.
- 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 (ModeloPresentado)
- list_submission_ids()[source]¶
Return every submission id persisted in this repository, in lexicographic order.
- iter_submissions()[source]¶
Yield every persisted submission, in lexicographic id order.
Audit-record enumeration is resilient: rows that fail classification or schema-version gates are logged and skipped rather than aborting the iteration. Diagnostic surfaces depend on listing all healthy submissions even when a single row is unreadable.
- Return type:
- Returns:
Iterator over
ModeloPresentadorecords.