Skip to content

Commit

Permalink
DashboardRepoInterface -> IDashboardRepo
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfganggreschus committed Nov 16, 2023
1 parent d7cc56d commit f9de095
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ 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';

describe('Dashboard Controller (API)', () => {
let app: INestApplication;
let em: EntityManager;
let dashboardRepo: DashboardRepoInterface;
let dashboardRepo: IDashboardRepo;
let currentUser: ICurrentUser;

beforeAll(async () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/modules/learnroom/uc/dashboard.uc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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 () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/modules/learnroom/uc/dashboard.uc.ts
Original file line number Diff line number Diff line change
@@ -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
) {}

Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/shared/repo/dashboard/dashboard.repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const generateEmptyDashboard = (userId: EntityId) => {
return dashboard;
};

export interface DashboardRepoInterface {
export interface IDashboardRepo {
getUsersDashboard(userId: EntityId): Promise<DashboardEntity>;
getDashboardById(id: EntityId): Promise<DashboardEntity>;
persistAndFlush(entity: DashboardEntity): Promise<DashboardEntity>;
}

@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)
Expand Down

0 comments on commit f9de095

Please sign in to comment.