import { Module } from "@nestjs/common";
import { TypeOrmModule } from "@nestjs/typeorm";
import { IntentsModule } from "../intents/intents.module";
import { ProvidersModule } from "../providers/providers.module";
import { PaymentWebhookEvent } from "./entities/payment-webhook-event.entity";
import { WebhookEventsRepository } from "./webhook-events.repository";
import { WebhookProcessorService } from "./webhook-processor.service";
import { WebhooksController } from "./webhooks.controller";
import { TelebirrWebhookService } from "./handlers/telebirr-webhook.service";
import { CbeBirrWebhookService } from "./handlers/cbe-birr-webhook.service";
import { EBirrWebhookService } from "./handlers/ebirr-webhook.service";
import { CardWebhookService } from "./handlers/card-webhook.service";
import { WaafiWebhookService } from "./handlers/waafi-webhook.service";
import { DMoneyWebhookService } from "./handlers/dmoney-webhook.service";

@Module({
  imports: [
    TypeOrmModule.forFeature([PaymentWebhookEvent]),
    IntentsModule,
    ProvidersModule,
  ],
  controllers: [WebhooksController],
  providers: [
    WebhookEventsRepository,
    WebhookProcessorService,
    TelebirrWebhookService,
    CbeBirrWebhookService,
    EBirrWebhookService,
    CardWebhookService,
    WaafiWebhookService,
    DMoneyWebhookService,
  ],
})
export class WebhooksModule {}
