listen ansichten verbessert

This commit is contained in:
2026-03-05 11:17:42 +01:00
parent 4b31fc7664
commit c5f657c8c8
133 changed files with 2806 additions and 636 deletions

View File

@@ -9,72 +9,59 @@ use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
class UserDirectoryGateway
{
public function __construct(
private readonly UserRepositoryFactory $userRepositoryFactory
private readonly TenantRepositoryInterface $tenantRepository,
private readonly RoleRepositoryInterface $roleRepository,
private readonly DepartmentRepositoryInterface $departmentRepository,
) {
}
public function listTenantIds(): array
{
return $this->tenantRepository()->listIds();
return $this->tenantRepository->listIds();
}
public function listTenantsByIds(array $tenantIds): array
{
return $this->tenantRepository()->listByIds($tenantIds);
return $this->tenantRepository->listByIds($tenantIds);
}
public function findTenant(int $tenantId): ?array
{
return $this->tenantRepository()->find($tenantId);
return $this->tenantRepository->find($tenantId);
}
public function findTenantByUuid(string $tenantUuid): ?array
{
return $this->tenantRepository()->findByUuid($tenantUuid);
return $this->tenantRepository->findByUuid($tenantUuid);
}
public function listActiveTenantIdsByIds(array $tenantIds): array
{
return $this->tenantRepository()->listActiveIdsByIds($tenantIds);
return $this->tenantRepository->listActiveIdsByIds($tenantIds);
}
public function listActiveRoleIds(): array
{
return $this->roleRepository()->listActiveIds();
return $this->roleRepository->listActiveIds();
}
public function listRolesByIds(array $roleIds): array
{
return $this->roleRepository()->listByIds($roleIds);
return $this->roleRepository->listByIds($roleIds);
}
public function listDepartmentsByIds(array $departmentIds, bool $includeInactive = true): array
{
return $this->departmentRepository()->listByIds($departmentIds, $includeInactive);
return $this->departmentRepository->listByIds($departmentIds, $includeInactive);
}
public function listActiveDepartmentIdsByTenantIds(array $tenantIds): array
{
return $this->departmentRepository()->listActiveIdsByTenantIds($tenantIds);
return $this->departmentRepository->listActiveIdsByTenantIds($tenantIds);
}
public function listDepartmentsByTenantIds(array $tenantIds): array
{
return $this->departmentRepository()->listByTenantIds($tenantIds);
}
private function tenantRepository(): TenantRepositoryInterface
{
return $this->userRepositoryFactory->createTenantRepository();
}
private function roleRepository(): RoleRepositoryInterface
{
return $this->userRepositoryFactory->createRoleRepository();
}
private function departmentRepository(): DepartmentRepositoryInterface
{
return $this->userRepositoryFactory->createDepartmentRepository();
return $this->departmentRepository->listByTenantIds($tenantIds);
}
}