forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotification-preference.entity.ts
More file actions
44 lines (34 loc) · 1.04 KB
/
Copy pathnotification-preference.entity.ts
File metadata and controls
44 lines (34 loc) · 1.04 KB
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
import { Entity, PrimaryGeneratedColumn, Column, UpdateDateColumn } from 'typeorm';
export enum NotificationEventType {
SPLIT_CREATED = 'split_created',
PAYMENT_RECEIVED = 'payment_received',
PAYMENT_REMINDER = 'payment_reminder',
SPLIT_COMPLETED = 'split_completed',
FRIEND_REQUEST = 'friend_request',
GROUP_INVITE = 'group_invite',
}
@Entity('notification_preferences')
export class NotificationPreference {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column()
userId!: string;
@Column({
type: 'enum',
enum: NotificationEventType,
enumName: 'notification_event_type_enum',
})
eventType!: NotificationEventType;
@Column({ default: true })
pushEnabled!: boolean;
@Column({ default: true })
emailEnabled!: boolean;
@Column({ type: 'time', nullable: true })
quietHoursStart?: string;
@Column({ type: 'time', nullable: true })
quietHoursEnd?: string;
@Column({ nullable: true })
timezone?: string; // Store user timezone for quiet hours calculation
@UpdateDateColumn()
updatedAt!: Date;
}