Add a phase transition to history.
(self, to_phase: WorkflowPhase, reason: str = "", triggered_by: str = "system")
| 103 | version: int = 1 |
| 104 | |
| 105 | def add_transition(self, to_phase: WorkflowPhase, reason: str = "", triggered_by: str = "system"): |
| 106 | """Add a phase transition to history.""" |
| 107 | transition = WorkflowTransition( |
| 108 | from_phase=self.phase, |
| 109 | to_phase=to_phase, |
| 110 | reason=reason, |
| 111 | triggered_by=triggered_by |
| 112 | ) |
| 113 | self.phase_transitions.append(transition) |
| 114 | self.phase = to_phase |
| 115 | self.updated_at = datetime.utcnow() |
| 116 | self.last_modified_by = triggered_by |
| 117 | |
| 118 | def add_user_modification(self, field: str, old_value: Any, new_value: Any, user: str = "user"): |
| 119 | """Track user modifications.""" |
no test coverage detected