'Proses', self::COMPLETED => 'Selesai', }; } public function isEditable(): bool { return $this === self::IN_PROGRESS; } public function transitionStatusMessage(): string { return match ($this) { self::COMPLETED => 'Proses cutting berhasil diselesaikan.', default => 'Status proses cutting berhasil diperbarui.', }; } public function canTransitionTo(self $status): bool { return match ($this) { self::IN_PROGRESS => $status === self::COMPLETED, default => false, }; } public function transitionPermission(): Permission { return match ($this) { self::COMPLETED => Permission::CUTTINGS_COMPLETE, self::IN_PROGRESS => Permission::CUTTINGS_UPDATE, default => throw new InvalidArgumentException('Status tidak mendukung transisi.'), }; } /** * @return list */ public function availableActions(): array { return match ($this) { self::IN_PROGRESS => [ [ 'status' => self::COMPLETED->value, 'label' => 'Selesai', 'destructive' => false, 'permission' => Permission::CUTTINGS_COMPLETE->value, 'icon_only' => false, ], ], default => [], }; } }