Skip to content

Commit

Permalink
Remove mikro-orm folder
Browse files Browse the repository at this point in the history
  • Loading branch information
bischofmax committed Mar 7, 2025
1 parent 63cdcc0 commit d436272
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { faker } from '@faker-js/faker';
import { createMock, DeepMocked } from '@golevelup/ts-jest';
import { School, SchoolService } from '@modules/school';
import { FederalStateService, FileStorageType, SchoolProps, SchoolYearService } from '@modules/school/domain';
import { FederalStateEntityMapper, SchoolYearEntityMapper } from '@modules/school/repo/mikro-orm/mapper';
import { FederalStateEntityMapper, SchoolYearEntityMapper } from '@modules/school/repo';
import { federalStateEntityFactory, schoolFactory, schoolYearEntityFactory } from '@modules/school/testing';
import { systemFactory } from '@modules/system/testing';
import { Test, TestingModule } from '@nestjs/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { School, SchoolService } from '@modules/school';
import { FederalState, FederalStateService, FileStorageType, SchoolYearService } from '@modules/school/domain';
import { SchoolFactory } from '@modules/school/domain/factory';
import { SchoolFeature, SchoolPermissions } from '@modules/school/domain/type';
import { FederalStateEntityMapper, SchoolYearEntityMapper } from '@modules/school/repo/mikro-orm/mapper';
import { FederalStateEntityMapper, SchoolYearEntityMapper } from '@modules/school/repo';
import { System } from '@modules/system';
import { Injectable } from '@nestjs/common';
import { ObjectId } from 'bson';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { MediaSource } from '@modules/media-source';
import { MediaSourceMapper } from '@modules/media-source/repo';
import { MediaSourceEntity } from '@modules/media-source/entity';
import { MediaSourceMapper } from '@modules/media-source/repo';
import { School } from '@modules/school';
import { SchoolEntityMapper } from '@modules/school/repo/mikro-orm/mapper';
import { SchoolEntityMapper } from '@modules/school/repo';
import { MediaSchoolLicense } from '../../domain';
import { mediaSchoolLicenseEntityFactory, mediaSchoolLicenseFactory } from '../../testing';
import { MediaSchoolLicenseEntityMapper } from './media-school-license.entity.mapper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ObjectId } from '@mikro-orm/mongodb';
import { MediaSourceDataFormat, MediaSourceService } from '@modules/media-source';
import { mediaSourceFactory } from '@modules/media-source/testing';
import { SchoolService } from '@modules/school';
import { FederalStateEntityMapper } from '@modules/school/repo/mikro-orm/mapper';
import { FederalStateEntityMapper } from '@modules/school/repo';
import { federalStateEntityFactory, schoolFactory } from '@modules/school/testing';
import { ExternalToolMedium } from '@modules/tool/external-tool/domain';
import { Test, TestingModule } from '@nestjs/testing';
Expand Down
14 changes: 9 additions & 5 deletions apps/server/src/modules/school/repo/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
export { CountyEmbeddable, FederalStateEntity, FederalStateProperties } from './mikro-orm/federal-state.entity';
export { FederalStateRepo } from './mikro-orm/federal-state.repo';
export { SchoolYearEntity, SchoolYearProperties } from './mikro-orm/school-year.entity';
export { SchoolYearMikroOrmRepo } from './mikro-orm/school-year.repo';
export { SchoolEntity, SchoolProperties, SchoolRolePermission, SchoolRoles } from './mikro-orm/school.entity';
export { CountyEmbeddable, FederalStateEntity, FederalStateProperties } from './federal-state.entity';
export { FederalStateRepo } from './federal-state.repo';
export { FederalStateEntityMapper } from './mapper/federal-state.entity.mapper';
export { SchoolYearEntityMapper } from './mapper/school-year.entity.mapper';
export { SchoolEntityMapper } from './mapper/school.entity.mapper';
export { SchoolYearEntity, SchoolYearProperties } from './school-year.entity';
export { SchoolYearMikroOrmRepo } from './school-year.repo';
export { SchoolEntity, SchoolProperties, SchoolRolePermission, SchoolRoles } from './school.entity';
export { SchoolMikroOrmRepo } from './school.repo';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ObjectId } from '@mikro-orm/mongodb';
import { countyFactory } from '@modules/school/testing/county.factory';
import { CountyEmbeddableMapper } from './county.embeddable.mapper';
import { countyFactory } from '../../testing/county.factory';
import { CountyEmbeddable } from '../federal-state.entity';
import { CountyEmbeddableMapper } from './county.embeddable.mapper';

