<?php

declare(strict_types=1);

namespace Kylin\Manufacturing\Enums;

/**
 * 工单状态
 */
enum WorkOrderStatus: string
{
    case Created = 'created';
    case Dispatched = 'dispatched';
    case InProgress = 'in_progress';
    case Completed = 'completed';
    case Closed = 'closed';

    public function label(): string
    {
        return match ($this) {
            self::Created => '已创建',
            self::Dispatched => '已派发',
            self::InProgress => '执行中',
            self::Completed => '已完工',
            self::Closed => '已关闭',
        };
    }

    public function badgeClass(): string
    {
        return match ($this) {
            self::Created => 'bg-secondary',
            self::Dispatched => 'bg-info',
            self::InProgress => 'bg-primary',
            self::Completed => 'bg-success',
            self::Closed => 'bg-dark',
        };
    }
}
