diff --git a/apps/server/src/modules/federal-state/entity/federal-state.entity.ts b/apps/server/src/modules/federal-state/entity/federal-state.entity.ts index 51a6a190754..d9cb9eb14a9 100644 --- a/apps/server/src/modules/federal-state/entity/federal-state.entity.ts +++ b/apps/server/src/modules/federal-state/entity/federal-state.entity.ts @@ -1,5 +1,5 @@ import { Embeddable, Embedded, Entity, Property } from '@mikro-orm/core'; -import { BaseEntityWithTimestamps } from '@shared/domain'; +import { BaseEntityWithTimestamps } from '@shared/domain/entity/base.entity'; export interface IFederalStateProperties { name: string; diff --git a/apps/server/src/modules/federal-state/federal-state.module.ts b/apps/server/src/modules/federal-state/federal-state.module.ts index 07bed7ebe08..5d76cbc6657 100644 --- a/apps/server/src/modules/federal-state/federal-state.module.ts +++ b/apps/server/src/modules/federal-state/federal-state.module.ts @@ -4,6 +4,6 @@ import { FederalStateService } from './service'; @Module({ providers: [FederalStateService, FederalStateRepo], - exports: [FederalStateService], + exports: [FederalStateService, FederalStateRepo], }) export class FederalStateModule {} diff --git a/apps/server/src/modules/legacy-school/legacy-school.module.ts b/apps/server/src/modules/legacy-school/legacy-school.module.ts index 8547c417055..84bbf7df95c 100644 --- a/apps/server/src/modules/legacy-school/legacy-school.module.ts +++ b/apps/server/src/modules/legacy-school/legacy-school.module.ts @@ -1,8 +1,10 @@ import { Module } from '@nestjs/common'; -import { FederalStateRepo, LegacySchoolRepo } from '@shared/repo'; +import { LegacySchoolRepo } from '@shared/repo'; import { LoggerModule } from '@src/core/logger'; +import { FederalStateService } from '@src/modules/federal-state'; +import { FederalStateRepo } from '../federal-state/repo'; import { SchoolYearRepo } from './repo'; -import { FederalStateService, LegacySchoolService, SchoolValidationService, SchoolYearService } from './service'; +import { LegacySchoolService, SchoolValidationService, SchoolYearService } from './service'; /** * @deprecated because it uses the deprecated LegacySchoolDo. diff --git a/apps/server/src/modules/management/seed-data/schools.ts b/apps/server/src/modules/management/seed-data/schools.ts index 59494acfd16..36b7c7a3d23 100644 --- a/apps/server/src/modules/management/seed-data/schools.ts +++ b/apps/server/src/modules/management/seed-data/schools.ts @@ -1,12 +1,5 @@ /* eslint-disable @typescript-eslint/dot-notation */ -import { - FederalStateEntity, - ISchoolProperties, - SchoolFeatures, - SchoolRoles, - SchoolYearEntity, - SystemEntity, -} from '@shared/domain'; +import { ISchoolProperties, SchoolFeatures, SchoolRoles, SchoolYearEntity, SystemEntity } from '@shared/domain'; import { federalStateFactory, schoolFactory } from '@shared/testing'; import { FederalStateEntity } from '@src/modules/federal-state/entity'; import { DeepPartial } from 'fishery'; diff --git a/apps/server/src/modules/provisioning/provisioning.module.ts b/apps/server/src/modules/provisioning/provisioning.module.ts index 52ad581a5ed..91ed57a0e27 100644 --- a/apps/server/src/modules/provisioning/provisioning.module.ts +++ b/apps/server/src/modules/provisioning/provisioning.module.ts @@ -2,16 +2,15 @@ import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { LoggerModule } from '@src/core/logger'; import { AccountModule } from '@src/modules/account/account.module'; -import { FederalStateModule } from '@src/modules/federal-state'; import { GroupModule } from '@src/modules/group'; -import { RoleModule } from '@src/modules/role'; import { LegacySchoolModule } from '@src/modules/legacy-school'; +import { RoleModule } from '@src/modules/role'; import { SystemModule } from '@src/modules/system/system.module'; import { UserModule } from '@src/modules/user'; import { ProvisioningService } from './service/provisioning.service'; import { IservProvisioningStrategy, OidcMockProvisioningStrategy, SanisProvisioningStrategy } from './strategy'; import { OidcProvisioningService } from './strategy/oidc/service/oidc-provisioning.service'; -import { SanisResponseMapper } from './strategy/sanis/sanis-response.mappers'; +import { SanisResponseMapper } from './strategy/sanis/sanis-response.mapper'; @Module({ imports: [ diff --git a/apps/server/src/modules/provisioning/strategy/oidc/service/oidc-provisioning.service.ts b/apps/server/src/modules/provisioning/strategy/oidc/service/oidc-provisioning.service.ts index 204e7674607..94d883dd57e 100644 --- a/apps/server/src/modules/provisioning/strategy/oidc/service/oidc-provisioning.service.ts +++ b/apps/server/src/modules/provisioning/strategy/oidc/service/oidc-provisioning.service.ts @@ -1,18 +1,19 @@ import { Injectable, UnprocessableEntityException } from '@nestjs/common'; -import { EntityId, ExternalSource, FederalStateEntity, SchoolFeatures, SchoolYearEntity } from '@shared/domain'; +import { EntityId, ExternalSource, SchoolFeatures, SchoolYearEntity } from '@shared/domain'; import { LegacySchoolDo, RoleReference, UserDO } from '@shared/domain/domainobject'; import { Logger } from '@src/core/logger'; import { AccountService } from '@src/modules/account/services/account.service'; import { AccountSaveDto } from '@src/modules/account/services/dto'; +import { FederalStateService } from '@src/modules/federal-state'; +import { FederalStateDO } from '@src/modules/federal-state/domainobject'; import { Group, GroupService, GroupUser } from '@src/modules/group'; -import { FederalStateService, LegacySchoolService, SchoolYearService } from '@src/modules/legacy-school'; +import { LegacySchoolService, SchoolYearService } from '@src/modules/legacy-school'; import { FederalStateNames } from '@src/modules/legacy-school/types'; import { RoleService } from '@src/modules/role'; import { RoleDto } from '@src/modules/role/service/dto/role.dto'; import { UserService } from '@src/modules/user'; import { ObjectId } from 'bson'; import CryptoJS from 'crypto-js'; -import { FederalStateDO } from '@src/modules/federal-state/domainobject/federal-state.do'; import { ExternalGroupDto, ExternalGroupUserDto, ExternalSchoolDto, ExternalUserDto } from '../../../dto'; import { SchoolForGroupNotFoundLoggable, UserForGroupNotFoundLoggable } from '../../../loggable'; @@ -46,7 +47,7 @@ export class OidcProvisioningService { } } else { const schoolYear: SchoolYearEntity = await this.schoolYearService.getCurrentSchoolYear(); - const federalState: FederalStateEntity = await this.federalStateService.findFederalStateByName( + const federalState: FederalStateDO = await this.federalStateService.findFederalStateByName( FederalStateNames.NIEDERSACHEN ); diff --git a/apps/server/src/modules/server/server.module.ts b/apps/server/src/modules/server/server.module.ts index d8f0d7a227c..1e57c694e2e 100644 --- a/apps/server/src/modules/server/server.module.ts +++ b/apps/server/src/modules/server/server.module.ts @@ -8,7 +8,7 @@ import { MongoDatabaseModuleOptions, MongoMemoryDatabaseModule } from '@shared/i import { MailModule } from '@shared/infra/mail'; import { RabbitMQWrapperModule, RabbitMQWrapperTestModule } from '@shared/infra/rabbitmq'; import { REDIS_CLIENT, RedisModule } from '@shared/infra/redis'; -import { createConfigModuleOptions, DB_PASSWORD, DB_URL, DB_USERNAME } from '@src/config'; +import { DB_PASSWORD, DB_URL, DB_USERNAME, createConfigModuleOptions } from '@src/config'; import { CoreModule } from '@src/core'; import { LegacyLogger, LoggerModule } from '@src/core/logger'; import { AccountApiModule } from '@src/modules/account/account-api.module'; @@ -18,15 +18,17 @@ import { CollaborativeStorageModule } from '@src/modules/collaborative-storage'; import { FilesStorageClientModule } from '@src/modules/files-storage-client'; import { GroupApiModule } from '@src/modules/group/group-api.module'; import { LearnroomApiModule } from '@src/modules/learnroom/learnroom-api.module'; +import { LegacySchoolApiModule } from '@src/modules/legacy-school/legacy-school-api.module'; import { LessonApiModule } from '@src/modules/lesson/lesson-api.module'; import { NewsModule } from '@src/modules/news'; import { OauthProviderApiModule } from '@src/modules/oauth-provider'; import { OauthApiModule } from '@src/modules/oauth/oauth-api.module'; +import { PseudonymApiModule } from '@src/modules/pseudonym/pseudonym-api.module'; import { RocketChatModule } from '@src/modules/rocketchat'; -import { LegacySchoolApiModule } from '@src/modules/legacy-school/legacy-school-api.module'; import { SharingApiModule } from '@src/modules/sharing/sharing.module'; import { SystemApiModule } from '@src/modules/system/system-api.module'; import { TaskApiModule } from '@src/modules/task/task-api.module'; +import { TeamsApiModule } from '@src/modules/teams/teams-api.module'; import { ToolApiModule } from '@src/modules/tool/tool-api.module'; import { ImportUserModule } from '@src/modules/user-import'; import { UserLoginMigrationApiModule } from '@src/modules/user-login-migration/user-login-migration-api.module'; @@ -35,8 +37,7 @@ import { VideoConferenceApiModule } from '@src/modules/video-conference/video-co import connectRedis from 'connect-redis'; import session from 'express-session'; import { RedisClient } from 'redis'; -import { TeamsApiModule } from '@src/modules/teams/teams-api.module'; -import { PseudonymApiModule } from '@src/modules/pseudonym/pseudonym-api.module'; +import { FederalStateApiModule } from '../federal-state/federal-state-api.module'; import { ServerController } from './controller/server.controller'; import { serverConfig } from './server.config'; diff --git a/apps/server/src/shared/domain/domainobject/legacy-school.do.ts b/apps/server/src/shared/domain/domainobject/legacy-school.do.ts index 67d6f82bcdf..4da32e032df 100644 --- a/apps/server/src/shared/domain/domainobject/legacy-school.do.ts +++ b/apps/server/src/shared/domain/domainobject/legacy-school.do.ts @@ -1,6 +1,6 @@ -import { FederalStateEntity, SchoolFeatures, SchoolYearEntity } from '@shared/domain/entity'; +import { SchoolFeatures, SchoolYearEntity } from '@shared/domain/entity'; import { EntityId } from '@shared/domain/types'; -import { FederalStateDO } from '@src/modules/federal-state/domainobject/federal-state.do'; +import { FederalStateDO } from '@src/modules/federal-state/domainobject'; import { BaseDO } from './base.do'; /** @@ -29,7 +29,7 @@ export class LegacySchoolDo extends BaseDO { userLoginMigrationId?: EntityId; // TODO: N21-990 Refactoring: Create domain objects for schoolYear and federalState - federalState: FederalStateEntity; + federalState: FederalStateDO; constructor(params: LegacySchoolDo) { super(); diff --git a/apps/server/src/shared/domain/entity/all-entities.ts b/apps/server/src/shared/domain/entity/all-entities.ts index 406fda13bf4..5ce3922d226 100644 --- a/apps/server/src/shared/domain/entity/all-entities.ts +++ b/apps/server/src/shared/domain/entity/all-entities.ts @@ -20,13 +20,12 @@ import { import { Course } from './course.entity'; import { CourseGroup } from './coursegroup.entity'; import { DashboardGridElementModel, DashboardModelEntity } from './dashboard.model.entity'; -import { FederalStateEntity } from './federal-state.entity'; import { ImportUser } from './import-user.entity'; import { Board, BoardElement, - ColumnboardBoardElement, ColumnBoardTarget, + ColumnboardBoardElement, LessonBoardElement, TaskBoardElement, } from './legacy-board'; @@ -69,7 +68,6 @@ export const ALL_ENTITIES = [ DashboardGridElementModel, DashboardModelEntity, ExternalToolEntity, - FederalStateEntity, ImportUser, LessonEntity, LessonBoardElement, diff --git a/apps/server/src/shared/domain/entity/index.ts b/apps/server/src/shared/domain/entity/index.ts index 9cf3a2c1630..be722f75afe 100644 --- a/apps/server/src/shared/domain/entity/index.ts +++ b/apps/server/src/shared/domain/entity/index.ts @@ -6,7 +6,6 @@ export * from './course.entity'; export * from './coursegroup.entity'; export * from './dashboard.entity'; export * from './dashboard.model.entity'; -export * from './federal-state.entity'; export * from './import-user.entity'; export * from './legacy-board'; export * from './lesson.entity'; diff --git a/apps/server/src/shared/domain/entity/school.entity.ts b/apps/server/src/shared/domain/entity/school.entity.ts index 98502a127eb..8a05cc142c9 100644 --- a/apps/server/src/shared/domain/entity/school.entity.ts +++ b/apps/server/src/shared/domain/entity/school.entity.ts @@ -10,10 +10,10 @@ import { Property, } from '@mikro-orm/core'; import { UserLoginMigrationEntity } from '@shared/domain/entity/user-login-migration.entity'; +import { FederalStateEntity } from '@src/modules/federal-state/entity'; import { BaseEntity } from './base.entity'; import { SchoolYearEntity } from './schoolyear.entity'; import { SystemEntity } from './system.entity'; -import { FederalStateEntity } from './federal-state.entity'; export enum SchoolFeatures { ROCKET_CHAT = 'rocketChat', diff --git a/apps/server/src/shared/repo/index.ts b/apps/server/src/shared/repo/index.ts index 715a78ee420..ce301db56d0 100644 --- a/apps/server/src/shared/repo/index.ts +++ b/apps/server/src/shared/repo/index.ts @@ -7,10 +7,11 @@ export * from './base.do.repo'; export * from './base.repo'; export * from './board'; +export * from './contextexternaltool'; export * from './course'; export * from './coursegroup'; export * from './dashboard'; -export * from './federalstate'; +export * from './externaltool'; export * from './importuser'; export * from './lesson'; export * from './ltitool'; @@ -28,5 +29,3 @@ export * from './teams'; export * from './user'; export * from './userloginmigration'; export * from './videoconference'; -export * from './contextexternaltool'; -export * from './externaltool'; diff --git a/apps/server/src/shared/testing/factory/domainobject/legacy-school.factory.ts b/apps/server/src/shared/testing/factory/domainobject/legacy-school.factory.ts index cf66955eb3c..1c5d1c88d7a 100644 --- a/apps/server/src/shared/testing/factory/domainobject/legacy-school.factory.ts +++ b/apps/server/src/shared/testing/factory/domainobject/legacy-school.factory.ts @@ -1,7 +1,7 @@ import { LegacySchoolDo } from '@shared/domain'; -import { federalStateFactory } from '../federal-state.factory'; import { schoolYearFactory } from '../schoolyear.factory'; import { DoBaseFactory } from './do-base.factory'; +import { federalStateDoFactory } from './federal-state.do.factory'; class LegacySchoolFactory extends DoBaseFactory {} diff --git a/apps/server/src/shared/testing/factory/federal-state.factory.ts b/apps/server/src/shared/testing/factory/federal-state.factory.ts index 71290151668..8a30171db23 100644 --- a/apps/server/src/shared/testing/factory/federal-state.factory.ts +++ b/apps/server/src/shared/testing/factory/federal-state.factory.ts @@ -1,4 +1,4 @@ -import { County, FederalStateEntity, IFederalStateProperties } from '@shared/domain'; +import { County, FederalStateEntity, IFederalStateProperties } from '@src/modules/federal-state/entity'; import { BaseFactory } from './base.factory'; export const federalStateFactory = BaseFactory.define(