Source code for cadrumo.application.workflow.adapters
"""Adapter wiring the deadline engine to the workflow protocol.See Also: :class:`~application.workflow.engine.WorkflowEngine` Consumes the adapted deadline collaborator. :mod:`application.modelo.workflow_gate` Builds revision-scoped workflow engines with the same adapter boundaries for verification and local mark-as-filed paths."""from__future__importannotationsfromdatetimeimportdatefrom...domain.deadlines.engineimportDeadlineEnginefrom...domain.deadlines.modelsimportSchedule,TaxpayerProfile
[docs]classDeadlineEngineAdapter:"""Wrap :class:`~domain.deadlines.engine.DeadlineEngine` as a workflow Protocol."""def__init__(self,engine:DeadlineEngine)->None:"""Store the wrapped :class:`DeadlineEngine`."""self._engine=engine
[docs]defcompute(self,profile:TaxpayerProfile,year:int,*,today:date|None=None,)->Schedule:"""Delegate to :meth:`DeadlineEngine.compute` for the given :class:`TaxpayerProfile`. Returns a :class:`Schedule`. """returnself._engine.compute(profile,year,today=today)