fix: add notiftype

This commit is contained in:
mahyargdz
2025-03-03 11:39:59 +03:30
parent 0abac00bde
commit c302ab1c77
9 changed files with 106 additions and 11 deletions
@@ -19,6 +19,7 @@ export interface ITicketNotificationData extends IBaseNotificationData {
ticketId: string;
subject: string;
date: Date;
user?: string;
}
export interface IWalletNotificationData extends IBaseNotificationData {
@@ -247,6 +247,25 @@ export class NotificationsService {
}
return this.createNotification({ title: NotificationMessage.CREATE_TICKET, type: NotifType.CREATE_TICKET, message, recipientId });
}
//************************ */
//TODO: fix this cause this for admin
async createAssignTicketNotificationForAdmin(recipientId: string, data: ITicketNotificationData, queryRunner: QueryRunner) {
const message = NotificationMessage.ASSIGN_TICKET_MESSAGE.replace("[ticketId]", data.ticketId);
//sent notification based on the userSettings
// const { isActive } = await this.userSettingsService.getUserNotificationSettingWithType(
// NotifType.ANSWER_TICKET,
// recipientId,
// queryRunner,
// );
// if (isActive) {
await this.smsService.sendTicketAssignedToAdminSms(data.userPhone, data.ticketId, data.subject, data.user!);
//send email too
// }
return this.createNotification(
{ title: NotificationMessage.ASSIGN_TICKET, type: NotifType.ASSIGN_TICKET, message, recipientId },
queryRunner,
);
}
//************************ */