-
Notifications
You must be signed in to change notification settings - Fork 17
Team and staff schema and routes #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
jasminerliu
commented
Oct 28, 2025
- Created team-schema.ts, team-router.ts, and team-router.test.ts, and relevant table and routes, which is referenced by StaffInfo.
- Added optional reference to StaffInfo in UserInfo, which is only set if a User is a staff member
- Created StaffInfo table that builds on UserInfo and references Team, and relevant routes.
- concerned about the permission scopes i set for routes, like for creating/updating/deleting staff info i have it as admin, not sure what it should be exactly.
e14396d to
31edb37
Compare
…user info table, and all associated routes and tests
31edb37 to
12341f6
Compare
J164
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it's necessary to associate StaffInfo with a particular user in the system. As far as I'm aware we only plan to use this to more easily update the info site. Lmk what you think
| const userInfo = staff.user as unknown as UserInfo; | ||
| const team = staff.team as unknown as Team; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems kinda cursed. Why do we need these casts?
| z.object({ | ||
| userId: UserIdSchema, | ||
| name: z.string(), | ||
| email: z.string(), | ||
| }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we define this as a separate variable? (like AttendeeInfoSchema)
| const userInfo = await Models.UserInfo.findOne({ userId }); | ||
| if (!userInfo) { | ||
| return res.status(StatusCode.ClientErrorNotFound).json(UserNotFoundError); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this feature would work even if the user has never signed in. Can we avoid tying staffInfo to the actual user?