cadrumo.domain.modelos.work_unit_repository module

Public repository contract for the modelo work-unit catalogue.

class WorkUnitCatalogueRepositoryProtocol(*args, **kwargs)[source]

Bases: Protocol

Narrow domain-facing repository contract for the work-unit catalogue.

property bucket_id: str | None

Return the profile bucket id when this repository resolved one.

exists()[source]

Return whether a work-unit catalogue object has been persisted.

Return type:

bool

load()[source]

Return the persisted WorkUnitCatalogue or an empty catalogue if absent.

Return type:

WorkUnitCatalogue

load_revisioned()[source]

Return the catalogue together with its current persistence revision.

Return type:

tuple[WorkUnitCatalogue, str]

save(catalogue)[source]

Persist catalogue as the encrypted singleton object.

Return type:

None

Parameters:

catalogue (WorkUnitCatalogue)

mutate(mutation)[source]

Apply mutation to the stored catalogue as one revision-guarded unit of work.

Return type:

WorkUnitCatalogue

Parameters:

mutation (Callable[[WorkUnitCatalogue], WorkUnitCatalogue])

save_with_secure_object_writes(catalogue, extra_writes, *, expected_revision_id=None)[source]

Persist catalogue plus co-emitted secure-object writes atomically.

Return type:

None

Parameters:
to_secure_object_write(catalogue, *, expected_revision_id=None)[source]

Return the secure-object upsert for catalogue without committing it.

Return type:

SecureObjectWrite

Parameters: