70 lines
2.7 KiB
TypeScript
70 lines
2.7 KiB
TypeScript
import { Module, Global } from '@nestjs/common';
|
|
import { HttpModule } from '@nestjs/axios';
|
|
import { PrismaService } from './persistence/prisma/prisma.service';
|
|
import { PlantingOrderRepositoryImpl } from './persistence/repositories/planting-order.repository.impl';
|
|
import { PlantingPositionRepositoryImpl } from './persistence/repositories/planting-position.repository.impl';
|
|
import { PoolInjectionBatchRepositoryImpl } from './persistence/repositories/pool-injection-batch.repository.impl';
|
|
import { OutboxRepository } from './persistence/repositories/outbox.repository';
|
|
import { PaymentCompensationRepository } from './persistence/repositories/payment-compensation.repository';
|
|
import { UnitOfWork, UNIT_OF_WORK } from './persistence/unit-of-work';
|
|
import { WalletServiceClient } from './external/wallet-service.client';
|
|
import { ReferralServiceClient } from './external/referral-service.client';
|
|
import { KafkaModule } from './kafka/kafka.module';
|
|
import { OutboxPublisherService } from './kafka/outbox-publisher.service';
|
|
import { EventAckController } from './kafka/event-ack.controller';
|
|
import { PLANTING_ORDER_REPOSITORY } from '../domain/repositories/planting-order.repository.interface';
|
|
import { PLANTING_POSITION_REPOSITORY } from '../domain/repositories/planting-position.repository.interface';
|
|
import { POOL_INJECTION_BATCH_REPOSITORY } from '../domain/repositories/pool-injection-batch.repository.interface';
|
|
import { PaymentCompensationService } from '../application/services/payment-compensation.service';
|
|
|
|
@Global()
|
|
@Module({
|
|
imports: [
|
|
HttpModule.register({
|
|
timeout: 5000,
|
|
maxRedirects: 5,
|
|
}),
|
|
KafkaModule,
|
|
],
|
|
controllers: [EventAckController],
|
|
providers: [
|
|
PrismaService,
|
|
{
|
|
provide: PLANTING_ORDER_REPOSITORY,
|
|
useClass: PlantingOrderRepositoryImpl,
|
|
},
|
|
{
|
|
provide: PLANTING_POSITION_REPOSITORY,
|
|
useClass: PlantingPositionRepositoryImpl,
|
|
},
|
|
{
|
|
provide: POOL_INJECTION_BATCH_REPOSITORY,
|
|
useClass: PoolInjectionBatchRepositoryImpl,
|
|
},
|
|
{
|
|
provide: UNIT_OF_WORK,
|
|
useClass: UnitOfWork,
|
|
},
|
|
OutboxRepository,
|
|
PaymentCompensationRepository,
|
|
OutboxPublisherService,
|
|
PaymentCompensationService,
|
|
WalletServiceClient,
|
|
ReferralServiceClient,
|
|
],
|
|
exports: [
|
|
PrismaService,
|
|
PLANTING_ORDER_REPOSITORY,
|
|
PLANTING_POSITION_REPOSITORY,
|
|
POOL_INJECTION_BATCH_REPOSITORY,
|
|
UNIT_OF_WORK,
|
|
OutboxRepository,
|
|
PaymentCompensationRepository,
|
|
OutboxPublisherService,
|
|
PaymentCompensationService,
|
|
WalletServiceClient,
|
|
ReferralServiceClient,
|
|
],
|
|
})
|
|
export class InfrastructureModule {}
|