-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathevent.entity.ts
More file actions
124 lines (94 loc) · 2.44 KB
/
event.entity.ts
File metadata and controls
124 lines (94 loc) · 2.44 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import {
Column,
CreateDateColumn,
Entity,
JoinTable,
ManyToMany,
OneToMany,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from "typeorm";
import {
UserEntity,
UserEventPermissionEntity,
} from "../../user/entities/user.entity";
import { TeamEntity } from "../../team/entities/team.entity";
import { Exclude } from "class-transformer";
import { EventStarterTemplateEntity } from "./event-starter-template.entity";
@Entity("events")
export class EventEntity {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column()
name: string;
@Column({ default: "" })
description: string;
@Column()
githubOrg: string;
@Exclude()
@Column()
githubOrgSecret: string;
@Column({ default: "" })
location: string;
@Column()
minTeamSize: number;
@Column()
maxTeamSize: number;
@Column({ type: "timestamp" })
startDate: Date;
@Column({ type: "timestamp" })
endDate: Date;
@Column({ type: "timestamp", nullable: true })
repoLockDate: Date | null;
@Column({ default: true })
canCreateTeam: boolean;
@Column({ default: true })
processQueue: boolean;
@Column({ type: "timestamp", nullable: true })
lockedAt: Date | null;
@Column({ default: 0 })
currentRound: number;
@CreateDateColumn()
createdAt: Date;
@UpdateDateColumn()
updatedAt: Date;
@Column({ nullable: true })
gameServerDockerImage: string;
@Column({ nullable: true })
myCoreBotDockerImage: string;
@Column({ nullable: true })
visualizerDockerImage: string;
@Column({ nullable: true })
monorepoUrl: string;
@Column({ nullable: true, default: "dev" })
monorepoVersion: string;
@Column({ nullable: false, default: "my-core-bot" })
basePath: string;
@Column({ nullable: true })
gameConfig: string;
@Column({ nullable: true })
serverConfig: string;
@Column({ default: false })
isPrivate: boolean;
@JoinTable({ name: "events_users" })
@ManyToMany(() => UserEntity, (user) => user.events, {
onUpdate: "CASCADE",
cascade: true,
})
users: UserEntity[];
@OneToMany(() => TeamEntity, (team) => team.event, { onDelete: "CASCADE" })
teams: TeamEntity[];
@OneToMany(
() => UserEventPermissionEntity,
(permission) => permission.event,
{
onUpdate: "CASCADE",
cascade: true,
},
)
permissions: UserEventPermissionEntity[];
@OneToMany(() => EventStarterTemplateEntity, (template) => template.event, {
cascade: true,
})
starterTemplates: EventStarterTemplateEntity[];
}