import { Module } from '@nestjs/common'; import { AdMessagerService } from './adapters/primaries/ad-messager.service'; import { AdProfile } from './mappers/ad.profile'; import { CreateAdUseCase } from './domain/usecases/create-ad.usecase'; import { AdRepository } from './adapters/secondaries/ad.repository'; import { DatabaseModule } from '../database/database.module'; import { CqrsModule } from '@nestjs/cqrs'; import { GeoTimezoneFinder } from '../geography/adapters/secondaries/geo-timezone-finder'; import { DefaultParamsProvider } from './adapters/secondaries/default-params.provider'; import { GeorouterCreator } from '../geography/adapters/secondaries/georouter-creator'; import { GeographyModule } from '../geography/geography.module'; import { HttpModule } from '@nestjs/axios'; import { PostgresDirectionEncoder } from '../geography/adapters/secondaries/postgres-direction-encoder'; import { MessageBrokerPublisher } from '@mobicoop/message-broker-module'; import { MESSAGE_BROKER_PUBLISHER, MESSAGE_PUBLISHER, } from '../../app.constants'; import { MessagePublisher } from './adapters/secondaries/message-publisher'; import { DIRECTION_ENCODER, GEOROUTER_CREATOR, PARAMS_PROVIDER, TIMEZONE_FINDER, } from './ad.constants'; @Module({ imports: [GeographyModule, DatabaseModule, CqrsModule, HttpModule], providers: [ { provide: PARAMS_PROVIDER, useClass: DefaultParamsProvider, }, { provide: GEOROUTER_CREATOR, useClass: GeorouterCreator, }, { provide: TIMEZONE_FINDER, useClass: GeoTimezoneFinder, }, { provide: DIRECTION_ENCODER, useClass: PostgresDirectionEncoder, }, { provide: MESSAGE_BROKER_PUBLISHER, useClass: MessageBrokerPublisher, }, { provide: MESSAGE_PUBLISHER, useClass: MessagePublisher, }, AdProfile, AdRepository, CreateAdUseCase, AdMessagerService, ], exports: [], }) export class AdModule {}