<?php

namespace App\DTO\Settings;

final class ConfigDTO
{
    private AppDTO $app;
    private TelegramDTO $telegram;
    private MetricsDTO $metrics;
    private StoreDTO $store;
    private OrdersDTO $orders;
    private TextsDTO $texts;
    private DatabaseDTO $database;
    private LogsDTO $logs;

    public function __construct(
        AppDTO $app,
        TelegramDTO $telegram,
        MetricsDTO $metrics,
        StoreDTO $store,
        OrdersDTO $orders,
        TextsDTO $texts,
        DatabaseDTO $database,
        LogsDTO $logs
    ) {
        $this->app = $app;
        $this->telegram = $telegram;
        $this->metrics = $metrics;
        $this->store = $store;
        $this->orders = $orders;
        $this->texts = $texts;
        $this->database = $database;
        $this->logs = $logs;
    }

    public function getApp(): AppDTO
    {
        return $this->app;
    }

    public function getTelegram(): TelegramDTO
    {
        return $this->telegram;
    }

    public function getMetrics(): MetricsDTO
    {
        return $this->metrics;
    }

    public function getStore(): StoreDTO
    {
        return $this->store;
    }

    public function getOrders(): OrdersDTO
    {
        return $this->orders;
    }

    public function getTexts(): TextsDTO
    {
        return $this->texts;
    }

    public function getDatabase(): DatabaseDTO
    {
        return $this->database;
    }

    public function getLogs(): LogsDTO
    {
        return $this->logs;
    }

    public function toArray(): array
    {
        return [
            'app' => $this->app->toArray(),
            'database' => $this->database->toArray(),
            'logs' => $this->logs->toArray(),
            'metrics' => $this->metrics->toArray(),
            'orders' => $this->orders->toArray(),
            'store' => $this->store->toArray(),
            'telegram' => $this->telegram->toArray(),
            'texts' => $this->texts->toArray(),
        ];
    }
}
