<?php

declare(strict_types=1);

namespace Kylin\Manufacturing\Enums;

/**
 * 设备状态
 */
enum EquipmentStatus: string
{
    case Running = 'running';
    case Idle = 'idle';
    case Fault = 'fault';
    case Maintenance = 'maintenance';
    case Retired = 'retired';

    public function label(): string
    {
        return match ($this) {
            self::Running => '运行中',
            self::Idle => '待机',
            self::Fault => '故障',
            self::Maintenance => '保养中',
            self::Retired => '已退役',
        };
    }

    public function badgeClass(): string
    {
        return match ($this) {
            self::Running => 'bg-success',
            self::Idle => 'bg-warning',
            self::Fault => 'bg-danger',
            self::Maintenance => 'bg-info',
            self::Retired => 'bg-secondary',
        };
    }
}
