import { Injectable, Logger } from '@nestjs/common';
import { Notification, NotificationChannel } from '../../domain/entities/notification.entity';
import { INotificationProvider } from '../../domain/ports/notification-provider.interface';

/**
 * Email notification provider.
 * In production, this would integrate with SendGrid / AWS SES / SMTP.
 * Currently a mock implementation with proper DDD structure.
 */
@Injectable()
export class EmailNotificationProvider implements INotificationProvider {
  private readonly logger = new Logger('EmailNotificationProvider');
  readonly channel = NotificationChannel.EMAIL;

  async send(notification: Notification): Promise<boolean> {
    // TODO: Integrate with email service (SendGrid, AWS SES, etc.) in production
    this.logger.log(
      `[MOCK] Email sent to user ${notification.userId}: "${notification.title}"`,
    );
    return true;
  }
}
