|
| 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 | +} |
0 commit comments