-
-
Notifications
You must be signed in to change notification settings - Fork 208
/
mentor.ts
63 lines (49 loc) · 1.56 KB
/
mentor.ts
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
import {
Entity,
Column,
CreateDateColumn,
UpdateDateColumn,
PrimaryGeneratedColumn,
OneToMany,
ManyToOne,
Index,
Unique,
} from 'typeorm';
import { User } from './user';
import { Student } from './student';
import { Course } from './course';
import { TaskChecker } from './taskChecker';
import { StageInterview } from './stageInterview';
import { TaskInterviewResult } from './taskInterviewResult';
@Entity()
@Index(['courseId'])
@Unique(['courseId', 'userId'])
export class Mentor {
@PrimaryGeneratedColumn() id: number;
@CreateDateColumn()
createdDate: number;
@UpdateDateColumn()
updatedDate: number;
@ManyToOne(_ => Course, (course: Course) => course.mentors, { nullable: true })
course: Course;
@Column({ nullable: true })
courseId: number;
@ManyToOne(_ => User)
user: User;
@Column()
userId: number;
@Column({ default: false })
isExpelled: boolean;
@OneToMany(_ => Student, student => student.mentor, { nullable: true })
students: Student[] | null;
@OneToMany(_ => TaskChecker, (taskChecker: TaskChecker) => taskChecker.mentor, { nullable: true })
taskChecker: TaskChecker[] | null;
@Column({ nullable: true })
maxStudentsLimit: number;
@Column({ nullable: true, type: 'varchar' })
studentsPreference: 'any' | 'city' | 'country';
@OneToMany(_ => StageInterview, stageInterview => stageInterview.mentor, { nullable: true })
stageInterviews: StageInterview[] | null;
@OneToMany(_ => TaskInterviewResult, (result: TaskInterviewResult) => result.mentor)
interviewResults: TaskInterviewResult[] | null;
}