-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEmailNotificationModel.ts
49 lines (41 loc) · 1.32 KB
/
EmailNotificationModel.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { Entity, Schema } from "redis-om";
export type EmailNotificationEventType =
'notification_event:new_user_signup_complete'
| 'notification_event:new_post'
| 'notification_event:new_comment'
| 'notification_event:new_listing'
| 'notification_event:new_like_on_post'
| 'notification_event:new_follow_to_user'
| 'notification_event:new_message_to_chat'
| 'notification_event:new_product_item'
export type EmailNotificationEventTypeToPayloadType = {
'notification_event:new_user_signup_complete': {
templateName: 'welcome.html',
userEmail: string
},
'notification_event:new_post': any
'notification_event:new_comment': any
'notification_event:new_listing': any
'notification_event:new_like_on_post': any
'notification_event:new_follow_to_user': any
'notification_event:new_message_to_chat': any
'notification_event:new_product_item': any
}
export interface EmailNotificationModel {
event_type: EmailNotificationEventType;
json_payload: string,
created_at: string;
}
export class EmailNotificationModel extends Entity { }
export const emailNotificationsModelSchema = new Schema(
EmailNotificationModel,
{
event_type: { type: 'string' },
json_payload: { type: "string" },
created_at: { type: 'date' }
},
{
dataStructure: "JSON",
indexedDefault: true,
}
);