import { Injectable, Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';

export interface NotificationChannel {
  send(recipient: string, subject: string, body: string, context?: Record<string, unknown>): Promise<boolean>;
}

@Injectable()
export class PushAdapter implements NotificationChannel {
  private readonly logger = new Logger(PushAdapter.name);

  constructor(private readonly config: ConfigService) {
    this.logger.log('Push notification adapter initialized');
  }

  async send(
    recipient: string,
    subject: string,
    body: string,
    context?: Record<string, unknown>,
  ): Promise<boolean> {
    // Push notifications would typically use FCM/APNS
    // For now, just log
    this.logger.log(`[PUSH MOCK] To: ${recipient} | Title: ${subject} | Body: ${body.substring(0, 100)}`);
    return true;
  }
}
