Skip to content
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

Admin class management (backend) #44

Merged
merged 19 commits into from
Jan 25, 2025
Merged

Admin class management (backend) #44

merged 19 commits into from
Jan 25, 2025

Conversation

jansm04
Copy link
Contributor

@jansm04 jansm04 commented Jan 24, 2025

Updated and added backend functionality for the admin class management module. Merged #42 midway through to make sure new code in the model classes was consistent with the mysql2 changes.

Class Module

  • created a PUT endpoint to allow admins to update classes
  • created a DELETE endpoint to delete classes by ID
  • added subcategory to addClass() parameters as it was missing

Schedule Module

  • created a DELETE endpoint to delete all schedules included in a given list of schedule IDs
  • fixed a bug in setSchedulesByClassId() where added list of schedules was creating an invalid SQL query

Shift Module

  • added shift_id to shifts table in DB to replace (fk_volunteer_id, fk_schedule_id, shift_date) as PK
  • updated shift_coverage_request in DB to reference shifts using shift_id
  • updated the GetShiftsByVolunteerIdAndMonth procedure in procedures.sql to use shift_id for joins involving shifts table
  • implemented POST, PUT and DELETE endpoints in the shifts module

Don't think any existing functions in the shifts model needed to be updated as a result of the PK change btw.

Tested all the endpoints too and should be good to go

Copy link
Collaborator

@jjessieshang jjessieshang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding shift_id to the shifts table will be a big improvement to allow for empty shifts. Thank you Jan for making the adjustment everywhere and also in the ERM diagram.

  • Endpoints looks good to me, just need to resolve the merge conflicts
  • Next step for your add classes module will be to build the frontend and connect with these endpoints once design is ready :)

@theosiemensrhodes
Copy link
Contributor

LGTM

good luck on the monster merge

@jansm04 jansm04 merged commit c0495b6 into main Jan 25, 2025
@jansm04 jansm04 deleted the admin-class-management branch January 25, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants