<?php

namespace App\Support\Providers;

enum ProviderVerificationStatus: string
{
    case Unknown = 'unknown';
    case Pending = 'pending';
    case Healthy = 'healthy';
    case Degraded = 'degraded';
    case Blocked = 'blocked';
    case Error = 'error';

    /**
     * @return array<int, string>
     */
    public static function values(): array
    {
        return array_map(static fn (self $case): string => $case->value, self::cases());
    }

    public function isTerminal(): bool
    {
        return in_array($this, [self::Healthy, self::Degraded, self::Blocked, self::Error], true);
    }
}
