<?php

namespace Kylin\Logistics\Enums;

/**
 * 车辆类型枚举
 */
enum VehicleType: string
{
    case FOUR_POINT_TWO_M = '4.2m';
    case SIX_POINT_EIGHT_M = '6.8m';
    case NINE_POINT_SIX_M = '9.6m';
    case THIRTEEN_M = '13m';
    case SEVENTEEN_POINT_FIVE_M = '17.5m';
    case REFRIGERATED = 'refrigerated';

    public function label(): string
    {
        return match ($this) {
            self::FOUR_POINT_TWO_M => '4.2米',
            self::SIX_POINT_EIGHT_M => '6.8米',
            self::NINE_POINT_SIX_M => '9.6米',
            self::THIRTEEN_M => '13米',
            self::SEVENTEEN_POINT_FIVE_M => '17.5米',
            self::REFRIGERATED => '冷藏车',
        };
    }

    public function ratedLoad(): float
    {
        return match ($this) {
            self::FOUR_POINT_TWO_M => 2000,
            self::SIX_POINT_EIGHT_M => 6000,
            self::NINE_POINT_SIX_M => 10000,
            self::THIRTEEN_M => 20000,
            self::SEVENTEEN_POINT_FIVE_M => 30000,
            self::REFRIGERATED => 8000,
        };
    }
}
