Repo Interface für tests
This commit is contained in:
@@ -3,12 +3,13 @@
|
||||
namespace MintyPHP\Service\Import;
|
||||
|
||||
use MintyPHP\Repository\Audit\ImportAuditRunRepository;
|
||||
use MintyPHP\Repository\Audit\ImportAuditRunRepositoryInterface;
|
||||
|
||||
class ImportRepositoryFactory
|
||||
{
|
||||
private ?ImportAuditRunRepository $importAuditRunRepository = null;
|
||||
|
||||
public function createImportAuditRunRepository(): ImportAuditRunRepository
|
||||
public function createImportAuditRunRepository(): ImportAuditRunRepositoryInterface
|
||||
{
|
||||
return $this->importAuditRunRepository ??= new ImportAuditRunRepository();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace MintyPHP\Service\Import;
|
||||
|
||||
use MintyPHP\Repository\Audit\ImportAuditRunRepository;
|
||||
use MintyPHP\Repository\Audit\ImportAuditRunRepositoryInterface;
|
||||
use MintyPHP\Service\Access\AccessServicesFactory;
|
||||
use MintyPHP\Service\Access\PermissionGateway;
|
||||
use MintyPHP\Service\Audit\ImportAuditService;
|
||||
@@ -86,7 +86,7 @@ class ImportServicesFactory
|
||||
return $this->importTempFileService ??= new ImportTempFileService();
|
||||
}
|
||||
|
||||
private function getImportAuditRunRepository(): ImportAuditRunRepository
|
||||
private function getImportAuditRunRepository(): ImportAuditRunRepositoryInterface
|
||||
{
|
||||
return $this->importRepositoryFactory->createImportAuditRunRepository();
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
namespace MintyPHP\Service\Import\Profile;
|
||||
|
||||
use MintyPHP\Repository\Org\DepartmentRepository;
|
||||
use MintyPHP\Repository\Tenant\TenantRepository;
|
||||
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
|
||||
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
|
||||
use MintyPHP\Service\Org\DepartmentService;
|
||||
|
||||
class DepartmentImportGateway
|
||||
{
|
||||
public function __construct(
|
||||
private readonly DepartmentRepository $departmentRepository,
|
||||
private readonly TenantRepository $tenantRepository,
|
||||
private readonly DepartmentRepositoryInterface $departmentRepository,
|
||||
private readonly TenantRepositoryInterface $tenantRepository,
|
||||
private readonly DepartmentService $departmentService
|
||||
) {
|
||||
}
|
||||
@@ -44,12 +44,12 @@ class DepartmentImportGateway
|
||||
return $this->departmentService()->createFromAdmin($input, $currentUserId);
|
||||
}
|
||||
|
||||
private function departmentRepository(): DepartmentRepository
|
||||
private function departmentRepository(): DepartmentRepositoryInterface
|
||||
{
|
||||
return $this->departmentRepository;
|
||||
}
|
||||
|
||||
private function tenantRepository(): TenantRepository
|
||||
private function tenantRepository(): TenantRepositoryInterface
|
||||
{
|
||||
return $this->tenantRepository;
|
||||
}
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
namespace MintyPHP\Service\Import\Profile;
|
||||
|
||||
use MintyPHP\Repository\Access\RoleRepository;
|
||||
use MintyPHP\Repository\Org\DepartmentRepository;
|
||||
use MintyPHP\Repository\Tenant\TenantRepository;
|
||||
use MintyPHP\Repository\User\UserReadRepository;
|
||||
use MintyPHP\Repository\Access\RoleRepositoryInterface;
|
||||
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 UserReadRepository $userReadRepository,
|
||||
private readonly UserReadRepositoryInterface $userReadRepository,
|
||||
private readonly UserAccountService $userAccountService,
|
||||
private readonly UserRepositoryFactory $userRepositoryFactory
|
||||
) {
|
||||
@@ -62,17 +62,17 @@ class UserImportGateway
|
||||
return $this->userAccountService->createFromAdmin($input, $currentUserId);
|
||||
}
|
||||
|
||||
private function tenantRepository(): TenantRepository
|
||||
private function tenantRepository(): TenantRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createTenantRepository();
|
||||
}
|
||||
|
||||
private function roleRepository(): RoleRepository
|
||||
private function roleRepository(): RoleRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createRoleRepository();
|
||||
}
|
||||
|
||||
private function departmentRepository(): DepartmentRepository
|
||||
private function departmentRepository(): DepartmentRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createDepartmentRepository();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user