<?php

declare(strict_types=1);

namespace App\Framework\Deployment\Pipeline\ValueObjects;

/**
 * Deployment Environment
 *
 * Represents the target environment for deployment.
 */
enum DeploymentEnvironment: string
{
    case DEVELOPMENT = 'development';
    case STAGING = 'staging';
    case PRODUCTION = 'production';

    public function getDisplayName(): string
    {
        return match ($this) {
            self::DEVELOPMENT => 'Development',
            self::STAGING => 'Staging',
            self::PRODUCTION => 'Production',
        };
    }

    public function requiresBackup(): bool
    {
        return match ($this) {
            self::PRODUCTION, self::STAGING => true,
            self::DEVELOPMENT => false,
        };
    }

    public function requiresApproval(): bool
    {
        return $this === self::PRODUCTION;
    }

    public function isProduction(): bool
    {
        return $this === self::PRODUCTION;
    }
}
