<?php

declare(strict_types=1);

namespace App\Framework\Process\ValueObjects\Health;

/**
 * System Health Status.
 */
enum HealthStatus: string
{
    case HEALTHY = 'healthy';
    case DEGRADED = 'degraded';
    case UNHEALTHY = 'unhealthy';

    /**
     * Gibt eine menschenlesbare Beschreibung zurück.
     */
    public function getDescription(): string
    {
        return match ($this) {
            self::HEALTHY => 'System is operating normally',
            self::DEGRADED => 'System is experiencing issues but operational',
            self::UNHEALTHY => 'System has critical issues',
        };
    }

    /**
     * Gibt ein Icon für den Status zurück.
     */
    public function getIcon(): string
    {
        return match ($this) {
            self::HEALTHY => '✅',
            self::DEGRADED => '⚠️',
            self::UNHEALTHY => '❌',
        };
    }

    /**
     * Prüft, ob der Status gesund ist.
     */
    public function isHealthy(): bool
    {
        return $this === self::HEALTHY;
    }

    /**
     * Prüft, ob der Status degraded ist.
     */
    public function isDegraded(): bool
    {
        return $this === self::DEGRADED;
    }

    /**
     * Prüft, ob der Status ungesund ist.
     */
    public function isUnhealthy(): bool
    {
        return $this === self::UNHEALTHY;
    }
}
