Repo Interface für tests
This commit is contained in:
@@ -3,17 +3,17 @@
|
||||
namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\I18n;
|
||||
use MintyPHP\Repository\User\UserListQueryRepository;
|
||||
use MintyPHP\Repository\User\UserReadRepository;
|
||||
use MintyPHP\Repository\User\UserWriteRepository;
|
||||
use MintyPHP\Repository\User\UserListQueryRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserReadRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
|
||||
use MintyPHP\Service\Audit\SystemAuditService;
|
||||
|
||||
class UserAccountService
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserReadRepository $userReadRepository,
|
||||
private readonly UserWriteRepository $userWriteRepository,
|
||||
private readonly UserListQueryRepository $userListQueryRepository,
|
||||
private readonly UserReadRepositoryInterface $userReadRepository,
|
||||
private readonly UserWriteRepositoryInterface $userWriteRepository,
|
||||
private readonly UserListQueryRepositoryInterface $userListQueryRepository,
|
||||
private readonly UserAssignmentService $userAssignmentService,
|
||||
private readonly UserPasswordService $userPasswordService,
|
||||
private readonly UserSettingsGateway $settingsGateway,
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\Repository\Access\UserRoleRepository;
|
||||
use MintyPHP\Repository\Org\UserDepartmentRepository;
|
||||
use MintyPHP\Repository\Access\UserRoleRepositoryInterface;
|
||||
use MintyPHP\Repository\Org\UserDepartmentRepositoryInterface;
|
||||
use MintyPHP\Repository\Support\DatabaseSessionRepository;
|
||||
use MintyPHP\Repository\Tenant\UserTenantRepository;
|
||||
use MintyPHP\Repository\User\UserWriteRepository;
|
||||
use MintyPHP\Repository\Tenant\UserTenantRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
|
||||
|
||||
class UserAssignmentService
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserWriteRepository $userWriteRepository,
|
||||
private readonly UserTenantRepository $userTenantRepository,
|
||||
private readonly UserRoleRepository $userRoleRepository,
|
||||
private readonly UserDepartmentRepository $userDepartmentRepository,
|
||||
private readonly UserWriteRepositoryInterface $userWriteRepository,
|
||||
private readonly UserTenantRepositoryInterface $userTenantRepository,
|
||||
private readonly UserRoleRepositoryInterface $userRoleRepository,
|
||||
private readonly UserDepartmentRepositoryInterface $userDepartmentRepository,
|
||||
private readonly UserDirectoryGateway $directoryGateway,
|
||||
private readonly UserPermissionGateway $permissionGateway,
|
||||
private readonly DatabaseSessionRepository $databaseSessionRepository
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\Repository\Access\RoleRepository;
|
||||
use MintyPHP\Repository\Org\DepartmentRepository;
|
||||
use MintyPHP\Repository\Tenant\TenantRepository;
|
||||
use MintyPHP\Repository\Access\RoleRepositoryInterface;
|
||||
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
|
||||
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
|
||||
|
||||
class UserDirectoryGateway
|
||||
{
|
||||
@@ -63,17 +63,17 @@ class UserDirectoryGateway
|
||||
return $this->departmentRepository()->listByTenantIds($tenantIds);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -4,15 +4,15 @@ namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\Repository\Support\DatabaseSessionRepository;
|
||||
use MintyPHP\Repository\Support\RepoQuery;
|
||||
use MintyPHP\Repository\User\UserReadRepository;
|
||||
use MintyPHP\Repository\User\UserWriteRepository;
|
||||
use MintyPHP\Repository\User\UserReadRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
|
||||
use MintyPHP\Service\Audit\UserLifecycleAuditService;
|
||||
|
||||
class UserLifecycleRestoreService
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserReadRepository $userReadRepository,
|
||||
private readonly UserWriteRepository $userWriteRepository,
|
||||
private readonly UserReadRepositoryInterface $userReadRepository,
|
||||
private readonly UserWriteRepositoryInterface $userWriteRepository,
|
||||
private readonly UserLifecycleAuditService $userLifecycleAuditService,
|
||||
private readonly DatabaseSessionRepository $databaseSessionRepository
|
||||
) {
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\Repository\Support\DatabaseSessionRepository;
|
||||
use MintyPHP\Repository\Support\RepoQuery;
|
||||
use MintyPHP\Repository\User\UserReadRepository;
|
||||
use MintyPHP\Repository\User\UserWriteRepository;
|
||||
use MintyPHP\Repository\User\UserReadRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
|
||||
use MintyPHP\Service\Access\PermissionService;
|
||||
use MintyPHP\Service\Audit\UserLifecycleAuditService;
|
||||
|
||||
@@ -15,8 +15,8 @@ class UserLifecycleService
|
||||
private const BATCH_SIZE = 500;
|
||||
|
||||
public function __construct(
|
||||
private readonly UserReadRepository $userReadRepository,
|
||||
private readonly UserWriteRepository $userWriteRepository,
|
||||
private readonly UserReadRepositoryInterface $userReadRepository,
|
||||
private readonly UserWriteRepositoryInterface $userWriteRepository,
|
||||
private readonly UserSettingsGateway $settingsGateway,
|
||||
private readonly UserLifecycleAuditService $userLifecycleAuditService,
|
||||
private readonly DatabaseSessionRepository $databaseSessionRepository
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\Repository\User\UserWriteRepository;
|
||||
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
|
||||
|
||||
class UserPasswordService
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserPasswordPolicyService $passwordPolicyService,
|
||||
private readonly UserWriteRepository $userWriteRepository
|
||||
private readonly UserWriteRepositoryInterface $userWriteRepository
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -3,15 +3,25 @@
|
||||
namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\Repository\Access\RoleRepository;
|
||||
use MintyPHP\Repository\Access\RoleRepositoryInterface;
|
||||
use MintyPHP\Repository\Access\UserRoleRepository;
|
||||
use MintyPHP\Repository\Access\UserRoleRepositoryInterface;
|
||||
use MintyPHP\Repository\Org\DepartmentRepository;
|
||||
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
|
||||
use MintyPHP\Repository\Org\UserDepartmentRepository;
|
||||
use MintyPHP\Repository\Org\UserDepartmentRepositoryInterface;
|
||||
use MintyPHP\Repository\Tenant\TenantRepository;
|
||||
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
|
||||
use MintyPHP\Repository\Tenant\UserTenantRepository;
|
||||
use MintyPHP\Repository\Tenant\UserTenantRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserListQueryRepository;
|
||||
use MintyPHP\Repository\User\UserListQueryRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserReadRepository;
|
||||
use MintyPHP\Repository\User\UserReadRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserSavedFilterRepository;
|
||||
use MintyPHP\Repository\User\UserSavedFilterRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserWriteRepository;
|
||||
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
|
||||
|
||||
class UserRepositoryFactory
|
||||
{
|
||||
@@ -26,52 +36,52 @@ class UserRepositoryFactory
|
||||
private ?UserRoleRepository $userRoleRepository = null;
|
||||
private ?UserDepartmentRepository $userDepartmentRepository = null;
|
||||
|
||||
public function createUserReadRepository(): UserReadRepository
|
||||
public function createUserReadRepository(): UserReadRepositoryInterface
|
||||
{
|
||||
return $this->userReadRepository ??= new UserReadRepository();
|
||||
}
|
||||
|
||||
public function createUserWriteRepository(): UserWriteRepository
|
||||
public function createUserWriteRepository(): UserWriteRepositoryInterface
|
||||
{
|
||||
return $this->userWriteRepository ??= new UserWriteRepository();
|
||||
}
|
||||
|
||||
public function createUserListQueryRepository(): UserListQueryRepository
|
||||
public function createUserListQueryRepository(): UserListQueryRepositoryInterface
|
||||
{
|
||||
return $this->userListQueryRepository ??= new UserListQueryRepository();
|
||||
}
|
||||
|
||||
public function createUserSavedFilterRepository(): UserSavedFilterRepository
|
||||
public function createUserSavedFilterRepository(): UserSavedFilterRepositoryInterface
|
||||
{
|
||||
return $this->userSavedFilterRepository ??= new UserSavedFilterRepository();
|
||||
}
|
||||
|
||||
public function createTenantRepository(): TenantRepository
|
||||
public function createTenantRepository(): TenantRepositoryInterface
|
||||
{
|
||||
return $this->tenantRepository ??= new TenantRepository();
|
||||
}
|
||||
|
||||
public function createRoleRepository(): RoleRepository
|
||||
public function createRoleRepository(): RoleRepositoryInterface
|
||||
{
|
||||
return $this->roleRepository ??= new RoleRepository();
|
||||
}
|
||||
|
||||
public function createDepartmentRepository(): DepartmentRepository
|
||||
public function createDepartmentRepository(): DepartmentRepositoryInterface
|
||||
{
|
||||
return $this->departmentRepository ??= new DepartmentRepository();
|
||||
}
|
||||
|
||||
public function createUserTenantRepository(): UserTenantRepository
|
||||
public function createUserTenantRepository(): UserTenantRepositoryInterface
|
||||
{
|
||||
return $this->userTenantRepository ??= new UserTenantRepository();
|
||||
}
|
||||
|
||||
public function createUserRoleRepository(): UserRoleRepository
|
||||
public function createUserRoleRepository(): UserRoleRepositoryInterface
|
||||
{
|
||||
return $this->userRoleRepository ??= new UserRoleRepository();
|
||||
}
|
||||
|
||||
public function createUserDepartmentRepository(): UserDepartmentRepository
|
||||
public function createUserDepartmentRepository(): UserDepartmentRepositoryInterface
|
||||
{
|
||||
return $this->userDepartmentRepository ??= new UserDepartmentRepository();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\Repository\Support\RepoQuery;
|
||||
use MintyPHP\Repository\User\UserSavedFilterRepository;
|
||||
use MintyPHP\Repository\User\UserSavedFilterRepositoryInterface;
|
||||
|
||||
class UserSavedFilterService
|
||||
{
|
||||
@@ -12,7 +12,7 @@ class UserSavedFilterService
|
||||
private const SEARCH_MAX_LENGTH = 200;
|
||||
private const MAX_PER_USER_CONTEXT = 20;
|
||||
|
||||
public function __construct(private readonly UserSavedFilterRepository $userSavedFilterRepository)
|
||||
public function __construct(private readonly UserSavedFilterRepositoryInterface $userSavedFilterRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\Repository\Access\UserRoleRepository;
|
||||
use MintyPHP\Repository\Org\UserDepartmentRepository;
|
||||
use MintyPHP\Repository\Access\UserRoleRepositoryInterface;
|
||||
use MintyPHP\Repository\Org\UserDepartmentRepositoryInterface;
|
||||
use MintyPHP\Repository\Support\DatabaseSessionRepository;
|
||||
use MintyPHP\Repository\Tenant\UserTenantRepository;
|
||||
use MintyPHP\Repository\User\UserListQueryRepository;
|
||||
use MintyPHP\Repository\User\UserReadRepository;
|
||||
use MintyPHP\Repository\User\UserSavedFilterRepository;
|
||||
use MintyPHP\Repository\User\UserWriteRepository;
|
||||
use MintyPHP\Repository\Tenant\UserTenantRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserListQueryRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserReadRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserSavedFilterRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
|
||||
use MintyPHP\Service\Audit\AuditServicesFactory;
|
||||
use MintyPHP\Service\Audit\UserLifecycleAuditService;
|
||||
|
||||
@@ -92,37 +92,37 @@ class UserServicesFactory
|
||||
);
|
||||
}
|
||||
|
||||
public function createUserReadRepository(): UserReadRepository
|
||||
public function createUserReadRepository(): UserReadRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createUserReadRepository();
|
||||
}
|
||||
|
||||
public function createUserWriteRepository(): UserWriteRepository
|
||||
public function createUserWriteRepository(): UserWriteRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createUserWriteRepository();
|
||||
}
|
||||
|
||||
public function createUserListQueryRepository(): UserListQueryRepository
|
||||
public function createUserListQueryRepository(): UserListQueryRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createUserListQueryRepository();
|
||||
}
|
||||
|
||||
public function createUserSavedFilterRepository(): UserSavedFilterRepository
|
||||
public function createUserSavedFilterRepository(): UserSavedFilterRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createUserSavedFilterRepository();
|
||||
}
|
||||
|
||||
public function createUserTenantRepository(): UserTenantRepository
|
||||
public function createUserTenantRepository(): UserTenantRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createUserTenantRepository();
|
||||
}
|
||||
|
||||
public function createUserRoleRepository(): UserRoleRepository
|
||||
public function createUserRoleRepository(): UserRoleRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createUserRoleRepository();
|
||||
}
|
||||
|
||||
public function createUserDepartmentRepository(): UserDepartmentRepository
|
||||
public function createUserDepartmentRepository(): UserDepartmentRepositoryInterface
|
||||
{
|
||||
return $this->userRepositoryFactory->createUserDepartmentRepository();
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
namespace MintyPHP\Service\User;
|
||||
|
||||
use MintyPHP\Repository\Tenant\UserTenantRepository;
|
||||
use MintyPHP\Repository\User\UserReadRepository;
|
||||
use MintyPHP\Repository\User\UserWriteRepository;
|
||||
use MintyPHP\Repository\Tenant\UserTenantRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserReadRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
|
||||
|
||||
class UserTenantContextService
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserReadRepository $userReadRepository,
|
||||
private readonly UserWriteRepository $userWriteRepository,
|
||||
private readonly UserTenantRepository $userTenantRepository,
|
||||
private readonly UserReadRepositoryInterface $userReadRepository,
|
||||
private readonly UserWriteRepositoryInterface $userWriteRepository,
|
||||
private readonly UserTenantRepositoryInterface $userTenantRepository,
|
||||
private readonly UserScopeGateway $scopeGateway,
|
||||
private readonly UserDirectoryGateway $directoryGateway
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user