<?php

namespace App\Enums;

enum FuelType: string
{
    case E10 = 'e10';
    case E5 = 'e5';
    case B7Standard = 'b7_standard';
    case B7Premium = 'b7_premium';
    case B10 = 'b10';
    case Hvo = 'hvo';

    public function label(): string
    {
        return match ($this) {
            self::E10 => 'Petrol (E10)',
            self::E5 => 'Premium (E5)',
            self::B7Standard => 'Diesel (B7)',
            self::B7Premium => 'Prem Diesel',
            self::B10 => 'Diesel (B10)',
            self::Hvo => 'HVO',
        };
    }

    public static function fromApiValue(string $value): self
    {
        return self::from(strtolower($value));
    }
}
