<?php

declare(strict_types=1);

namespace App\Framework\Config;

use App\Framework\DateTime\Timezone;

final readonly class AppConfig
{
    public function __construct(
        public string $name = 'Framework App',
        public string $version = '1.0.0',
        public string $environment = 'production',
        public bool $debug = false,
        public Timezone $timezone = Timezone::EuropeBerlin,
        public string $locale = 'en',
        public EnvironmentType $type = EnvironmentType::DEV
    ) {
    }

    public function isProduction(): bool
    {
        return $this->type->isProduction();
    }

    public function isDevelopment(): bool
    {
        return $this->type->isDevelopment();
    }

    public function isStaging(): bool
    {
        return $this->type->isStaging();
    }

    public function isProductionLike(): bool
    {
        return $this->type->isProductionLike();
    }

    public function isDebugEnabled(): bool
    {
        return $this->debug || $this->type->isDebugEnabled();
    }
}
