fix base files for strict ts
This commit is contained in:
parent
f15e7d11b1
commit
a4c63c4233
|
@ -26,15 +26,19 @@ import { GeographyModule } from '@modules/geography/geography.module';
|
|||
useFactory: async (
|
||||
configService: ConfigService,
|
||||
): Promise<ConfigurationModuleOptions> => ({
|
||||
domain: configService.get<string>('SERVICE_CONFIGURATION_DOMAIN'),
|
||||
domain: configService.get<string>(
|
||||
'SERVICE_CONFIGURATION_DOMAIN',
|
||||
) as string,
|
||||
messageBroker: {
|
||||
uri: configService.get<string>('MESSAGE_BROKER_URI'),
|
||||
exchange: configService.get<string>('MESSAGE_BROKER_EXCHANGE'),
|
||||
uri: configService.get<string>('MESSAGE_BROKER_URI') as string,
|
||||
exchange: configService.get<string>(
|
||||
'MESSAGE_BROKER_EXCHANGE',
|
||||
) as string,
|
||||
},
|
||||
redis: {
|
||||
host: configService.get<string>('REDIS_HOST'),
|
||||
host: configService.get<string>('REDIS_HOST') as string,
|
||||
password: configService.get<string>('REDIS_PASSWORD'),
|
||||
port: configService.get<number>('REDIS_PORT'),
|
||||
port: configService.get<number>('REDIS_PORT') as number,
|
||||
},
|
||||
setConfigurationBrokerQueue: 'matcher-configuration-create-update',
|
||||
deleteConfigurationQueue: 'matcher-configuration-delete',
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -14,8 +14,8 @@ const imports = [
|
|||
useFactory: async (
|
||||
configService: ConfigService,
|
||||
): Promise<MessageBrokerModuleOptions> => ({
|
||||
uri: configService.get<string>('MESSAGE_BROKER_URI'),
|
||||
exchange: configService.get<string>('MESSAGE_BROKER_EXCHANGE'),
|
||||
uri: configService.get<string>('MESSAGE_BROKER_URI') as string,
|
||||
exchange: configService.get<string>('MESSAGE_BROKER_EXCHANGE') as string,
|
||||
name: 'matcher',
|
||||
handlers: {
|
||||
adCreated: {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"incremental": true,
|
||||
"skipLibCheck": true,
|
||||
"strictNullChecks": true,
|
||||
"noImplicitAny": false,
|
||||
"noImplicitAny": true,
|
||||
"strictBindCallApply": false,
|
||||
"forceConsistentCasingInFileNames": false,
|
||||
"noFallthroughCasesInSwitch": false,
|
||||
|
|
Loading…
Reference in New Issue