allowedTransitions()); } abstract protected function allowedTransitions(): array; public function transitionTo(IntegrationStatus $status): void { if (!$this->canTransitionTo($status)) { throw new \Exception("Transition from {$this->status()->value} to {$status->value} is not allowed."); } $this->request->update(['status' => $status]); // Trigger events or notifications here } }