Source code for cadrumo.application.modelo.work_lifecycle_ports
"""Application-owned capabilities for Modelo work-unit lifecycle operations.The lifecycle service coordinates the work-unit catalogue with the bucket eventhistory that records each durable transition. It receives both authorities asone required bundle so application code does not construct or discover apersistence adapter. Outer composition roots bind the domain protocols to thesecure-object-backed repositories for the requested profile bucket."""from__future__importannotationsfromdataclassesimportdataclassfromtypingimportProtocolfrom...domain.buckets.protocolsimportBucketEventHistoryRepositoryProtocolfrom...domain.modelos.work_unit_repositoryimportWorkUnitCatalogueRepositoryProtocol
[docs]@dataclass(frozen=True,slots=True)classWorkLifecyclePorts:"""Required persistence authorities for one bucket-scoped lifecycle call."""work_unit_repository:WorkUnitCatalogueRepositoryProtocolbucket_event_repository:BucketEventHistoryRepositoryProtocol
[docs]classWorkLifecyclePortsFactory(Protocol):"""Construct the lifecycle authorities for one profile bucket."""def__call__(self,*,bucket_id:str)->WorkLifecyclePorts:"""Return both required lifecycle authorities for ``bucket_id``."""...
[docs]classActiveWorkLifecyclePortsFactory(Protocol):"""Construct lifecycle authorities for the active execution profile."""def__call__(self)->WorkLifecyclePorts:"""Return both required authorities for the active profile."""...