Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { DataTypes } from "sequelize";
import { Migration } from "../umzug";

const TABLE_NAME = "interviewed_applicant_records";

export const up: Migration = async ({ context: sequelize }) => {
await sequelize.getQueryInterface().createTable(TABLE_NAME, {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
allowNull: false,
primaryKey: true,
},
applicantRecordId: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
references: {
model: "applicant_records",
key: "id",
},
},
score: {
type: DataTypes.INTEGER,
allowNull: true,
},
interviewJson: {
type: DataTypes.JSONB,
allowNull: true,
},
status: {
type: DataTypes.STRING,
allowNull: false,
},
interviewNotesId: {
type: DataTypes.UUID,
allowNull: true,
references: {
model: "firebase_files",
key: "id",
},
},
schedulingLink: {
type: DataTypes.STRING,
allowNull: true,
},
interviewDate: {
type: DataTypes.DATE,
allowNull: true,
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
});
};

export const down: Migration = async ({ context: sequelize }) => {
await sequelize.getQueryInterface().dropTable(TABLE_NAME);
};
79 changes: 79 additions & 0 deletions backend/typescript/models/interviewedApplicantRecord.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import {
Column,
DataType,
ForeignKey,
Model,
Table,
} from "sequelize-typescript";
import { Interview, InterviewStatus } from "../types";
import ApplicantRecord from "./applicantRecord.model";
import File from "./file.model";

@Table({ tableName: "interviewed_applicant_records" })
export default class InterviewedApplicantRecord extends Model {
@Column({
type: DataType.UUID,
defaultValue: DataType.UUIDV4,
primaryKey: true,
})
id!: string;

@ForeignKey(() => ApplicantRecord)
@Column({
type: DataType.STRING,
allowNull: false,
unique: true,
})
applicantRecordId!: string;

@Column({
type: DataType.INTEGER,
allowNull: true,
})
score!: number | null;

@Column({
type: DataType.JSONB,
allowNull: true,
})
interviewJson!: Interview | null;

@Column({
type: DataType.STRING,
allowNull: false,
})
status!: InterviewStatus;

@ForeignKey(() => File)
@Column({
type: DataType.UUID,
allowNull: true,
})
interviewNotesId!: string | null;

@Column({
type: DataType.STRING,
allowNull: true,
})
schedulingLink!: string | null;

@Column({
type: DataType.DATE,
allowNull: true,
})
interviewDate!: Date | null;

@Column({
type: DataType.DATE,
allowNull: false,
defaultValue: DataType.NOW,
})
createdAt!: Date;

@Column({
type: DataType.DATE,
allowNull: false,
defaultValue: DataType.NOW,
})
updatedAt!: Date;
}
22 changes: 22 additions & 0 deletions backend/typescript/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ export type ApplicationStatus =

export type SkillCategory = "Junior" | "Intermediate" | "Senior";

export type Interview = {
passionFSG?: number;
teamPlayer?: number;
desireToLearn?: number;
skill?: number;
skillCategory?: SkillCategory;
comments?: string;
};
Comment on lines +102 to +109
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed that Interview is the exact same as Review (

export type Review = {
).

Should we keep the new type or reuse the old one?


export type InterviewStatus = "NeedsReview" | "InProgress" | "Complete";

export type ApplicantRecordExtraInfo = {
adminReview?: string;
};
Expand Down Expand Up @@ -222,6 +233,17 @@ export type DeleteReviewedApplicantRecordDTO = {
reviewerId: number;
};

export type InterviewedApplicantRecordDTO = {
id: string;
applicantRecordId: string;
score: number | null;
interviewJson: Interview | null;
status: InterviewStatus;
interviewNotesId: string | null;
schedulingLink: string | null;
interviewDate: Date | null;
};

export type ReviewDetails = {
reviewerFirstName: string;
reviewerLastName: string;
Expand Down
Loading