diff --git a/src/app.module.ts b/src/app.module.ts index 4fcc186..196ba9f 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -26,15 +26,19 @@ import { GeographyModule } from '@modules/geography/geography.module'; useFactory: async ( configService: ConfigService, ): Promise => ({ - domain: configService.get('SERVICE_CONFIGURATION_DOMAIN'), + domain: configService.get( + 'SERVICE_CONFIGURATION_DOMAIN', + ) as string, messageBroker: { - uri: configService.get('MESSAGE_BROKER_URI'), - exchange: configService.get('MESSAGE_BROKER_EXCHANGE'), + uri: configService.get('MESSAGE_BROKER_URI') as string, + exchange: configService.get( + 'MESSAGE_BROKER_EXCHANGE', + ) as string, }, redis: { - host: configService.get('REDIS_HOST'), + host: configService.get('REDIS_HOST') as string, password: configService.get('REDIS_PASSWORD'), - port: configService.get('REDIS_PORT'), + port: configService.get('REDIS_PORT') as number, }, setConfigurationBrokerQueue: 'matcher-configuration-create-update', deleteConfigurationQueue: 'matcher-configuration-delete', diff --git a/src/main.ts b/src/main.ts index 8db905d..2db4892 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,6 +19,6 @@ async function bootstrap() { }); await app.startAllMicroservices(); - await app.listen(process.env.HEALTH_SERVICE_PORT); + await app.listen(process.env.HEALTH_SERVICE_PORT as string); } bootstrap(); diff --git a/src/modules/ad/ad.mapper.ts b/src/modules/ad/ad.mapper.ts index 81a94c1..75df1d5 100644 --- a/src/modules/ad/ad.mapper.ts +++ b/src/modules/ad/ad.mapper.ts @@ -6,7 +6,6 @@ import { ScheduleItemModel, AdUnsupportedWriteModel, } from './infrastructure/ad.repository'; -import { Frequency } from './core/domain/ad.types'; import { v4 } from 'uuid'; import { ScheduleItemProps } from './core/domain/value-objects/schedule-item.value-object'; import { DirectionEncoderPort } from '@modules/geography/core/application/ports/direction-encoder.port'; @@ -85,7 +84,7 @@ export class AdMapper props: { driver: record.driver, passenger: record.passenger, - frequency: Frequency[record.frequency], + frequency: record.frequency, fromDate: record.fromDate.toISOString().split('T')[0], toDate: record.toDate.toISOString().split('T')[0], schedule: record.schedule.map((scheduleItem: ScheduleItemModel) => ({ @@ -120,11 +119,6 @@ export class AdMapper return entity; }; - // eslint-disable-next-line @typescript-eslint/no-unused-vars - toResponse = (entity: AdEntity): undefined => { - return undefined; - }; - toUnsupportedPersistence = (entity: AdEntity): AdUnsupportedWriteModel => ({ waypoints: this.directionEncoder.encode(entity.getProps().waypoints), direction: this.directionEncoder.encode(entity.getProps().points), diff --git a/src/modules/ad/infrastructure/ad.repository.ts b/src/modules/ad/infrastructure/ad.repository.ts index cd10089..56eb5a6 100644 --- a/src/modules/ad/infrastructure/ad.repository.ts +++ b/src/modules/ad/infrastructure/ad.repository.ts @@ -7,12 +7,13 @@ import { AD_MESSAGE_PUBLISHER } from '../ad.di-tokens'; import { AdEntity } from '../core/domain/ad.entity'; import { AdMapper } from '../ad.mapper'; import { ExtendedPrismaRepositoryBase } from '@mobicoop/ddd-library/dist/db/prisma-repository.base'; +import { Frequency } from '../core/domain/ad.types'; export type AdBaseModel = { uuid: string; driver: boolean; passenger: boolean; - frequency: string; + frequency: Frequency; fromDate: Date; toDate: Date; seatsProposed: number; diff --git a/src/modules/ad/tests/unit/ad.mapper.spec.ts b/src/modules/ad/tests/unit/ad.mapper.spec.ts index ae0bb6d..925961a 100644 --- a/src/modules/ad/tests/unit/ad.mapper.spec.ts +++ b/src/modules/ad/tests/unit/ad.mapper.spec.ts @@ -165,8 +165,4 @@ describe('Ad Mapper', () => { expect(mapped.getProps().schedule[0].time).toBe('07:05'); expect(mapped.getProps().waypoints.length).toBe(2); }); - - it('should map domain entity to response', async () => { - expect(adMapper.toResponse(adEntity)).toBeUndefined(); - }); }); diff --git a/src/modules/messager/messager.module.ts b/src/modules/messager/messager.module.ts index 64bafed..9bb5108 100644 --- a/src/modules/messager/messager.module.ts +++ b/src/modules/messager/messager.module.ts @@ -14,8 +14,8 @@ const imports = [ useFactory: async ( configService: ConfigService, ): Promise => ({ - uri: configService.get('MESSAGE_BROKER_URI'), - exchange: configService.get('MESSAGE_BROKER_EXCHANGE'), + uri: configService.get('MESSAGE_BROKER_URI') as string, + exchange: configService.get('MESSAGE_BROKER_EXCHANGE') as string, name: 'matcher', handlers: { adCreated: { diff --git a/tsconfig.json b/tsconfig.json index e077152..3f2a1e4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ "incremental": true, "skipLibCheck": true, "strictNullChecks": true, - "noImplicitAny": false, + "noImplicitAny": true, "strictBindCallApply": false, "forceConsistentCasingInFileNames": false, "noFallthroughCasesInSwitch": false,