Skip to content

Commit 3f270b0

Browse files
add reviewd applicant records
1 parent a2aee64 commit 3f270b0

File tree

6 files changed

+68
-82
lines changed

6 files changed

+68
-82
lines changed

backend/typescript/migrations/2025.06.14T17.43.45.create-reviewed-application-table.ts renamed to backend/typescript/migrations/2025.06.24T18.20.15.create-reviewed-application.ts

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,39 @@
11
import { DataType } from "sequelize-typescript";
2-
32
import { Migration } from "../umzug";
3+
import { ReviewStatusEnum } from "../types";
44

5-
const TABLE_NAME = "reviewed-applications";
5+
const TABLE_NAME = "reviewed_applicant_records";
66

77
export const up: Migration = async ({ context: sequelize }) => {
88
await sequelize.getQueryInterface().createTable(TABLE_NAME, {
9-
id: {
10-
type: DataType.INTEGER,
11-
allowNull: false,
12-
primaryKey: true,
13-
autoIncrement: true,
14-
unique: true,
15-
},
16-
applicationId: {
9+
applicantId: {
1710
type: DataType.STRING,
1811
allowNull: false,
12+
references: {
13+
model: "applicant_records",
14+
key: "id",
15+
},
16+
primaryKey: true,
1917
},
20-
reveiweId: {
21-
type: DataType.STRING,
18+
reviewerId: {
19+
type: DataType.INTEGER,
2220
allowNull: false,
21+
references: {
22+
model: "users",
23+
key: "id",
24+
},
25+
primaryKey: true,
2326
},
2427
review: {
25-
type: DataType.STRING,
28+
type: DataType.JSONB,
2629
allowNull: true,
2730
},
28-
email: {
31+
status: {
2932
type: DataType.STRING,
30-
primaryKey: true,
3133
allowNull: false,
34+
defaultValue: ReviewStatusEnum.TODO,
3235
},
33-
role: {
34-
type: DataType.ENUM("User", "Admin"),
35-
allowNull: false,
36-
},
37-
createdAt: DataType.DATE,
38-
updatedAt: DataType.DATE,
3936
});
40-
41-
// await sequelize.getQueryInterface().bulkInsert(TABLE_NAME, SEEDED_DATA);
4237
};
4338

4439
export const down: Migration = async ({ context: sequelize }) => {

backend/typescript/migrations/20250618014722-test.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

backend/typescript/models/applicationDashboard.model.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,3 @@ export default class ApplicationDashboardTable extends Model {
5959
@BelongsTo(() => Application)
6060
application!: Application;
6161
}
62-
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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 User from "./user.model";
11+
import { Review, ReviewStatus, ReviewStatusEnum } from "../types";
12+
import ApplicantRecord from "./applicantRecord.model";
13+
14+
@Table({ tableName: "reviewed_applicant_records" })
15+
export default class ReviewedApplicantRecord extends Model {
16+
@ForeignKey(() => ApplicantRecord)
17+
@Column({ type: DataType.STRING, primaryKey: true })
18+
applicantRecordId!: number;
19+
20+
@ForeignKey(() => User)
21+
@Column({ type: DataType.INTEGER, primaryKey: true })
22+
reviewerId!: number;
23+
24+
@Column({ type: DataType.JSONB })
25+
review!: Review;
26+
27+
@Column({
28+
type: DataType.STRING,
29+
defaultValue: ReviewStatusEnum.TODO,
30+
})
31+
status!: ReviewStatus;
32+
}

backend/typescript/models/reviewedApplication.model.ts

Lines changed: 0 additions & 47 deletions
This file was deleted.

backend/typescript/types.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,21 @@ export type DesignPositionTitle = (typeof DesignPositionTitles)[number];
211211
export type ProductPositionTitle = (typeof ProductPositionTitles)[number];
212212
export type CommunityPositionTitle = (typeof CommunityPositionTitles)[number];
213213
export type PositionTitle = (typeof PositionTitles)[number];
214+
215+
export enum ReviewStatusEnum {
216+
TODO = "Todo",
217+
IN_PROGRESS = "In Progress",
218+
DONE = "Done",
219+
CONFLICT = "Conflict",
220+
}
221+
222+
export type ReviewStatus = `${ReviewStatusEnum}`;
223+
224+
export type Review = {
225+
passionFSG?: number;
226+
teamPlayer?: number;
227+
desireToLearn?: number;
228+
skill?: number;
229+
skillCategory?: SkillCategory;
230+
comments?: string;
231+
};

0 commit comments

Comments
 (0)