<?php

declare(strict_types=1);

namespace App\Support\Providers\Capabilities;

enum ProviderCapabilityStatus: string
{
    case Supported = 'supported';
    case Missing = 'missing';
    case Blocked = 'blocked';
    case Unknown = 'unknown';
    case NotApplicable = 'not_applicable';

    public function blocksExecution(): bool
    {
        return match ($this) {
            self::Supported, self::NotApplicable => false,
            self::Missing, self::Blocked, self::Unknown => true,
        };
    }

    public function priority(): int
    {
        return match ($this) {
            self::Blocked => 0,
            self::Missing => 1,
            self::Unknown => 2,
            self::Supported => 3,
            self::NotApplicable => 4,
        };
    }
}
