<?php

namespace MintyPHP\Service\Directory;

use MintyPHP\Repository\Access\RoleRepository;
use MintyPHP\Repository\Access\RoleRepositoryInterface;
use MintyPHP\Repository\Org\DepartmentRepository;
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
use MintyPHP\Repository\Tenant\TenantRepository;
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;

class DirectoryRepositoryFactory
{
    private ?TenantRepository $tenantRepository = null;
    private ?DepartmentRepository $departmentRepository = null;
    private ?RoleRepository $roleRepository = null;

    public function createTenantRepository(): TenantRepositoryInterface
    {
        return $this->tenantRepository ??= new TenantRepository();
    }

    public function createDepartmentRepository(): DepartmentRepositoryInterface
    {
        return $this->departmentRepository ??= new DepartmentRepository();
    }

    public function createRoleRepository(): RoleRepositoryInterface
    {
        return $this->roleRepository ??= new RoleRepository();
    }
}
