55 lines
1.5 KiB
PHP
55 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace MintyPHP\Service\Import\Profile;
|
|
|
|
use MintyPHP\Repository\Access\RoleRepositoryInterface;
|
|
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
|
|
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
|
|
use MintyPHP\Repository\User\UserReadRepositoryInterface;
|
|
|
|
class UserImportGateway
|
|
{
|
|
public function __construct(
|
|
private readonly UserReadRepositoryInterface $userReadRepository,
|
|
private readonly TenantRepositoryInterface $tenantRepository,
|
|
private readonly RoleRepositoryInterface $roleRepository,
|
|
private readonly DepartmentRepositoryInterface $departmentRepository,
|
|
) {
|
|
}
|
|
|
|
public function findUserByEmail(string $email): ?array
|
|
{
|
|
return $this->userReadRepository->findByEmail($email);
|
|
}
|
|
|
|
public function findTenantByUuid(string $uuid): ?array
|
|
{
|
|
return $this->tenantRepository->findByUuid($uuid);
|
|
}
|
|
|
|
public function findTenantById(int $id): ?array
|
|
{
|
|
return $this->tenantRepository->find($id);
|
|
}
|
|
|
|
public function findRoleByUuid(string $uuid): ?array
|
|
{
|
|
return $this->roleRepository->findByUuid($uuid);
|
|
}
|
|
|
|
public function findRoleById(int $id): ?array
|
|
{
|
|
return $this->roleRepository->find($id);
|
|
}
|
|
|
|
public function findDepartmentByUuid(string $uuid): ?array
|
|
{
|
|
return $this->departmentRepository->findByUuid($uuid);
|
|
}
|
|
|
|
public function findDepartmentById(int $id): ?array
|
|
{
|
|
return $this->departmentRepository->find($id);
|
|
}
|
|
}
|