From f9de09570f61fd4a2930ef1233db96afdbdd4b57 Mon Sep 17 00:00:00 2001 From: wolfganggreschus Date: Thu, 16 Nov 2023 11:57:01 +0100 Subject: [PATCH] DashboardRepoInterface -> IDashboardRepo --- .../learnroom/controller/api-test/dashboard.api.spec.ts | 4 ++-- apps/server/src/modules/learnroom/uc/dashboard.uc.spec.ts | 4 ++-- apps/server/src/modules/learnroom/uc/dashboard.uc.ts | 4 ++-- apps/server/src/shared/repo/dashboard/dashboard.repo.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/server/src/modules/learnroom/controller/api-test/dashboard.api.spec.ts b/apps/server/src/modules/learnroom/controller/api-test/dashboard.api.spec.ts index 18a9cc28acf..be9b9fad583 100644 --- a/apps/server/src/modules/learnroom/controller/api-test/dashboard.api.spec.ts +++ b/apps/server/src/modules/learnroom/controller/api-test/dashboard.api.spec.ts @@ -6,7 +6,7 @@ import { ServerTestModule } from '@modules/server/server.module'; import { ExecutionContext, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { DashboardEntity, GridElement, Permission, RoleName, User } from '@shared/domain'; -import { DashboardRepoInterface } from '@shared/repo'; +import { IDashboardRepo } from '@shared/repo'; import { courseFactory, mapUserToCurrentUser, roleFactory, userFactory } from '@shared/testing'; import { Request } from 'express'; import request from 'supertest'; @@ -14,7 +14,7 @@ import request from 'supertest'; describe('Dashboard Controller (API)', () => { let app: INestApplication; let em: EntityManager; - let dashboardRepo: DashboardRepoInterface; + let dashboardRepo: IDashboardRepo; let currentUser: ICurrentUser; beforeAll(async () => { diff --git a/apps/server/src/modules/learnroom/uc/dashboard.uc.spec.ts b/apps/server/src/modules/learnroom/uc/dashboard.uc.spec.ts index 5f359cf2ee9..309e139b7cd 100644 --- a/apps/server/src/modules/learnroom/uc/dashboard.uc.spec.ts +++ b/apps/server/src/modules/learnroom/uc/dashboard.uc.spec.ts @@ -10,7 +10,7 @@ import { LearnroomTypes, SortOrder, } from '@shared/domain'; -import { CourseRepo, DashboardRepoInterface } from '@shared/repo'; +import { CourseRepo, IDashboardRepo } from '@shared/repo'; import { setupEntities } from '@shared/testing'; import { DashboardUc } from './dashboard.uc'; @@ -31,7 +31,7 @@ const learnroomMock = (id: string, name: string) => { describe('dashboard uc', () => { let module: TestingModule; let service: DashboardUc; - let repo: DashboardRepoInterface; + let repo: IDashboardRepo; let courseRepo: CourseRepo; afterAll(async () => { diff --git a/apps/server/src/modules/learnroom/uc/dashboard.uc.ts b/apps/server/src/modules/learnroom/uc/dashboard.uc.ts index b29e39bc5b3..1e1df78fcba 100644 --- a/apps/server/src/modules/learnroom/uc/dashboard.uc.ts +++ b/apps/server/src/modules/learnroom/uc/dashboard.uc.ts @@ -1,12 +1,12 @@ import { Inject, Injectable, NotFoundException } from '@nestjs/common'; import { DashboardEntity, EntityId, GridPosition, GridPositionWithGroupIndex, SortOrder } from '@shared/domain'; -import { CourseRepo, DashboardRepoInterface } from '@shared/repo'; +import { CourseRepo, IDashboardRepo } from '@shared/repo'; // import { NotFound } from '@feathersjs/errors'; // wrong import? see NotFoundException @Injectable() export class DashboardUc { constructor( - @Inject('DASHBOARD_REPO') private readonly dashboardRepo: DashboardRepoInterface, + @Inject('DASHBOARD_REPO') private readonly dashboardRepo: IDashboardRepo, private readonly courseRepo: CourseRepo ) {} diff --git a/apps/server/src/shared/repo/dashboard/dashboard.repo.ts b/apps/server/src/shared/repo/dashboard/dashboard.repo.ts index 882062e96ca..30b463e9344 100644 --- a/apps/server/src/shared/repo/dashboard/dashboard.repo.ts +++ b/apps/server/src/shared/repo/dashboard/dashboard.repo.ts @@ -10,14 +10,14 @@ const generateEmptyDashboard = (userId: EntityId) => { return dashboard; }; -export interface DashboardRepoInterface { +export interface IDashboardRepo { getUsersDashboard(userId: EntityId): Promise; getDashboardById(id: EntityId): Promise; persistAndFlush(entity: DashboardEntity): Promise; } @Injectable() -export class DashboardRepo implements DashboardRepoInterface { +export class DashboardRepo implements IDashboardRepo { constructor(protected readonly em: EntityManager, protected readonly mapper: DashboardModelMapper) {} // ToDo: refactor this to be in an abstract class (see baseRepo)