Skip to content

Commit 102e9a3

Browse files
author
Maggie Chen
committed
Revert "drop legacy models"
This reverts commit fbc1046.
1 parent fbc1046 commit 102e9a3

File tree

2 files changed

+142
-0
lines changed

2 files changed

+142
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/* eslint import/no-cycle: 0 */
2+
3+
import { Column, DataType, HasMany, Model, Table } from "sequelize-typescript";
4+
import { DataTypes } from "sequelize";
5+
import ApplicationDashboardTable from "./applicationDashboard.model";
6+
import { StatusType, SecondChoiceStatusType } from "../types";
7+
8+
@Table({ tableName: "applicantresponse" })
9+
export default class Application extends Model {
10+
@Column({ type: DataType.INTEGER, primaryKey: true, autoIncrement: true })
11+
id!: number;
12+
13+
@Column({ type: DataType.STRING })
14+
academicOrCoop!: string;
15+
16+
@Column({ type: DataType.STRING })
17+
academicYear!: string;
18+
19+
@Column({ type: DataType.STRING })
20+
email!: string;
21+
22+
@Column({ type: DataType.STRING })
23+
firstChoiceRole!: string;
24+
25+
@Column({ type: DataType.STRING })
26+
firstName!: string;
27+
28+
@Column({ type: DataType.STRING })
29+
heardFrom!: string;
30+
31+
@Column({ type: DataType.STRING })
32+
lastName!: string;
33+
34+
@Column({ type: DataType.STRING })
35+
locationPreference!: string;
36+
37+
@Column({ type: DataType.STRING })
38+
program!: string;
39+
40+
@Column({ type: DataType.STRING })
41+
pronouns!: string;
42+
43+
@Column({ type: DataType.STRING })
44+
pronounsSpecified!: string;
45+
46+
@Column({ type: DataType.STRING })
47+
resumeUrl!: string;
48+
49+
@Column({ type: DataType.ARRAY(DataType.STRING) })
50+
roleSpecificQuestions!: string[];
51+
52+
@Column({ type: DataType.STRING })
53+
secondChoiceRole!: string;
54+
55+
@Column({ type: DataType.ARRAY(DataType.STRING) })
56+
shortAnswerQuestions!: string[];
57+
58+
@Column({
59+
type: DataType.ENUM(...Object.values(StatusType)),
60+
defaultValue: StatusType.PENDING,
61+
})
62+
status!: StatusType;
63+
64+
@Column({
65+
type: DataTypes.ENUM(...Object.values(SecondChoiceStatusType)),
66+
defaultValue: SecondChoiceStatusType.NOT_APPLICABLE,
67+
})
68+
secondChoiceStatus!: SecondChoiceStatusType;
69+
70+
@Column({ type: DataType.STRING })
71+
term!: string;
72+
73+
@Column({ type: DataType.STRING })
74+
timesApplied!: string;
75+
76+
@Column({ type: DataType.STRING })
77+
timestamp!: bigint;
78+
79+
@HasMany(() => ApplicationDashboardTable)
80+
applicationDashboards?: ApplicationDashboardTable[];
81+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/* eslint import/no-cycle: 0 */
2+
3+
import {
4+
BelongsTo,
5+
Column,
6+
DataType,
7+
ForeignKey,
8+
Model,
9+
Table,
10+
} from "sequelize-typescript";
11+
import Application from "./application.model";
12+
import User from "./user.model";
13+
14+
@Table({ tableName: "applicationdashboardtable" })
15+
export default class ApplicationDashboardTable extends Model {
16+
@Column({ type: DataType.STRING })
17+
reviewerEmail!: string;
18+
19+
@Column({
20+
type: DataType.INTEGER,
21+
primaryKey: true,
22+
unique: true,
23+
autoIncrement: true,
24+
})
25+
id!: number;
26+
27+
@Column({ type: DataType.INTEGER })
28+
passionFSG!: number;
29+
30+
@Column({ type: DataType.INTEGER })
31+
teamPlayer!: number;
32+
33+
@Column({ type: DataType.INTEGER })
34+
desireToLearn!: number;
35+
36+
@Column({ type: DataType.INTEGER })
37+
skill!: number;
38+
39+
@Column({ type: DataType.ENUM("junior", "intermediate", "senior") })
40+
skillCategory!: string;
41+
42+
@Column({ type: DataType.STRING })
43+
reviewerComments!: string;
44+
45+
@Column({ type: DataType.ENUM("N/A", "considered", "not considered") })
46+
recommendedSecondChoice!: string;
47+
48+
@ForeignKey(() => User)
49+
@Column({ type: DataType.INTEGER })
50+
reviewerId!: number;
51+
52+
@BelongsTo(() => User)
53+
user!: User;
54+
55+
@ForeignKey(() => Application)
56+
@Column({ type: DataType.INTEGER })
57+
applicationId!: number;
58+
59+
@BelongsTo(() => Application)
60+
application!: Application;
61+
}

0 commit comments

Comments
 (0)