import { Injectable } from '@nestjs/common';
import { EmailService } from './email.service';
import { PushService } from './push.service';
import { SMSService } from './sms.service';
@Injectable()
export class NotificationsService {
constructor(
private readonly emailService: EmailService,
private readonly pushService: PushService,
private readonly smsService: SMSService,
) {}
async sendToUser(userId: string, notification: { type: string; data: any }): Promise<void> {
await this.pushService.send(userId, notification);
}
async sendToAdmins(notification: { type: string; data: any }): Promise<void> {
// Send to all admin users
}
async sendEmail(to: string, template: string, data: any): Promise<void> {
await this.emailService.send(to, template, data);
}
async sendSMS(phoneNumber: string, message: string): Promise<void> {
await this.smsService.send(phoneNumber, message);
}
}