<?php

declare(strict_types=1);

namespace App\Support\Operations;

enum ExecutionDenialClass: string
{
    case ScopeDenied = 'scope_denied';
    case CapabilityDenied = 'capability_denied';
    case TenantNotOperable = 'tenant_not_operable';
    case PrerequisiteInvalid = 'prerequisite_invalid';
    case InitiatorInvalid = 'initiator_invalid';

    public function isRetryable(): bool
    {
        return match ($this) {
            self::TenantNotOperable, self::PrerequisiteInvalid => true,
            self::ScopeDenied, self::CapabilityDenied, self::InitiatorInvalid => false,
        };
    }
}
