<?php

namespace MintyPHP\Service\CustomField;

use MintyPHP\Repository\CustomField\TenantCustomFieldDefinitionRepository;
use MintyPHP\Repository\CustomField\TenantCustomFieldDefinitionRepositoryInterface;
use MintyPHP\Repository\CustomField\TenantCustomFieldOptionRepository;
use MintyPHP\Repository\CustomField\TenantCustomFieldOptionRepositoryInterface;
use MintyPHP\Repository\CustomField\UserCustomFieldValueOptionRepository;
use MintyPHP\Repository\CustomField\UserCustomFieldValueOptionRepositoryInterface;
use MintyPHP\Repository\CustomField\UserCustomFieldValueRepository;
use MintyPHP\Repository\CustomField\UserCustomFieldValueRepositoryInterface;

class CustomFieldRepositoryFactory
{
    private ?TenantCustomFieldDefinitionRepository $tenantCustomFieldDefinitionRepository = null;
    private ?TenantCustomFieldOptionRepository $tenantCustomFieldOptionRepository = null;
    private ?UserCustomFieldValueRepository $userCustomFieldValueRepository = null;
    private ?UserCustomFieldValueOptionRepository $userCustomFieldValueOptionRepository = null;

    public function createTenantCustomFieldDefinitionRepository(): TenantCustomFieldDefinitionRepositoryInterface
    {
        return $this->tenantCustomFieldDefinitionRepository ??= new TenantCustomFieldDefinitionRepository();
    }

    public function createTenantCustomFieldOptionRepository(): TenantCustomFieldOptionRepositoryInterface
    {
        return $this->tenantCustomFieldOptionRepository ??= new TenantCustomFieldOptionRepository();
    }

    public function createUserCustomFieldValueRepository(): UserCustomFieldValueRepositoryInterface
    {
        return $this->userCustomFieldValueRepository ??= new UserCustomFieldValueRepository();
    }

    public function createUserCustomFieldValueOptionRepository(): UserCustomFieldValueOptionRepositoryInterface
    {
        return $this->userCustomFieldValueOptionRepository ??= new UserCustomFieldValueOptionRepository();
    }
}
