-
Notifications
You must be signed in to change notification settings - Fork 23
feat: alert admins on double booking #1044
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
Conversation
4585a69 to
995db5a
Compare
carddev81
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.
Looked good and tested good. Left a couple of comments.
carddev81
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.
Looks good and tested good
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.
Nice work on the conflict detection - the logic is solid. Got a few thoughts that could improve the admin experience:
Issue: We're only showing the first conflicting class per user
There's a break statement on line 438 in backend/src/database/class_enrollments.go that stops checking after finding the first conflict. So if a resident's already enrolled in both "Math 101" and "English 102" that both conflict with the new class, admins only see one of them in the modal.
Example:
- Resident enrolled in: Math 101 (Mon/Wed 2-3pm) and English 102 (Mon/Wed 2-3pm)
- Trying to add: Science 3030 (Mon/Wed 2-3pm)
- Current: Modal shows "Conflicts with Math 101"
- Expected: Modal should show both Math 101 and English 102 conflicts
Also was thinking about how to show that and maybe....
Bednar, Stephon
Conflicts with Math 101 · Mon 2:00 PM – 3:00 PM and at least one other class.
This gives admins awareness of other conflicting classes without cluttering the UI.
What do you think about these tweaks?
be9b5c7 to
434a8d3
Compare
corypride
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.
Looks good.
carddev81
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.
This tested good, but want to note that i did come across an issue where the conflicts didn't show up and I believe they should have, I was unable to recreate so I am approving this. Code looks great.

Description of the change
This PR adds a feature to alert admins upon the attempted double booking of a resident in a class.
Screenshot(s)
Additional context
Also fixes a small bug with the pagination during Resident Enrollment caused by the following piece of code
Flow of what happens and why it was causing issues with pagination:
Second issue:
the pagination button didn't have type="button" so when a user clicks a pagination page without any selected users it defaults to type="submit" causing "please select at least one user" in the lower left hand corner, and if you do have a user selected, enrolls that user.