Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Commit 5cea81d

Browse files
✨ Add entities
1 parent 8276de0 commit 5cea81d

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-0
lines changed

src/entities/email.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {
2+
Entity,
3+
PrimaryGeneratedColumn,
4+
CreateDateColumn,
5+
UpdateDateColumn,
6+
Column
7+
} from "typeorm";
8+
9+
@Entity()
10+
export class Email {
11+
@PrimaryGeneratedColumn()
12+
id!: number;
13+
14+
@Column()
15+
userId!: number;
16+
17+
@Column()
18+
email!: string;
19+
20+
@Column()
21+
isVerified!: boolean;
22+
23+
@Column()
24+
isPrimary!: boolean;
25+
26+
@CreateDateColumn()
27+
createdAt!: Date;
28+
29+
@UpdateDateColumn()
30+
updatedAt!: Date;
31+
}

src/entities/organization.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {
2+
Entity,
3+
PrimaryGeneratedColumn,
4+
CreateDateColumn,
5+
UpdateDateColumn,
6+
Column
7+
} from "typeorm";
8+
9+
@Entity()
10+
export class Organization {
11+
@PrimaryGeneratedColumn()
12+
id!: number;
13+
14+
@Column()
15+
name!: string;
16+
17+
@Column()
18+
invitationDomain!: string;
19+
20+
@CreateDateColumn()
21+
createdAt!: Date;
22+
23+
@UpdateDateColumn()
24+
updatedAt!: Date;
25+
}

src/entities/user.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import {
2+
Entity,
3+
PrimaryGeneratedColumn,
4+
CreateDateColumn,
5+
UpdateDateColumn,
6+
Column
7+
} from "typeorm";
8+
9+
@Entity()
10+
export class User {
11+
@PrimaryGeneratedColumn()
12+
id!: number;
13+
14+
@Column()
15+
name!: string;
16+
17+
@Column()
18+
nickname!: string;
19+
20+
@Column()
21+
primaryEmailId!: number;
22+
23+
@Column()
24+
password!: string;
25+
26+
@Column()
27+
twoFactorEnabled!: boolean;
28+
29+
@Column()
30+
twoFactorSecret!: string;
31+
32+
@Column()
33+
country!: string;
34+
35+
@Column()
36+
timezone!: string;
37+
38+
@Column()
39+
notificationEmails!: 1 | 2 | 3 | 4;
40+
41+
@Column()
42+
preferredLanguage!: string;
43+
44+
@Column()
45+
prefersReducedMotion!: boolean;
46+
47+
@CreateDateColumn()
48+
createdAt!: Date;
49+
50+
@UpdateDateColumn()
51+
updatedAt!: Date;
52+
}

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
"outDir": "./dist",
1616
"typeRoots": ["node_modules/@types"]
1717
},
18+
"include": ["src/**/*.ts"],
1819
"exclude": ["node_modues"]
1920
}

0 commit comments

Comments
 (0)