notification queue

This commit is contained in:
2025-12-13 23:26:07 +03:30
parent 835f2a3853
commit befa311e98
20 changed files with 176 additions and 405 deletions
@@ -0,0 +1,25 @@
import type { recipientType } from './notification.interface';
export interface SmsNotificationQueueJob {
recipient: recipientType;
templateId: string;
parameters?: Record<string, string>;
}
export interface PushNotificationQueueJob {
title: string;
content: string;
icon: string;
action: {
type: string; //view order
url: string;
};
pushToken?: string; // FCM token for push notifications
pushTokens?: string[]; // Multiple FCM tokens for bulk push notifications
}
export interface SmsNotificationQueueJobResult {
success: boolean;
notificationId: string;
providerResponse?: Record<string, any>;
error?: string;
}
@@ -1,21 +0,0 @@
import type { NotifChannelEnum } from './notification.interface';
import type { NotifTitleEnum } from './notification.interface';
export interface NotificationQueueJob {
restaurantId: string;
userId?: string;
title: NotifTitleEnum;
content: string;
idempotencyKey?: string;
notificationId?: string; // For retries
channels: NotifChannelEnum[];
pushToken?: string; // FCM token for push notifications
pushTokens?: string[]; // Multiple FCM tokens for bulk push notifications
}
export interface NotificationQueueJobResult {
success: boolean;
notificationId: string;
providerResponse?: Record<string, any>;
error?: string;
}
@@ -20,7 +20,10 @@ export type recipientType = { userId: string } | { adminId: string };
export interface NotifRequestMessage {
title: NotifTitleEnum;
content: string;
smsText: string;
sms: {
templateId: string;
parameters?: Record<string, string>;
};
pushNotif: {
title: string;
content: string;
@@ -42,7 +45,7 @@ export interface NotifRequest {
message: NotifRequestMessage;
metadata: {
priority: number;
retries: number;
// retries: number;
};
}
//************************************************ */
@@ -54,6 +57,7 @@ interface INotifySms {
subject: NotifTitleEnum;
}
export interface IInAppNotificationPayload {
notificationId: string;
subject: NotifTitleEnum;
body: string;
}