From b0e9f423a540a56887ed8aa1cecffd0dbb3b9da6 Mon Sep 17 00:00:00 2001 From: agnisa-cap Date: Tue, 19 Sep 2023 10:29:06 +0200 Subject: [PATCH] N21-1256 use course service in tool (#4415) * use course service in tool module instead of course repo * changes imports for course service overall --- .../learnroom/service/board-copy.service.ts | 2 +- .../common-cartridge-export.service.spec.ts | 2 +- .../learnroom/service/rooms.service.spec.ts | 2 +- .../learnroom/service/rooms.service.ts | 2 +- .../service/lesson-copy.service.spec.ts | 2 +- .../service/share-token.service.spec.ts | 4 +-- .../sharing/service/share-token.service.ts | 4 +-- .../modules/sharing/uc/share-token.uc.spec.ts | 4 +-- .../src/modules/sharing/uc/share-token.uc.ts | 4 +-- apps/server/src/modules/task/index.ts | 1 - .../strategy/abstract-launch.strategy.spec.ts | 32 +++++++++---------- .../strategy/abstract-launch.strategy.ts | 14 ++++---- .../basic-tool-launch.strategy.spec.ts | 12 +++---- .../lti11-tool-launch.strategy.spec.ts | 6 ++-- .../strategy/lti11-tool-launch.strategy.ts | 6 ++-- .../oauth2-tool-launch.strategy.spec.ts | 12 +++---- .../tool/tool-launch/tool-launch.module.ts | 15 ++++----- .../service/video-conference.service.spec.ts | 2 +- .../service/video-conference.service.ts | 2 +- .../uc/video-conference-deprecated.uc.spec.ts | 2 +- .../uc/video-conference-deprecated.uc.ts | 2 +- 21 files changed, 65 insertions(+), 67 deletions(-) diff --git a/apps/server/src/modules/learnroom/service/board-copy.service.ts b/apps/server/src/modules/learnroom/service/board-copy.service.ts index f2c2e321dfc..b419c9f0593 100644 --- a/apps/server/src/modules/learnroom/service/board-copy.service.ts +++ b/apps/server/src/modules/learnroom/service/board-copy.service.ts @@ -17,7 +17,7 @@ import { LegacyLogger } from '@src/core/logger'; import { CopyElementType, CopyHelperService, CopyStatus } from '@src/modules/copy-helper'; import { getResolvedValues } from '@src/modules/files-storage/helper'; import { LessonCopyService } from '@src/modules/lesson/service'; -import { TaskCopyService } from '@src/modules/task'; +import { TaskCopyService } from '@src/modules/task/service'; import { sortBy } from 'lodash'; type BoardCopyParams = { diff --git a/apps/server/src/modules/learnroom/service/common-cartridge-export.service.spec.ts b/apps/server/src/modules/learnroom/service/common-cartridge-export.service.spec.ts index 8055a619273..9f76df15d0f 100644 --- a/apps/server/src/modules/learnroom/service/common-cartridge-export.service.spec.ts +++ b/apps/server/src/modules/learnroom/service/common-cartridge-export.service.spec.ts @@ -3,7 +3,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { ComponentType, Course, IComponentProperties, IComponentTextProperties, Lesson, Task } from '@shared/domain'; import { courseFactory, lessonFactory, setupEntities, taskFactory } from '@shared/testing'; import { CommonCartridgeExportService } from '@src/modules/learnroom/service/common-cartridge-export.service'; -import { CourseService } from '@src/modules/learnroom/service/course.service'; +import { CourseService } from '@src/modules/learnroom/service'; import { LessonService } from '@src/modules/lesson/service'; import { TaskService } from '@src/modules/task/service/task.service'; import AdmZip from 'adm-zip'; diff --git a/apps/server/src/modules/learnroom/service/rooms.service.spec.ts b/apps/server/src/modules/learnroom/service/rooms.service.spec.ts index 668d6bcaabf..789edcb9099 100644 --- a/apps/server/src/modules/learnroom/service/rooms.service.spec.ts +++ b/apps/server/src/modules/learnroom/service/rooms.service.spec.ts @@ -7,7 +7,7 @@ import { BoardExternalReference, BoardExternalReferenceType, EntityId } from '@s import { BoardRepo, LessonRepo } from '@shared/repo'; import { boardFactory, courseFactory, lessonFactory, setupEntities, taskFactory, userFactory } from '@shared/testing'; import { CardService, ColumnBoardService, ColumnService, ContentElementService } from '@src/modules/board'; -import { TaskService } from '@src/modules/task'; +import { TaskService } from '@src/modules/task/service'; import { ColumnBoardTargetService } from './column-board-target.service'; import { RoomsService } from './rooms.service'; diff --git a/apps/server/src/modules/learnroom/service/rooms.service.ts b/apps/server/src/modules/learnroom/service/rooms.service.ts index adbd09c1dbe..24bffb03f4f 100644 --- a/apps/server/src/modules/learnroom/service/rooms.service.ts +++ b/apps/server/src/modules/learnroom/service/rooms.service.ts @@ -3,7 +3,7 @@ import { Injectable } from '@nestjs/common'; import { Board, BoardExternalReferenceType, ColumnBoardTarget, EntityId } from '@shared/domain'; import { BoardRepo, LessonRepo } from '@shared/repo'; import { ColumnBoardService } from '@src/modules/board'; -import { TaskService } from '@src/modules/task'; +import { TaskService } from '@src/modules/task/service'; import { ColumnBoardTargetService } from './column-board-target.service'; @Injectable() diff --git a/apps/server/src/modules/lesson/service/lesson-copy.service.spec.ts b/apps/server/src/modules/lesson/service/lesson-copy.service.spec.ts index 3e0ef93b4e9..d9dbd647185 100644 --- a/apps/server/src/modules/lesson/service/lesson-copy.service.spec.ts +++ b/apps/server/src/modules/lesson/service/lesson-copy.service.spec.ts @@ -25,7 +25,7 @@ import { } from '@shared/testing'; import { CopyElementType, CopyHelperService, CopyStatus, CopyStatusEnum } from '@src/modules/copy-helper'; import { CopyFilesService } from '@src/modules/files-storage-client'; -import { TaskCopyService } from '@src/modules/task'; +import { TaskCopyService } from '@src/modules/task/service'; import { EtherpadService } from './etherpad.service'; import { LessonCopyService } from './lesson-copy.service'; import { NexboardService } from './nexboard.service'; diff --git a/apps/server/src/modules/sharing/service/share-token.service.spec.ts b/apps/server/src/modules/sharing/service/share-token.service.spec.ts index 837c36eed8e..c3436fb54ce 100644 --- a/apps/server/src/modules/sharing/service/share-token.service.spec.ts +++ b/apps/server/src/modules/sharing/service/share-token.service.spec.ts @@ -2,9 +2,9 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { NotFoundException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { courseFactory, lessonFactory, setupEntities, shareTokenFactory, taskFactory } from '@shared/testing'; -import { CourseService } from '@src/modules/learnroom/service/course.service'; +import { CourseService } from '@src/modules/learnroom/service'; import { LessonService } from '@src/modules/lesson/service'; -import { TaskService } from '@src/modules/task'; +import { TaskService } from '@src/modules/task/service'; import { ObjectId } from 'bson'; import { ShareTokenContextType, ShareTokenParentType } from '../domainobject/share-token.do'; import { ShareTokenRepo } from '../repo/share-token.repo'; diff --git a/apps/server/src/modules/sharing/service/share-token.service.ts b/apps/server/src/modules/sharing/service/share-token.service.ts index 3bb87a410f4..e6431d64ed5 100644 --- a/apps/server/src/modules/sharing/service/share-token.service.ts +++ b/apps/server/src/modules/sharing/service/share-token.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; -import { CourseService } from '@src/modules/learnroom/service/course.service'; +import { CourseService } from '@src/modules/learnroom/service'; import { LessonService } from '@src/modules/lesson/service'; -import { TaskService } from '@src/modules/task'; +import { TaskService } from '@src/modules/task/service'; import { ShareTokenContext, ShareTokenDO, diff --git a/apps/server/src/modules/sharing/uc/share-token.uc.spec.ts b/apps/server/src/modules/sharing/uc/share-token.uc.spec.ts index 85280c20dc1..73234960794 100644 --- a/apps/server/src/modules/sharing/uc/share-token.uc.spec.ts +++ b/apps/server/src/modules/sharing/uc/share-token.uc.spec.ts @@ -18,9 +18,9 @@ import { LegacyLogger } from '@src/core/logger'; import { Action, AuthorizableReferenceType, AuthorizationService } from '@src/modules/authorization'; import { CopyElementType, CopyStatus, CopyStatusEnum } from '@src/modules/copy-helper'; import { CourseCopyService } from '@src/modules/learnroom'; -import { CourseService } from '@src/modules/learnroom/service/course.service'; +import { CourseService } from '@src/modules/learnroom/service'; import { LessonCopyService } from '@src/modules/lesson/service'; -import { TaskCopyService } from '@src/modules/task'; +import { TaskCopyService } from '@src/modules/task/service'; import { ShareTokenContextType, ShareTokenParentType, ShareTokenPayload } from '../domainobject/share-token.do'; import { ShareTokenService } from '../service'; import { ShareTokenUC } from './share-token.uc'; diff --git a/apps/server/src/modules/sharing/uc/share-token.uc.ts b/apps/server/src/modules/sharing/uc/share-token.uc.ts index b8aeafb7029..0b72be7ce31 100644 --- a/apps/server/src/modules/sharing/uc/share-token.uc.ts +++ b/apps/server/src/modules/sharing/uc/share-token.uc.ts @@ -5,9 +5,9 @@ import { LegacyLogger } from '@src/core/logger'; import { Action, AuthorizationService } from '@src/modules/authorization'; import { CopyStatus } from '@src/modules/copy-helper'; import { CourseCopyService } from '@src/modules/learnroom'; -import { CourseService } from '@src/modules/learnroom/service/course.service'; +import { CourseService } from '@src/modules/learnroom/service'; import { LessonCopyService } from '@src/modules/lesson/service'; -import { TaskCopyService } from '@src/modules/task'; +import { TaskCopyService } from '@src/modules/task/service'; import { ShareTokenContext, ShareTokenContextType, diff --git a/apps/server/src/modules/task/index.ts b/apps/server/src/modules/task/index.ts index 22c7d98fc17..62ab8a69e94 100644 --- a/apps/server/src/modules/task/index.ts +++ b/apps/server/src/modules/task/index.ts @@ -1,2 +1 @@ export * from './task.module'; -export { TaskCopyService, TaskService } from './service'; diff --git a/apps/server/src/modules/tool/tool-launch/service/strategy/abstract-launch.strategy.spec.ts b/apps/server/src/modules/tool/tool-launch/service/strategy/abstract-launch.strategy.spec.ts index 10f0e19e639..a9514e62de1 100644 --- a/apps/server/src/modules/tool/tool-launch/service/strategy/abstract-launch.strategy.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/service/strategy/abstract-launch.strategy.spec.ts @@ -3,7 +3,6 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { Injectable } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { Course, EntityId, SchoolDO } from '@shared/domain'; -import { CourseRepo } from '@shared/repo'; import { contextExternalToolFactory, courseFactory, @@ -13,7 +12,18 @@ import { schoolExternalToolFactory, setupEntities, } from '@shared/testing'; +import { CourseService } from '@src/modules/learnroom/service'; import { SchoolService } from '@src/modules/school'; +import { CustomParameterEntry } from '../../../common/domain'; +import { + CustomParameterLocation, + CustomParameterScope, + CustomParameterType, + ToolContextType, +} from '../../../common/enum'; +import { ContextExternalTool } from '../../../context-external-tool/domain'; +import { ExternalTool } from '../../../external-tool/domain'; +import { SchoolExternalTool } from '../../../school-external-tool/domain'; import { MissingToolParameterValueLoggableException, ParameterTypeNotImplementedLoggableException } from '../../error'; import { LaunchRequestMethod, @@ -25,16 +35,6 @@ import { } from '../../types'; import { AbstractLaunchStrategy } from './abstract-launch.strategy'; import { IToolLaunchParams } from './tool-launch-params.interface'; -import { - CustomParameterLocation, - CustomParameterScope, - CustomParameterType, - ToolContextType, -} from '../../../common/enum'; -import { ExternalTool } from '../../../external-tool/domain'; -import { CustomParameterEntry } from '../../../common/domain'; -import { SchoolExternalTool } from '../../../school-external-tool/domain'; -import { ContextExternalTool } from '../../../context-external-tool/domain'; const concreteConfigParameter: PropertyData = { location: PropertyLocation.QUERY, @@ -74,7 +74,7 @@ describe('AbstractLaunchStrategy', () => { let launchStrategy: TestLaunchStrategy; let schoolService: DeepMocked; - let courseRepo: DeepMocked; + let courseService: DeepMocked; beforeAll(async () => { await setupEntities(); @@ -87,15 +87,15 @@ describe('AbstractLaunchStrategy', () => { useValue: createMock(), }, { - provide: CourseRepo, - useValue: createMock(), + provide: CourseService, + useValue: createMock(), }, ], }).compile(); launchStrategy = module.get(TestLaunchStrategy); schoolService = module.get(SchoolService); - courseRepo = module.get(CourseRepo); + courseService = module.get(CourseService); }); afterAll(async () => { @@ -199,7 +199,7 @@ describe('AbstractLaunchStrategy', () => { ); schoolService.getSchoolById.mockResolvedValue(school); - courseRepo.findById.mockResolvedValue(course); + courseService.findById.mockResolvedValue(course); const sortFn = (a: PropertyData, b: PropertyData) => { if (a.name < b.name) { diff --git a/apps/server/src/modules/tool/tool-launch/service/strategy/abstract-launch.strategy.ts b/apps/server/src/modules/tool/tool-launch/service/strategy/abstract-launch.strategy.ts index b2fe6f94446..2a790c99cb8 100644 --- a/apps/server/src/modules/tool/tool-launch/service/strategy/abstract-launch.strategy.ts +++ b/apps/server/src/modules/tool/tool-launch/service/strategy/abstract-launch.strategy.ts @@ -1,27 +1,27 @@ import { Injectable } from '@nestjs/common'; import { Course, EntityId, SchoolDO } from '@shared/domain'; -import { CourseRepo } from '@shared/repo'; +import { CourseService } from '@src/modules/learnroom/service'; import { SchoolService } from '@src/modules/school'; import { URLSearchParams } from 'url'; +import { CustomParameter, CustomParameterEntry } from '../../../common/domain'; import { CustomParameterLocation, CustomParameterScope, CustomParameterType, ToolContextType, } from '../../../common/enum'; +import { ContextExternalTool } from '../../../context-external-tool/domain'; +import { ExternalTool } from '../../../external-tool/domain'; +import { SchoolExternalTool } from '../../../school-external-tool/domain'; import { MissingToolParameterValueLoggableException, ParameterTypeNotImplementedLoggableException } from '../../error'; import { ToolLaunchMapper } from '../../mapper'; import { LaunchRequestMethod, PropertyData, PropertyLocation, ToolLaunchData, ToolLaunchRequest } from '../../types'; import { IToolLaunchParams } from './tool-launch-params.interface'; import { IToolLaunchStrategy } from './tool-launch-strategy.interface'; -import { SchoolExternalTool } from '../../../school-external-tool/domain'; -import { CustomParameter, CustomParameterEntry } from '../../../common/domain'; -import { ContextExternalTool } from '../../../context-external-tool/domain'; -import { ExternalTool } from '../../../external-tool/domain'; @Injectable() export abstract class AbstractLaunchStrategy implements IToolLaunchStrategy { - constructor(private readonly schoolService: SchoolService, private readonly courseRepo: CourseRepo) {} + constructor(private readonly schoolService: SchoolService, private readonly courseService: CourseService) {} public async createLaunchData(userId: EntityId, data: IToolLaunchParams): Promise { const launchData: ToolLaunchData = this.buildToolLaunchDataFromExternalTool(data.externalTool); @@ -216,7 +216,7 @@ export abstract class AbstractLaunchStrategy implements IToolLaunchStrategy { } case CustomParameterType.AUTO_CONTEXTNAME: { if (contextExternalTool.contextRef.type === ToolContextType.COURSE) { - const course: Course = await this.courseRepo.findById(contextExternalTool.contextRef.id); + const course: Course = await this.courseService.findById(contextExternalTool.contextRef.id); return course.name; } diff --git a/apps/server/src/modules/tool/tool-launch/service/strategy/basic-tool-launch.strategy.spec.ts b/apps/server/src/modules/tool/tool-launch/service/strategy/basic-tool-launch.strategy.spec.ts index 4aa1314ce41..76cdb6724d0 100644 --- a/apps/server/src/modules/tool/tool-launch/service/strategy/basic-tool-launch.strategy.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/service/strategy/basic-tool-launch.strategy.spec.ts @@ -1,14 +1,14 @@ import { createMock } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; -import { CourseRepo } from '@shared/repo'; import { contextExternalToolFactory, externalToolFactory, schoolExternalToolFactory } from '@shared/testing'; import { SchoolService } from '@src/modules/school'; +import { CourseService } from '@src/modules/learnroom/service'; +import { ContextExternalTool } from '../../../context-external-tool/domain'; +import { ExternalTool } from '../../../external-tool/domain'; +import { SchoolExternalTool } from '../../../school-external-tool/domain'; import { LaunchRequestMethod, PropertyData, PropertyLocation } from '../../types'; import { BasicToolLaunchStrategy } from './basic-tool-launch.strategy'; import { IToolLaunchParams } from './tool-launch-params.interface'; -import { ExternalTool } from '../../../external-tool/domain'; -import { SchoolExternalTool } from '../../../school-external-tool/domain'; -import { ContextExternalTool } from '../../../context-external-tool/domain'; describe('BasicToolLaunchStrategy', () => { let module: TestingModule; @@ -23,8 +23,8 @@ describe('BasicToolLaunchStrategy', () => { useValue: createMock(), }, { - provide: CourseRepo, - useValue: createMock(), + provide: CourseService, + useValue: createMock(), }, ], }).compile(); diff --git a/apps/server/src/modules/tool/tool-launch/service/strategy/lti11-tool-launch.strategy.spec.ts b/apps/server/src/modules/tool/tool-launch/service/strategy/lti11-tool-launch.strategy.spec.ts index 5a58fe373b5..a711cbce7d5 100644 --- a/apps/server/src/modules/tool/tool-launch/service/strategy/lti11-tool-launch.strategy.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/service/strategy/lti11-tool-launch.strategy.spec.ts @@ -2,7 +2,6 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { InternalServerErrorException, UnprocessableEntityException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { Pseudonym, RoleName, UserDO } from '@shared/domain'; -import { CourseRepo } from '@shared/repo'; import { contextExternalToolFactory, externalToolFactory, @@ -15,6 +14,7 @@ import { SchoolService } from '@src/modules/school'; import { UserService } from '@src/modules/user'; import { ObjectId } from 'bson'; import { Authorization } from 'oauth-1.0a'; +import { CourseService } from '@src/modules/learnroom/service'; import { LtiMessageType, LtiPrivacyPermission, LtiRole, ToolContextType } from '../../../common/enum'; import { ContextExternalTool } from '../../../context-external-tool/domain'; import { ExternalTool } from '../../../external-tool/domain'; @@ -53,8 +53,8 @@ describe('Lti11ToolLaunchStrategy', () => { useValue: createMock(), }, { - provide: CourseRepo, - useValue: createMock(), + provide: CourseService, + useValue: createMock(), }, ], }).compile(); diff --git a/apps/server/src/modules/tool/tool-launch/service/strategy/lti11-tool-launch.strategy.ts b/apps/server/src/modules/tool/tool-launch/service/strategy/lti11-tool-launch.strategy.ts index 7038765f06b..aa2149c8da4 100644 --- a/apps/server/src/modules/tool/tool-launch/service/strategy/lti11-tool-launch.strategy.ts +++ b/apps/server/src/modules/tool/tool-launch/service/strategy/lti11-tool-launch.strategy.ts @@ -1,11 +1,11 @@ import { Injectable, InternalServerErrorException, UnprocessableEntityException } from '@nestjs/common'; import { EntityId, LtiPrivacyPermission, Pseudonym, RoleName, UserDO } from '@shared/domain'; import { RoleReference } from '@shared/domain/domainobject'; -import { CourseRepo } from '@shared/repo'; import { PseudonymService } from '@src/modules/pseudonym'; import { SchoolService } from '@src/modules/school'; import { UserService } from '@src/modules/user'; import { Authorization } from 'oauth-1.0a'; +import { CourseService } from '@src/modules/learnroom/service'; import { LtiRole } from '../../../common/enum'; import { ExternalTool } from '../../../external-tool/domain'; import { LtiRoleMapper } from '../../mapper'; @@ -21,9 +21,9 @@ export class Lti11ToolLaunchStrategy extends AbstractLaunchStrategy { private readonly pseudonymService: PseudonymService, private readonly lti11EncryptionService: Lti11EncryptionService, schoolService: SchoolService, - courseRepo: CourseRepo + courseService: CourseService ) { - super(schoolService, courseRepo); + super(schoolService, courseService); } // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/apps/server/src/modules/tool/tool-launch/service/strategy/oauth2-tool-launch.strategy.spec.ts b/apps/server/src/modules/tool/tool-launch/service/strategy/oauth2-tool-launch.strategy.spec.ts index 021e9c93ba3..c206ded9ad5 100644 --- a/apps/server/src/modules/tool/tool-launch/service/strategy/oauth2-tool-launch.strategy.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/service/strategy/oauth2-tool-launch.strategy.spec.ts @@ -1,14 +1,14 @@ import { createMock } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; -import { CourseRepo } from '@shared/repo'; import { contextExternalToolFactory, externalToolFactory, schoolExternalToolFactory } from '@shared/testing'; import { SchoolService } from '@src/modules/school'; +import { CourseService } from '@src/modules/learnroom/service'; +import { ContextExternalTool } from '../../../context-external-tool/domain'; +import { ExternalTool } from '../../../external-tool/domain'; +import { SchoolExternalTool } from '../../../school-external-tool/domain'; import { LaunchRequestMethod, PropertyData } from '../../types'; import { OAuth2ToolLaunchStrategy } from './oauth2-tool-launch.strategy'; import { IToolLaunchParams } from './tool-launch-params.interface'; -import { ExternalTool } from '../../../external-tool/domain'; -import { ContextExternalTool } from '../../../context-external-tool/domain'; -import { SchoolExternalTool } from '../../../school-external-tool/domain'; describe('OAuth2ToolLaunchStrategy', () => { let module: TestingModule; @@ -23,8 +23,8 @@ describe('OAuth2ToolLaunchStrategy', () => { useValue: createMock(), }, { - provide: CourseRepo, - useValue: createMock(), + provide: CourseService, + useValue: createMock(), }, ], }).compile(); diff --git a/apps/server/src/modules/tool/tool-launch/tool-launch.module.ts b/apps/server/src/modules/tool/tool-launch/tool-launch.module.ts index 3e91129b7ec..858ab1ff017 100644 --- a/apps/server/src/modules/tool/tool-launch/tool-launch.module.ts +++ b/apps/server/src/modules/tool/tool-launch/tool-launch.module.ts @@ -1,14 +1,14 @@ import { Module } from '@nestjs/common'; +import { PseudonymModule } from '@src/modules/pseudonym'; import { SchoolModule } from '@src/modules/school'; import { UserModule } from '@src/modules/user'; -import { PseudonymModule } from '@src/modules/pseudonym'; -import { CourseRepo } from '@shared/repo'; -import { Lti11EncryptionService, ToolLaunchService } from './service'; -import { SchoolExternalToolModule } from '../school-external-tool'; -import { ExternalToolModule } from '../external-tool'; +import { LearnroomModule } from '@src/modules/learnroom'; +import { CommonToolModule } from '../common'; import { ContextExternalToolModule } from '../context-external-tool'; +import { ExternalToolModule } from '../external-tool'; +import { SchoolExternalToolModule } from '../school-external-tool'; +import { Lti11EncryptionService, ToolLaunchService } from './service'; import { BasicToolLaunchStrategy, Lti11ToolLaunchStrategy, OAuth2ToolLaunchStrategy } from './service/strategy'; -import { CommonToolModule } from '../common'; @Module({ imports: [ @@ -19,6 +19,7 @@ import { CommonToolModule } from '../common'; SchoolModule, UserModule, PseudonymModule, + LearnroomModule, ], providers: [ ToolLaunchService, @@ -26,8 +27,6 @@ import { CommonToolModule } from '../common'; Lti11ToolLaunchStrategy, OAuth2ToolLaunchStrategy, Lti11EncryptionService, - // Importing the LearnroomModule instead of CourseRepo creates some kind of dependency cycle that lets unrelated tests fail - CourseRepo, ], exports: [ToolLaunchService], }) diff --git a/apps/server/src/modules/video-conference/service/video-conference.service.spec.ts b/apps/server/src/modules/video-conference/service/video-conference.service.spec.ts index 9136724d3d7..221ee21943e 100644 --- a/apps/server/src/modules/video-conference/service/video-conference.service.spec.ts +++ b/apps/server/src/modules/video-conference/service/video-conference.service.spec.ts @@ -27,7 +27,7 @@ import { ObjectId } from 'bson'; import { teamFactory } from '@shared/testing/factory/team.factory'; import { NotFoundException } from '@nestjs/common/exceptions/not-found.exception'; import { teamUserFactory } from '@shared/testing/factory/teamuser.factory'; -import { CourseService } from '@src/modules/learnroom/service/course.service'; +import { CourseService } from '@src/modules/learnroom/service'; import { VideoConferenceService } from './video-conference.service'; import { ErrorStatus } from '../error/error-status.enum'; import { BBBRole } from '../bbb'; diff --git a/apps/server/src/modules/video-conference/service/video-conference.service.ts b/apps/server/src/modules/video-conference/service/video-conference.service.ts index eec64d1bd4a..c6716661473 100644 --- a/apps/server/src/modules/video-conference/service/video-conference.service.ts +++ b/apps/server/src/modules/video-conference/service/video-conference.service.ts @@ -21,7 +21,7 @@ import { AuthorizationContextBuilder, AuthorizationService, } from '@src/modules/authorization'; -import { CourseService } from '@src/modules/learnroom/service/course.service'; +import { CourseService } from '@src/modules/learnroom/service'; import { SchoolService } from '@src/modules/school'; import { UserService } from '@src/modules/user'; import { BBBRole } from '../bbb'; diff --git a/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts b/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts index 5d12520032b..3d9c9a12560 100644 --- a/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts +++ b/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts @@ -21,7 +21,7 @@ import { roleFactory, setupEntities, userDoFactory } from '@shared/testing'; import { teamFactory } from '@shared/testing/factory/team.factory'; import { AuthorizationService, SchoolService, UserService } from '@src/modules'; import { ICurrentUser } from '@src/modules/authentication'; -import { CourseService } from '@src/modules/learnroom/service/course.service'; +import { CourseService } from '@src/modules/learnroom/service'; import { IScopeInfo, VideoConference, VideoConferenceJoin, VideoConferenceState } from './dto'; import { VideoConferenceDeprecatedUc } from './video-conference-deprecated.uc'; import { diff --git a/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.ts b/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.ts index 931e4810cfb..4389879cf08 100644 --- a/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.ts +++ b/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.ts @@ -25,7 +25,7 @@ import { AuthorizationService, } from '@src/modules/authorization'; import { SchoolService } from '@src/modules/school/service/school.service'; -import { CourseService } from '@src/modules/learnroom/service/course.service'; +import { CourseService } from '@src/modules/learnroom/service'; import { UserService } from '@src/modules/user'; import { IScopeInfo, VideoConference, VideoConferenceInfo, VideoConferenceJoin, VideoConferenceState } from './dto'; import {