<?php

declare(strict_types=1);

namespace apexl\Io\modules\tabulator\Enums;

use apexl\Io\modules\tabulator\Interfaces\TabulatorFilterTypeInterface;
use JsonSerializable;

enum TabulatorHeaderFilterType implements JsonSerializable, TabulatorFilterTypeInterface
{

    case INPUT;
    case DATE;
    case TICK_CROSS;
    case NUMBER;
    case LIST;
    case SELECT;
    case MIN_MAX;
    case MIN_MAX_DATE;
    case MONEY;
    case MIN_MAX_MONEY;
    case CREATOR;
    case MODIFIER;

    public function jsonSerialize(): string
    {
        return $this->asString();
    }

    public function asString(): string
    {
        return match (true) {
            ($this === self::TICK_CROSS) => 'tickCross',
            default => strtolower($this->name),
        };
    }
}
