Skip to content

Sa/mspca 2 get volunteer by id and update volunteer by - #2

Open
shreeyaadhikari wants to merge 15 commits into
mainfrom
sa/mspca-2-get-volunteer-by-id-and-update-volunteer-by-id
Open

shreeyaadhikari wants to merge 15 commits into
mainfrom
sa/mspca-2-get-volunteer-by-id-and-update-volunteer-by-id

Conversation

@shreeyaadhikari

@shreeyaadhikari shreeyaadhikari commented Sep 26, 2026 •

Copy link
Copy Markdown

ℹ️ Issue

Closes MSPCA-2

📝 Description

Adds the ability for foster coordinators to look up a single volunteer's full details by ID and update their info without overwriting the entire record.

Briefly list the changes made to the code:

  1. Added GET /volunteers/:volunteerId which returns a single volunteer's full details, or a 404 if the ID doesn't exist.
  2. Added PATCH /volunteers/:volunteerId which updates only the fields provided in the request body, leaving the rest of the record untouched.
  3. Added UpdateVolunteerDto with address, city, zipcode, homebase, residentAnimals, notes, and fosterType as editable, optional fields, with @ IsEnum() validation on homebase and fosterType to restrict them to their real enum values.
  4. Added assignedCoordinatorId handling in the update flow. The DTO accepts a coordinator ID rather than a full nested object
  5. Added validateId checks in VolunteersController for both endpoints, returning a 400 for invalid IDs.
  6. Added service and controller tests for both endpoints

✔️ Verification

Ran yarn test. All service and controller tests pass for VolunteersService and VolunteersController.

🏕️ (Optional) Future Work / Notes

Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!

@shreeyaadhikari
shreeyaadhikari marked this pull request as ready for review September 27, 2026 21:14

@dburkhart07 dburkhart07 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A lot of just small nits and general style guidelines that we will follow throughout development. Logic looks really great so far. Ty Shreeya!!!! 🐼

Comment thread .yarnrc.yml
@@ -0,0 +1,6 @@
approvedGitRepositories:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we need this file or the install-state.gz. Can you try deleting these and then running yarn install to see if it reinstalls them? If not, let's keep them removed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm not quite sure how to delete these from the PR.

Comment thread apps/backend/src/volunteers/update-volunteer.dto.ts Outdated
Comment thread apps/backend/src/volunteers/dto/update-volunteer.dto.ts
Comment thread apps/backend/src/volunteers/dto/update-volunteer.dto.ts
Comment thread apps/backend/src/volunteers/dto/update-volunteer.dto.ts
Comment thread apps/backend/src/volunteers/volunteers.service.ts Outdated
Comment thread apps/backend/src/volunteers/volunteers.service.ts Outdated
Comment thread apps/backend/src/volunteers/volunteers.service.spec.ts
Comment thread apps/backend/src/volunteers/volunteers.service.spec.ts Outdated
Comment thread apps/backend/src/volunteers/volunteers.controller.spec.ts
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.

2 participants