<?php

namespace Kylin\Logistics\Enums;

/**
 * 车辆状态枚举
 */
enum VehicleStatus: string
{
    case IDLE = 'idle';
    case IN_TRANSIT = 'in_transit';
    case MAINTENANCE = 'maintenance';
    case RETIRED = 'retired';

    public function label(): string
    {
        return match ($this) {
            self::IDLE => '空闲',
            self::IN_TRANSIT => '运输中',
            self::MAINTENANCE => '维修中',
            self::RETIRED => '已退役',
        };
    }

    public function color(): string
    {
        return match ($this) {
            self::IDLE => 'success',
            self::IN_TRANSIT => 'primary',
            self::MAINTENANCE => 'warning',
            self::RETIRED => 'secondary',
        };
    }
}
