<?php

namespace App\Enums;

enum OrderType: string
{
    case Dispatch = 'dispatch';
    case Reshipment = 'reshipment';

    public function label(): string
    {
        return match ($this) {
            self::Dispatch => 'Orden de Despacho',
            self::Reshipment => 'Redespacho',
        };
    }

    /** @return array<string, string> */
    public static function options(): array
    {
        $options = [];
        foreach (self::cases() as $case) {
            $options[$case->value] = $case->label();
        }

        return $options;
    }
}
