<?php

declare(strict_types=1);

namespace App\Framework\Config\ValueObjects;

/**
 * Enum representing security risk levels
 */
enum SecurityRiskLevel: string
{
    case LOW = 'low';
    case MEDIUM = 'medium';
    case HIGH = 'high';
    case CRITICAL = 'critical';

    /**
     * Get human-readable name
     */
    public function getDisplayName(): string
    {
        return match ($this) {
            self::LOW => 'Low Risk',
            self::MEDIUM => 'Medium Risk',
            self::HIGH => 'High Risk',
            self::CRITICAL => 'Critical Risk',
        };
    }

    /**
     * Check if this risk level requires immediate action
     */
    public function requiresImmediateAction(): bool
    {
        return match ($this) {
            self::LOW, self::MEDIUM => false,
            self::HIGH, self::CRITICAL => true,
        };
    }

    /**
     * Get numeric priority for sorting
     */
    public function getPriority(): int
    {
        return match ($this) {
            self::LOW => 1,
            self::MEDIUM => 2,
            self::HIGH => 3,
            self::CRITICAL => 4,
        };
    }
}
