aeat.adapters.outbound.aeat.sede._observation_store module¶
Persistence helpers for read-only filed-declaration observations.
Persists each filed-declaration observation as an
Envelope record through
SecureObjectRepository, keyed
by declaration identity so a prior filing can be retrieved without re-fetching
it from the sede. Each envelope is classified at
SensitivityClass FINANCIAL and
encrypted via the active
MasterKeyProvider.
Artefact bytes are stored under
adapters.persistence.storage.AEAT_FILED_DECLARATION_ARTEFACTS_NAMESPACE;
filed-declaration observation envelopes are stored under
adapters.persistence.storage.AEAT_FILED_DECLARATION_OBSERVATIONS_NAMESPACE;
IVA wallet observation envelopes are stored under
adapters.persistence.storage.AEAT_IVA_WALLET_OBSERVATIONS_NAMESPACE.
Those namespace definitions provide the schema version, key grammar, profile
scope, and full-custody disposition for each row family.
- class FiledDeclaracionObservationStore(root, *, master_key_provider=None, objects=None)[source]¶
Bases:
objectPersist captured AEAT filed data through encrypted SQL namespaces.
The store writes raw captured artefact bytes to
adapters.persistence.storage.AEAT_FILED_DECLARATION_ARTEFACTS_NAMESPACE. It wrapsFiledDeclaracionObservationandIvaCompensationWalletObservationpayloads inEnveloperecords before writing them to their dedicated FINANCIAL namespaces throughSecureObjectRepository.- Parameters:
root (Path)
master_key_provider (MasterKeyProvider | None)
objects (SecureObjectRepository | None)
- persist_artefact(observation_key, artefact, body)[source]¶
Persist one captured artefact and return its
FiledDeclaracionArtefactstorage reference.Artefact bytes are stored under
adapters.persistence.storage.AEAT_FILED_DECLARATION_ARTEFACTS_NAMESPACEusing the body SHA-256 as the natural object key.- Return type:
- Parameters:
- load_artefact(storage_ref)[source]¶
Return plaintext artefact bytes from an encrypted storage reference.
The reference resolves into
adapters.persistence.storage.AEAT_FILED_DECLARATION_ARTEFACTS_NAMESPACE.
- persist_observation(observation)[source]¶
Persist a normalized observation manifest and return its logical object path.
The envelope row is stored under
adapters.persistence.storage.AEAT_FILED_DECLARATION_OBSERVATIONS_NAMESPACE.- Return type:
Path- Parameters:
observation (FiledDeclaracionObservation)
- load_observation(path)[source]¶
Load and decrypt a
FiledDeclaracionObservationfrom the encrypted store.The encrypted row is read from
adapters.persistence.storage.AEAT_FILED_DECLARATION_OBSERVATIONS_NAMESPACE.- Return type:
- Parameters:
path (Path)
- list_observations()[source]¶
Return
FiledDeclaracionObservationrecords from the active encrypted backend.Rows are scanned from
adapters.persistence.storage.AEAT_FILED_DECLARATION_OBSERVATIONS_NAMESPACE.- Return type:
- persist_iva_wallet_observation(observation)[source]¶
Persist a read-only IVA wallet observation and return its logical path.
The envelope row is stored under
adapters.persistence.storage.AEAT_IVA_WALLET_OBSERVATIONS_NAMESPACE.- Return type:
Path- Parameters:
observation (IvaCompensationWalletObservation)
- load_iva_wallet_observation(path)[source]¶
Load and decrypt an
IvaCompensationWalletObservationfrompath.The encrypted row is read from
adapters.persistence.storage.AEAT_IVA_WALLET_OBSERVATIONS_NAMESPACE.- Return type:
- Parameters:
path (Path)
- list_iva_wallet_observations()[source]¶
Return
IvaCompensationWalletObservationrecords from the active encrypted backend.Rows are scanned from
adapters.persistence.storage.AEAT_IVA_WALLET_OBSERVATIONS_NAMESPACE.- Return type:
- filed_declaracion_observation_object_key(modelo, ejercicio, period, expediente_id)[source]¶
Return the secure-object natural key for a filed-declaration observation.
The key is the hash grammar declared by
adapters.persistence.storage.AEAT_FILED_DECLARATION_OBSERVATIONS_NAMESPACE.