forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.entity.ts
More file actions
44 lines (37 loc) · 832 Bytes
/
Copy pathuser.entity.ts
File metadata and controls
44 lines (37 loc) · 832 Bytes
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,
CreateDateColumn,
UpdateDateColumn,
} from "typeorm";
export interface EmailPreferences {
invitations: boolean;
reminders: boolean;
receivedConfirmation: boolean;
completion: boolean;
}
@Entity("users")
export class User {
@PrimaryGeneratedColumn("uuid")
id!: string;
@Column({ type: "varchar", unique: true })
email!: string;
@Column({
type: "jsonb",
name: "email_preferences",
default: {
invitations: true,
reminders: true,
receivedConfirmation: true,
completion: true,
},
})
emailPreferences!: EmailPreferences;
@Column({ type: "timestamp", name: "last_email_sent_at", nullable: true })
lastEmailSentAt?: Date;
@CreateDateColumn()
createdAt!: Date;
@UpdateDateColumn()
updatedAt!: Date;
}