major update

This commit is contained in:
2026-03-04 15:56:58 +01:00
parent 16759a2732
commit 8f4dd5840d
478 changed files with 24313 additions and 8201 deletions

View File

@@ -6,27 +6,34 @@ use MintyPHP\Repository\Audit\ImportAuditRunRepository;
use MintyPHP\Service\Access\AccessServicesFactory;
use MintyPHP\Service\Access\PermissionGateway;
use MintyPHP\Service\Audit\ImportAuditService;
use MintyPHP\Service\Directory\DirectoryServicesFactory;
use MintyPHP\Service\Import\Profile\DepartmentImportGateway;
use MintyPHP\Service\Import\Profile\DepartmentImportProfile;
use MintyPHP\Service\Import\Profile\UserImportGateway;
use MintyPHP\Service\Import\Profile\UserImportProfile;
use MintyPHP\Service\Settings\SettingGateway;
use MintyPHP\Service\Settings\SettingServicesFactory;
use MintyPHP\Service\User\UserRepositoryFactory;
use MintyPHP\Service\User\UserServicesFactory;
class ImportServicesFactory
{
private ?AccessServicesFactory $accessServicesFactory = null;
private ?CsvReaderService $csvReaderService = null;
private ?ImportTempFileService $importTempFileService = null;
private ?ImportStateStoreService $importStateStoreService = null;
private ?ImportAuditRunRepository $importAuditRunRepository = null;
private ?ImportAuditService $importAuditService = null;
private ?PermissionGateway $permissionGateway = null;
private ?SettingServicesFactory $settingServicesFactory = null;
private ?SettingGateway $settingGateway = null;
private ?ImportService $importService = null;
private ?UserServicesFactory $userServicesFactory = null;
public function __construct(
private readonly UserServicesFactory $userServicesFactory,
private readonly AccessServicesFactory $accessServicesFactory,
private readonly SettingServicesFactory $settingServicesFactory,
private readonly UserRepositoryFactory $userRepositoryFactory,
private readonly DirectoryServicesFactory $directoryServicesFactory,
private readonly ImportRepositoryFactory $importRepositoryFactory
) {}
public function createImportService(): ImportService
{
@@ -36,10 +43,15 @@ class ImportServicesFactory
$profiles = [
'users' => new UserImportProfile(new UserImportGateway(
$this->getUserServicesFactory()->createUserReadRepository(),
$this->getUserServicesFactory()->createUserAccountService()
$this->userServicesFactory->createUserReadRepository(),
$this->userServicesFactory->createUserAccountService(),
$this->userRepositoryFactory
)),
'departments' => new DepartmentImportProfile(new DepartmentImportGateway(
$this->directoryServicesFactory->createDepartmentRepository(),
$this->directoryServicesFactory->createTenantRepository(),
$this->directoryServicesFactory->createDepartmentService()
)),
'departments' => new DepartmentImportProfile(new DepartmentImportGateway()),
];
return $this->importService = new ImportService(
@@ -50,7 +62,7 @@ class ImportServicesFactory
$profiles,
$this->createPermissionGateway(),
$this->createSettingGateway(),
$this->getUserServicesFactory()->createUserScopeGateway()
$this->userServicesFactory->createUserScopeGateway()
);
}
@@ -76,31 +88,16 @@ class ImportServicesFactory
private function getImportAuditRunRepository(): ImportAuditRunRepository
{
return $this->importAuditRunRepository ??= new ImportAuditRunRepository();
}
private function getUserServicesFactory(): UserServicesFactory
{
return $this->userServicesFactory ??= new UserServicesFactory();
return $this->importRepositoryFactory->createImportAuditRunRepository();
}
private function createPermissionGateway(): PermissionGateway
{
return $this->permissionGateway ??= $this->accessServicesFactory()->createPermissionGateway();
}
private function accessServicesFactory(): AccessServicesFactory
{
return $this->accessServicesFactory ??= new AccessServicesFactory();
return $this->permissionGateway ??= $this->accessServicesFactory->createPermissionGateway();
}
private function createSettingGateway(): SettingGateway
{
return $this->settingGateway ??= $this->settingServicesFactory()->createSettingGateway();
}
private function settingServicesFactory(): SettingServicesFactory
{
return $this->settingServicesFactory ??= new SettingServicesFactory();
return $this->settingGateway ??= $this->settingServicesFactory->createSettingGateway();
}
}