<?php

namespace App\Support;

class SaleLineQuantityMode
{
    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::PACK;
    }
}
