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

/**
 * SMS notification provider.
 * In production, this would integrate with Twilio / Alibaba Cloud SMS / AWS SNS.
 * Currently a mock implementation with proper DDD structure.
 */
@Injectable()
export class SmsNotificationProvider implements INotificationProvider {
  private readonly logger = new Logger('SmsNotificationProvider');
  readonly channel = NotificationChannel.SMS;

  async send(notification: Notification): Promise<boolean> {
    // TODO: Integrate with SMS gateway (Twilio, Alibaba Cloud SMS, etc.) in production
    this.logger.log(
      `[MOCK] SMS sent to user ${notification.userId}: "${notification.title}"`,
    );
    return true;
  }
}
