-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathuser.ts
More file actions
62 lines (61 loc) · 1.55 KB
/
user.ts
File metadata and controls
62 lines (61 loc) · 1.55 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import {
Column,
CreateDateColumn,
Entity,
PrimaryGeneratedColumn,
UpdateDateColumn,
ManyToOne,
} from "typeorm";
import { UserRole } from "./user-role";
import { Team } from "./team";
@Entity()
export class User {
@PrimaryGeneratedColumn()
public readonly id!: number;
@CreateDateColumn()
public readonly createdAt!: Date;
@UpdateDateColumn()
public readonly updatedAt!: Date;
@Column()
public firstName!: string;
@Column()
public lastName!: string;
@Column({ unique: true })
public email!: string;
@Column({ select: false })
public password!: string;
@Column()
public tokenSecret!: string;
@Column()
public verifyToken!: string;
@Column()
public forgotPasswordToken!: string;
@Column()
public role!: UserRole;
@Column({ default: null, type: "datetime" })
public initialProfileFormSubmittedAt!: Date | null;
@Column({ default: null, type: "datetime" })
public confirmationExpiresAt!: Date | null;
@Column({ default: false })
public profileSubmitted!: boolean;
@Column({ default: false })
public admitted!: boolean;
@Column({ default: false })
public confirmed!: boolean;
@Column({ default: false })
public declined!: boolean;
@Column({ default: false })
public checkedIn!: boolean;
@ManyToOne(() => Team, (team) => team.requests, {
nullable: true,
eager: true,
onDelete: "SET NULL",
})
public teamRequest: Team | null = null;
@ManyToOne(() => Team, (team) => team.users, {
nullable: true,
eager: true,
onDelete: "SET NULL",
})
public team: Team | null = null;
}