import { Global, Module } from "@nestjs/common";
import { ConfigModule } from "@nestjs/config";
import { EmailService } from "./email.service.js";
import { SendGridEmailProvider } from "./providers/sendgrid.provider.js";
import { LoggingModule } from "@bff/core/logging/logging.module.js";
import { QueueModule } from "@bff/infra/queue/queue.module.js";
import { EmailQueueService } from "./queue/email.queue.js";
import { EmailProcessor } from "./queue/email.processor.js";

@Global()
@Module({
  imports: [ConfigModule, LoggingModule, QueueModule],
  providers: [EmailService, SendGridEmailProvider, EmailQueueService, EmailProcessor],
  exports: [EmailService, EmailQueueService],
})
export class EmailModule {}
