import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { NotificationEvent } from './entities/notification-event.entity';
import { WhatsappTemplate } from './entities/whatsapp-template.entity';
import { WhatsappMessageLog } from './entities/whatsapp-message-log.entity';
import { WhatsAppNotificationService } from './whatsapp-notification.service';
import { WhatsAppSenderService } from './whatsapp-sender.service';
import { ScheduleModule } from '@nestjs/schedule';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      NotificationEvent,
      WhatsappTemplate,
      WhatsappMessageLog,
    ]),
    ScheduleModule.forRoot(), // Ensure scheduling is enabled for the background job
  ],
  providers: [WhatsAppNotificationService, WhatsAppSenderService],
  exports: [WhatsAppNotificationService],
})
export class NotificationModule {}
