<?php

namespace App\Domains\Shared\Enums;

enum FieldType: string
{
    case String = 'string';
    case Number = 'number';
    case Boolean = 'boolean';
    case Select = 'select';
    case Multiselect = 'multiselect';
    case Color = 'color';
    case Image = 'image';
    case EventDate = 'event_date';

    public function supportsOptions(): bool
    {
        return in_array($this, [self::Select, self::Multiselect, self::EventDate], true);
    }

    public function usesDynamicOptions(): bool
    {
        return $this === self::EventDate;
    }

    /**
     * @return list<string>
     */
    public static function values(): array
    {
        return array_column(self::cases(), 'value');
    }
}