describe('CountyEmbeddableMapper', () => {
describe('mapToEntity', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ObjectId } from '@mikro-orm/mongodb';
import { County } from '../../../domain';
import { County } from '../../domain';
import { CountyEmbeddable } from '../federal-state.entity';

export class CountyEmbeddableMapper {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FederalState } from '../../../domain';
import { FederalState } from '../../domain';
import { FederalStateEntity } from '../federal-state.entity';
import { CountyEmbeddableMapper } from './county.embeddable.mapper';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SchoolYear } from '../../../domain';
import { SchoolYear } from '../../domain';
import { SchoolYearEntity } from '../school-year.entity';

export class SchoolYearEntityMapper {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { schoolEntityFactory } from '@modules/school/testing';
import { SystemEntity } from '@modules/system/repo';
import { setupEntities } from '@testing/database';
import { School } from '../../../domain';
import { School } from '../../domain';
import { SchoolEntity } from '../school.entity';
import { CountyEmbeddableMapper } from './county.embeddable.mapper';
import { FederalStateEntityMapper } from './federal-state.entity.mapper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { EntityData } from '@mikro-orm/core';
import { EntityManager } from '@mikro-orm/mongodb';
import { SchoolFactory } from '@modules/school/domain/factory';
import { SystemEntity } from '@modules/system/repo';
import { School } from '../../../domain';
import { School } from '../../domain';
import { SchoolFactory } from '../../domain/factory';
import { FederalStateEntity } from '../federal-state.entity';
import { SchoolYearEntity } from '../school-year.entity';
import { SchoolEntity } from '../school.entity';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { schoolYearEntityFactory } from '@modules/school/testing';
import { schoolYearEntityFactory } from '../testing';
import { SchoolYearEntity } from './school-year.entity';

describe('schoolyear entity', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EntityManager } from '@mikro-orm/mongodb';
import { Test, TestingModule } from '@nestjs/testing';
import { cleanupCollections } from '@testing/cleanup-collections';
import { MongoMemoryDatabaseModule } from '@testing/database';
import { schoolYearEntityFactory } from '../../testing';
import { schoolYearEntityFactory } from '../testing';
import { SchoolYearEntityMapper } from './mapper';
import { SchoolYearEntity } from './school-year.entity';
import { SchoolYearMikroOrmRepo } from './school-year.repo';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { BaseRepo } from '@shared/repo/base.repo';
import { SchoolYear } from '../../domain';
import { SchoolYearsNoYearsLeft } from '../../domain/error';
import { SchoolYearRepo } from '../../domain/interface';
import { SchoolYear } from '../domain';
import { SchoolYearsNoYearsLeft } from '../domain/error';
import { SchoolYearRepo } from '../domain/interface';
import { SchoolYearEntityMapper } from './mapper';
import { SchoolYearEntity } from './school-year.entity';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import {
Property,
} from '@mikro-orm/core';
import { SchoolSystemOptionsEntity } from '@modules/legacy-school/entity';
import { SchoolFeature, SchoolPurpose } from '@modules/school/domain';
import { FileStorageType } from '@modules/school/domain/type/file-storage-type.enum';
import { SystemEntity } from '@modules/system/repo';
import { UserLoginMigrationEntity } from '@modules/user-login-migration/repo';
import { BaseEntityWithTimestamps } from '@shared/domain/entity/base.entity';
import { StorageProviderEntity } from '@shared/domain/entity/storageprovider.entity';
import { LanguageType } from '@shared/domain/interface';
import { FileStorageType, SchoolFeature, SchoolPurpose } from '../domain';
import { CountyEmbeddable, FederalStateEntity } from './federal-state.entity';
import { SchoolYearEntity } from './school-year.entity';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import { Test, TestingModule } from '@nestjs/testing';
import { LanguageType, SortOrder } from '@shared/domain/interface';
import { cleanupCollections } from '@testing/cleanup-collections';
import { MongoMemoryDatabaseModule } from '@testing/database';
import { FileStorageType, SCHOOL_REPO, SchoolFeature, SchoolPurpose } from '../../domain';
import { federalStateDoFactory, schoolEntityFactory, schoolFactory } from '../../testing';
import { countyFactory } from '../../testing/county.factory';
import { FileStorageType, SCHOOL_REPO, SchoolFeature, SchoolPurpose } from '../domain';
import { countyFactory, federalStateDoFactory, schoolEntityFactory, schoolFactory } from '../testing';
import { FederalStateEntityMapper, SchoolEntityMapper, SchoolYearEntityMapper } from './mapper';
import { SchoolEntity } from './school.entity';
import { SchoolMikroOrmRepo } from './school.repo';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Injectable } from '@nestjs/common';
import { IFindOptions, SortOrder } from '@shared/domain/interface/find-options';
import { EntityId } from '@shared/domain/types/entity-id';
import { BaseDomainObjectRepo } from '@shared/repo/base-domain-object.repo';
import { School, SchoolProps, SchoolQuery, SchoolRepo } from '../../domain';
import { School, SchoolProps, SchoolQuery, SchoolRepo } from '../domain';
import { SchoolEntityMapper } from './mapper/school.entity.mapper';
import { SchoolEntity } from './school.entity';
import { SchoolScope } from './scope/school.scope';
Expand Down
3 changes: 1 addition & 2 deletions apps/server/src/modules/school/school.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { Module } from '@nestjs/common';
import { SystemModule } from '../system';
import { FederalStateService, SCHOOL_REPO, SCHOOL_YEAR_REPO, SchoolService, SchoolYearService } from './domain';
import { SystemDeletedHandler } from './domain/event-handler';
import { FederalStateRepo, SchoolYearMikroOrmRepo } from './repo';
import { SchoolMikroOrmRepo } from './repo/mikro-orm/school.repo';
import { FederalStateRepo, SchoolMikroOrmRepo, SchoolYearMikroOrmRepo } from './repo';

@Module({
imports: [SystemModule],
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/modules/school/testing/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './county.embeddable.factory';
export * from './county.factory';
export * from './federal-state.do.factory';
export * from './federal-state.entity.factory';
export * from './school-entity.factory';
Expand Down

0 comments on commit d436272

Please sign in to comment.