Files
matcher/src/modules/geography/geography.module.ts

28 lines
756 B
TypeScript

import { Module, Provider } from '@nestjs/common';
import { CqrsModule } from '@nestjs/cqrs';
import {
DIRECTION_ENCODER,
GEOGRAPHY_CONFIGURATION_REPOSITORY,
} from './geography.di-tokens';
import { PostgresDirectionEncoder } from './infrastructure/postgres-direction-encoder';
import { HttpModule } from '@nestjs/axios';
import { ConfigurationRepository } from '@mobicoop/configuration-module';
const adapters: Provider[] = [
{
provide: GEOGRAPHY_CONFIGURATION_REPOSITORY,
useClass: ConfigurationRepository,
},
{
provide: DIRECTION_ENCODER,
useClass: PostgresDirectionEncoder,
},
];
@Module({
imports: [CqrsModule, HttpModule],
providers: [...adapters],
exports: [DIRECTION_ENCODER],
})
export class GeographyModule {}