<?php
namespace Incoviba\Model\Venta\Reservation\State;

enum Type: int
{
    case ACTIVE = 1;
    case INACTIVE = 0;
    case REJECTED = -1;

    public static function name(int $type): string
    {
        return match ($type) {
            self::ACTIVE => 'active',
            self::INACTIVE => 'inactive',
            self::REJECTED => 'rejected',
            default => throw new \InvalidArgumentException('Unexpected match value')
        };
    }
}