<?php

namespace App\Support;

final class StaffAdvanceQuantityMode
{
    public const PACK = 'pack';

    public const WEIGHT = 'weight';

    /**
     * @return list<string>
     */
    public static function values(): array
    {
        return [
            self::PACK,
            self::WEIGHT,
        ];
    }

    public static function normalize(?string $mode): string
    {
        return in_array($mode, self::values(), true) ? $mode : self::WEIGHT;
    }

    public static function isPack(?string $mode): bool
    {
        return self::normalize($mode) === self::PACK;
    }
}
