<?php

declare(strict_types=1);

namespace PpPhp\Core\Platform\Metadata\ValueObjects;

final class PlatformCategory
{
    public const COMPONENT = 'component';
    public const LAYOUT = 'layout';
    public const WIDGET = 'widget';
    public const PAGE = 'page';
    public const PRESET = 'preset';
    public const THEME = 'theme';
    public const WORKFLOW = 'workflow';
    public const MODULE = 'module';
    public const PLUGIN = 'plugin';
    public const SERVICE = 'service';
    public const API = 'api';
    public const REPORT = 'report';
    public const DASHBOARD = 'dashboard';
    public const OTHER = 'other';

    private function __construct() {}

    public static function all(): array
    {
        return [
            self::COMPONENT,
            self::LAYOUT,
            self::WIDGET,
            self::PAGE,
            self::PRESET,
            self::THEME,
            self::WORKFLOW,
            self::MODULE,
            self::PLUGIN,
            self::SERVICE,
            self::API,
            self::REPORT,
            self::DASHBOARD,
            self::OTHER,
        ];
    }

    public static function isValid(string $category): bool
    {
        return in_array($category, self::all(), true);
    }
}
