<?php

declare(strict_types=1);

namespace App\Support\References;

enum ReferenceResolutionState: string
{
    case Resolved = 'resolved';
    case PartiallyResolved = 'partially_resolved';
    case Unresolved = 'unresolved';
    case DeletedOrMissing = 'deleted_or_missing';
    case Inaccessible = 'inaccessible';
    case ExternalLimitedContext = 'external_limited_context';

    public function isDegraded(): bool
    {
        return $this !== self::Resolved;
    }

    public function isLinkable(): bool
    {
        return $this === self::Resolved || $this === self::PartiallyResolved;
    }
}
