From 0c80b2cfc60746872043848b920ce275f27081b4 Mon Sep 17 00:00:00 2001 From: mat-ng Date: Mon, 1 Apr 2024 20:24:36 -0400 Subject: [PATCH] add roles --- .../2023.02.18T17.43.41.create-user-table.ts | 12 ++++++++---- backend/typescript/models/user.model.ts | 8 +++++++- backend/typescript/types.ts | 4 +++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/backend/typescript/migrations/2023.02.18T17.43.41.create-user-table.ts b/backend/typescript/migrations/2023.02.18T17.43.41.create-user-table.ts index 1a54982..7d4a615 100644 --- a/backend/typescript/migrations/2023.02.18T17.43.41.create-user-table.ts +++ b/backend/typescript/migrations/2023.02.18T17.43.41.create-user-table.ts @@ -11,7 +11,7 @@ const SEEDED_DATA = [ email: "johndoe@gmail.com", auth_id: "bide", permission: "Reviewers", - role: "Developer", + role: "Project Developer", }, { first_name: "Jane", @@ -19,7 +19,7 @@ const SEEDED_DATA = [ email: "janedoe@gmail.ca", auth_id: "none", permission: "Reviewers", - role: "Developer", + role: "Project Developer", }, { first_name: "UW", @@ -27,7 +27,7 @@ const SEEDED_DATA = [ email: "recruitmenttools@uwblueprint.org", auth_id: "1Z4wyuonu9MhAi4VoAEiTMVj1iT2", permission: "Reviewers", - role: "Developer", + role: "Project Developer", }, ]; // recruitmenttools@uwblueprint.org @@ -64,7 +64,11 @@ export const up: Migration = async ({ context: sequelize }) => { defaultValue: "Reviewers" }, role: { - type: DataType.ENUM("Developer", "Designer"), + type: DataType.ENUM( + "Co-President", "Director Lead", "Internal Director", "External Director", + "VP Engineering", "VP Design", "VP Product", "VP Project Scoping", "VP Finance & Operations", "VP Talent", + "Graphic Designer", "Marketing & Outreach Director", "Product Manager", "Project Lead", "Project Developer", "Product Designer" + ), allowNull: false, }, createdAt: DataType.DATE, diff --git a/backend/typescript/models/user.model.ts b/backend/typescript/models/user.model.ts index ba71b32..35f0ca3 100644 --- a/backend/typescript/models/user.model.ts +++ b/backend/typescript/models/user.model.ts @@ -24,7 +24,13 @@ export default class User extends Model { @Column({ type: DataType.ENUM("VP Talent", "Eteam", "Engineering", "Product", "Design", "Reviewers"), allowNull: false, defaultValue: 'Reviewers' }) permission!: Permission; - @Column({ type: DataType.ENUM("Developer, Designer"), allowNull: false }) + @Column({ + type: DataType.ENUM( + "Co-President", "Director Lead", "Internal Director", "External Director", + "VP Engineering", "VP Design", "VP Product", "VP Project Scoping", "VP Finance & Operations", "VP Talent", + "Graphic Designer", "Marketing & Outreach Director", "Product Manager", "Project Lead", "Project Developer", "Product Designer" + ), allowNull: false + }) role!: Role; @HasMany(() => ApplicationDashboardTable) diff --git a/backend/typescript/types.ts b/backend/typescript/types.ts index 3894da7..cb77934 100644 --- a/backend/typescript/types.ts +++ b/backend/typescript/types.ts @@ -1,6 +1,8 @@ export type Permission = "VP Talent" | "Eteam" | "Engineering" | "Product" | "Design" | "Reviewers"; -export type Role = "Developer" | "Designer"; +export type Role = "Co-President" | "Director Lead" | "Internal Director" | "External Director" | + "VP Engineering" | "VP Design" | "VP Product" | "VP Project Scoping" | "VP Finance & Operations" | "VP Talent" | + "Graphic Designer" | "Marketing & Outreach Director" | "Product Manager" | "Project Lead" | "Project Developer" | "Product Designer"; export enum StatusType { ACCEPTED = "accepted",