<?php

namespace MintyPHP\Service\Directory;

use MintyPHP\Service\Settings\SettingServicesFactory;
use MintyPHP\Service\Tenant\TenantScopeService;

class DirectoryGatewayFactory
{
    private ?DirectorySettingsGateway $directorySettingsGateway = null;
    public function __construct(
        private readonly SettingServicesFactory $settingServicesFactory,
        private readonly TenantScopeService $tenantScopeService
    ) {
    }

    public function createDirectorySettingsGateway(): DirectorySettingsGateway
    {
        return $this->directorySettingsGateway ??= new DirectorySettingsGateway(
            $this->settingServicesFactory->createSettingsDefaultsGateway()
        );
    }

    public function getTenantScopeService(): TenantScopeService
    {
        return $this->tenantScopeService;
    }
}
