listen ansichten verbessert
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace MintyPHP\Service\Import;
|
||||
|
||||
use MintyPHP\Service\Access\PermissionService;
|
||||
use MintyPHP\Service\Access\PermissionGateway;
|
||||
use MintyPHP\Service\Access\PermissionService;
|
||||
use MintyPHP\Service\Audit\ImportAuditService;
|
||||
use MintyPHP\Service\Import\Profile\ImportProfileInterface;
|
||||
use MintyPHP\Service\Settings\SettingGateway;
|
||||
|
||||
@@ -13,7 +13,6 @@ 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
|
||||
@@ -30,10 +29,10 @@ class ImportServicesFactory
|
||||
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
|
||||
{
|
||||
@@ -45,7 +44,9 @@ class ImportServicesFactory
|
||||
'users' => new UserImportProfile(new UserImportGateway(
|
||||
$this->userServicesFactory->createUserReadRepository(),
|
||||
$this->userServicesFactory->createUserAccountService(),
|
||||
$this->userRepositoryFactory
|
||||
$this->directoryServicesFactory->createTenantRepository(),
|
||||
$this->directoryServicesFactory->createRoleRepository(),
|
||||
$this->directoryServicesFactory->createDepartmentRepository(),
|
||||
)),
|
||||
'departments' => new DepartmentImportProfile(new DepartmentImportGateway(
|
||||
$this->directoryServicesFactory->createDepartmentRepository(),
|
||||
|
||||
@@ -60,4 +60,3 @@ class ImportStateStoreService
|
||||
unset($_SESSION[self::SESSION_KEY][$token]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,14 +7,15 @@ use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
|
||||
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserReadRepositoryInterface;
|
||||
use MintyPHP\Service\User\UserAccountService;
|
||||
use MintyPHP\Service\User\UserRepositoryFactory;
|
||||
|
||||
class UserImportGateway
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserReadRepositoryInterface $userReadRepository,
|
||||
private readonly UserAccountService $userAccountService,
|
||||
private readonly UserRepositoryFactory $userRepositoryFactory
|
||||
private readonly TenantRepositoryInterface $tenantRepository,
|
||||
private readonly RoleRepositoryInterface $roleRepository,
|
||||
private readonly DepartmentRepositoryInterface $departmentRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -25,32 +26,32 @@ class UserImportGateway
|
||||
|
||||
public function findTenantByUuid(string $uuid): ?array
|
||||
{
|
||||
return $this->tenantRepository()->findByUuid($uuid);
|
||||
return $this->tenantRepository->findByUuid($uuid);
|
||||
}
|
||||
|
||||
public function findTenantById(int $id): ?array
|
||||
{
|
||||
return $this->tenantRepository()->find($id);
|
||||
return $this->tenantRepository->find($id);
|
||||
}
|
||||
|
||||
public function findRoleByUuid(string $uuid): ?array
|
||||
{
|
||||
return $this->roleRepository()->findByUuid($uuid);
|
||||
return $this->roleRepository->findByUuid($uuid);
|
||||
}
|
||||
|
||||
public function findRoleById(int $id): ?array
|
||||
{
|
||||
return $this->roleRepository()->find($id);
|
||||
return $this->roleRepository->find($id);
|
||||
}
|
||||
|
||||
public function findDepartmentByUuid(string $uuid): ?array
|
||||
{
|
||||
return $this->departmentRepository()->findByUuid($uuid);
|
||||
return $this->departmentRepository->findByUuid($uuid);
|
||||
}
|
||||
|
||||
public function findDepartmentById(int $id): ?array
|
||||
{
|
||||
return $this->departmentRepository()->find($id);
|
||||
return $this->departmentRepository->find($id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,19 +62,4 @@ class UserImportGateway
|
||||
{
|
||||
return $this->userAccountService->createFromAdmin($input, $currentUserId);
|
||||
}
|
||||
|
||||
private function tenantRepository(): TenantRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createTenantRepository();
|
||||
}
|
||||
|
||||
private function roleRepository(): RoleRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createRoleRepository();
|
||||
}
|
||||
|
||||
private function departmentRepository(): DepartmentRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createDepartmentRepository();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user