Files
dmail-api/src/modules/notifications/handlers/change-password.handler.ts
T
2025-07-20 10:15:13 +03:30

24 lines
911 B
TypeScript

import { EntityManager } from "@mikro-orm/postgresql";
import { Injectable, Logger } from "@nestjs/common";
import { BaseNotificationHandler } from "./base-notification.handler";
import { IChangePasswordNotificationData } from "../interfaces/ISendNotificationData";
import { NotificationsService } from "../services/notifications.service";
@Injectable()
export class ChangePasswordHandler extends BaseNotificationHandler<IChangePasswordNotificationData> {
protected readonly logger = new Logger(ChangePasswordHandler.name);
constructor(private readonly notificationsService: NotificationsService) {
super();
}
protected async handle(recipientId: string, data: IChangePasswordNotificationData, em: EntityManager): Promise<void> {
await this.notificationsService.changePasswordNotification(recipientId, data, em);
}
protected getHandlerName(): string {
return "ChangePassword";
}
}