Skip to content

Commit bf81c35

Browse files
committed
feat: created models and types
1 parent b0e1b09 commit bf81c35

File tree

3 files changed

+134
-0
lines changed

3 files changed

+134
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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 Applicant extends Model {
10+
@Column({ type: DataType.STRING, primaryKey: true })
11+
id!: string;
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+
firstName!: string;
24+
25+
@Column({ type: DataType.STRING })
26+
lastName!: string;
27+
28+
@Column({ type: DataType.STRING })
29+
heardFrom!: string;
30+
31+
@Column({ type: DataType.STRING })
32+
locationPreference!: string;
33+
34+
@Column({ type: DataType.STRING })
35+
program!: string;
36+
37+
@Column({ type: DataType.STRING })
38+
pronouns!: string;
39+
40+
@Column({ type: DataType.STRING })
41+
resumeUrl!: string;
42+
43+
@Column({ type: DataType.INTEGER })
44+
timesApplied!: number;
45+
46+
@Column({ type: DataType.ARRAY(DataType.STRING) })
47+
shortAnswerQuestions!: string[];
48+
49+
@Column({ type: DataType.STRING })
50+
term!: string;
51+
52+
@Column({ type: DataType.STRING })
53+
submittedAt!: string;
54+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* eslint import/no-cycle: 0 */
2+
3+
import {
4+
Column,
5+
DataType,
6+
ForeignKey,
7+
Model,
8+
Table,
9+
} from "sequelize-typescript";
10+
import { DataTypes } from "sequelize";
11+
import ApplicationDashboardTable from "./applicationDashboard.model";
12+
import { ApplicationStatus, SkillCategory } from "../types";
13+
import Applicant from "./applicant.model";
14+
15+
@Table({ tableName: "applicantresponse" })
16+
export default class ApplicantRecord extends Model {
17+
@Column({ type: DataType.STRING, primaryKey: true })
18+
id!: string;
19+
20+
@ForeignKey(() => Applicant)
21+
@Column({ type: DataType.STRING })
22+
applicantId!: string;
23+
24+
@ForeignKey(() => Role)
25+
@Column({ type: DataType.STRING })
26+
role!: string;
27+
28+
@Column({ type: DataType.ARRAY(DataType.STRING) })
29+
roleSpecificQuestions!: string[];
30+
31+
@Column({ type: DataType.INTEGER })
32+
choice!: number;
33+
34+
@Column({ type: DataType.STRING })
35+
status!: ApplicationStatus;
36+
37+
@Column({ type: DataType.STRING, allowNull: true })
38+
skillCategory!: SkillCategory;
39+
}

backend/typescript/types.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export type ApplicationDashboardInput = Omit<
5151
"applicationId"
5252
>;
5353

54+
// DEPRECATED - TO BE REMOVED AT THE END OF S25
5455
export type ApplicationDTO = {
5556
id: number;
5657
academicOrCoop: string;
@@ -75,6 +76,46 @@ export type ApplicationDTO = {
7576
timestamp: bigint;
7677
};
7778

79+
export type ApplicantDTO = {
80+
id: string;
81+
academicOrCoop: string;
82+
academicYear: string; // MAYBE CHANGE WITH ENUM
83+
email: string;
84+
firstName: string;
85+
lastName: string;
86+
heardFrom: string;
87+
locationPreference: string;
88+
program: string;
89+
pronouns: string;
90+
pronounsSpecified: string;
91+
resumeUrl: string;
92+
timesApplied: string;
93+
shortAnswerQuestions: string[];
94+
term: string;
95+
submittedAt: string;
96+
};
97+
98+
export type ApplicantRecordDTO = {
99+
id: number;
100+
applicantId: string;
101+
role: string;
102+
roleSpecificQuestions: string[];
103+
choice: number;
104+
status: ApplicationStatus;
105+
skillCategory?: SkillCategory;
106+
};
107+
108+
export type ApplicationStatus =
109+
| "Applied"
110+
| "In Review"
111+
| "Reviewed"
112+
| "Interview"
113+
| "Interview Complete"
114+
| "Offer"
115+
| "Not Considered";
116+
117+
export type SkillCategory = "Junior" | "Intermediate" | "Senior";
118+
78119
export type ApplicationDashboardRowDTO = {
79120
application: ApplicationDTO;
80121
reviewDashboards: ApplicationDashboardDTO[];

0 commit comments

Comments
 (0)