mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 15:18:11 +00:00
28 lines
858 B
TypeScript
28 lines
858 B
TypeScript
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;
|
|
}
|
|
}
|