aeat.domain.modelos._repository module¶
Encrypted SQL repository for the modelo work-unit catalogue.
WorkUnitCatalogueRepository persists
WorkUnit records in a WorkUnitCatalogue at
FINANCIAL SensitivityClass
through
SecureObjectRepository. The
catalogue is serialised as a single
Envelope-wrapped JSON payload keyed
by a stable namespace and object key; the underlying column is encrypted so no
plaintext work-unit metadata lands on disk.
The storage contract is declared by
aeat.adapters.persistence.storage.MODELO_WORK_UNIT_CATALOGUE_NAMESPACE;
its default object key is the singleton catalogue row.
- exception WorkUnitPersistenceError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
ModeloErrorRaised when the work-unit catalogue cannot be loaded or saved.
This wraps storage-boundary failures from
WorkUnitCatalogueRepositorywhile preserving translated recovery context for callers.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- upsert_work_unit(catalogue, unit)[source]¶
Return a new
WorkUnitCataloguewithunitinserted or replaced.The input catalogue is not mutated. The returned catalogue carries the same work units as the input plus
unitat its deterministicwork_unit_id; any existing entry under that id is replaced.- Return type:
- Parameters:
catalogue (WorkUnitCatalogue)
unit (WorkUnit)
- remove_work_unit(catalogue, work_unit_id)[source]¶
Return a new catalogue with
work_unit_idremoved.Removing an absent id is a no-op that returns a value-equal catalogue. The original is not mutated.
- Return type:
- Returns:
A
WorkUnitCataloguewithout the given work unit.- Parameters:
catalogue (WorkUnitCatalogue)
work_unit_id (str)