<?php

namespace App\DTO\Settings;

final class AppDTO
{
    private bool $appEnabled;
    private string $appName;
    private ?string $appIcon;
    private string $themeLight;
    private string $themeDark;
    private bool $appDebug;
    private int $languageId;
    private string $shopBaseUrl;
    private bool $hapticEnabled;

    public function __construct(
        bool $appEnabled,
        string $appName,
        ?string $appIcon,
        string $themeLight,
        string $themeDark,
        bool $appDebug,
        int $languageId,
        string $shopBaseUrl,
        bool $hapticEnabled = true
    ) {
        $this->appEnabled = $appEnabled;
        $this->appName = $appName;
        $this->appIcon = $appIcon;
        $this->themeLight = $themeLight;
        $this->themeDark = $themeDark;
        $this->appDebug = $appDebug;
        $this->languageId = $languageId;
        $this->shopBaseUrl = $shopBaseUrl;
        $this->hapticEnabled = $hapticEnabled;
    }

    public function isAppEnabled(): bool
    {
        return $this->appEnabled;
    }

    public function getAppName(): string
    {
        return $this->appName;
    }

    public function getAppIcon(): ?string
    {
        return $this->appIcon;
    }

    public function getThemeLight(): string
    {
        return $this->themeLight;
    }

    public function getThemeDark(): string
    {
        return $this->themeDark;
    }

    public function isAppDebug(): bool
    {
        return $this->appDebug;
    }

    public function getLanguageId(): int
    {
        return $this->languageId;
    }

    public function getShopBaseUrl(): string
    {
        return $this->shopBaseUrl;
    }

    public function isHapticEnabled(): bool
    {
        return $this->hapticEnabled;
    }

    public function toArray(): array
    {
        return [
            'app_enabled' => $this->isAppEnabled(),
            'app_name' => $this->getAppName(),
            'app_icon' => $this->getAppIcon(),
            'theme_light' => $this->getThemeLight(),
            'theme_dark' => $this->getThemeDark(),
            'app_debug' => $this->isAppDebug(),
            'language_id' => $this->getLanguageId(),
            'shop_base_url' => $this->getShopBaseUrl(),
            'haptic_enabled' => $this->isHapticEnabled(),
        ];
    }
}
