cadrumo.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 cadrumo.adapters.persistence.storage.secure_object_namespaces.MODELO_WORK_UNIT_CATALOGUE_NAMESPACE; its default object key is the singleton catalogue row.

exception WorkUnitPersistenceError(message=None, *, context=None, translated_message=None)[source]

Bases: ModeloError

Raised when the work-unit catalogue cannot be loaded or saved.

This wraps storage-boundary failures from WorkUnitCatalogueRepository while preserving translated recovery context for callers.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • translated_message (str | None)

Return type:

None

code
upsert_work_unit(catalogue, unit)[source]

Return a new WorkUnitCatalogue with unit inserted or replaced.

The input catalogue is not mutated. The returned catalogue carries the same work units as the input plus unit at its deterministic work_unit_id; any existing entry under that id is replaced.

Return type:

WorkUnitCatalogue

Parameters: