xpeditis2.0/apps/backend/src/application/webhooks/webhooks.module.ts
David-Henri ARNAUD c5c15eb1f9 feature phase 3
2025-10-13 17:54:32 +02:00

35 lines
1.0 KiB
TypeScript

/**
* Webhooks Module
*
* Provides webhook functionality for external integrations
*/
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { HttpModule } from '@nestjs/axios';
import { WebhooksController } from '../controllers/webhooks.controller';
import { WebhookService } from '../services/webhook.service';
import { WebhookOrmEntity } from '../../infrastructure/persistence/typeorm/entities/webhook.orm-entity';
import { TypeOrmWebhookRepository } from '../../infrastructure/persistence/typeorm/repositories/typeorm-webhook.repository';
import { WEBHOOK_REPOSITORY } from '../../domain/ports/out/webhook.repository';
@Module({
imports: [
TypeOrmModule.forFeature([WebhookOrmEntity]),
HttpModule.register({
timeout: 10000,
maxRedirects: 5,
}),
],
controllers: [WebhooksController],
providers: [
WebhookService,
{
provide: WEBHOOK_REPOSITORY,
useClass: TypeOrmWebhookRepository,
},
],
exports: [WebhookService],
})
export class WebhooksModule {}