notification queue

This commit is contained in:
2025-12-14 10:13:34 +03:30
parent befa311e98
commit b7e41ff67d
8 changed files with 109 additions and 210 deletions
@@ -41,18 +41,14 @@ export class NotificationService {
// send in app notification
if (preference?.channels?.includes(NotifChannelEnum.IN_APP)) {
notifications.forEach(notif => {
if (notif.admin) {
this.notificationGateway.sendInAppNotification(
{ adminId: notif.admin.id, restaurantId },
{
notificationId: notif.id,
subject: message.title,
body: message.content,
},
);
}
});
await this.queueService.addBulkInAppNotifications(
notifications.map(notification => ({
recipient: { adminId: notification.admin?.id || '', restaurantId },
subject: message.title,
body: message.content,
notificationId: notification.id,
})),
);
}
// add sms notifications to queue
if (preference?.channels?.includes(NotifChannelEnum.SMS)) {