Skip to content

Conversation

@amywng
Copy link
Member

@amywng amywng commented Oct 9, 2025

ℹ️ Issue

Closes SSF-64

📝 Description

  • Updated GET /users/volunteers to return a volunteer's assigned pantry IDs
  • Added GET /users/{id}/pantries endpoint to get pantry info about volunteer's assigned pantries
  • Added PATCH /users/{id}/pantries endpoint to assign list of pantries to a volunteer

✔️ Verification

Screenshot 2025-10-06 at 9 28 11 PM Screenshot 2025-10-06 at 9 28 54 PM Screenshot 2025-10-06 at 9 29 04 PM Screenshot 2025-10-06 at 9 33 19 PM Screenshot 2025-10-06 at 9 35 22 PM Screenshot 2025-10-06 at 9 35 38 PM

🏕️ (Optional) Future Work / Notes

Need to write tests.

@PrimaryColumn({ name: 'pantry_id' })
pantryId: number;

@ManyToOne(() => User, { nullable: false, onDelete: 'CASCADE' })

Choose a reason for hiding this comment

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

Note for @sam-schu : I did not know about this onDelete: 'CASCADE' feature. For future work, should look into other entities to see where we may want to add this, as its quite useful.

Copy link
Collaborator

Choose a reason for hiding this comment

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

me neither!

Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

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

Few changes that I think would be helpful! Other than that lgtm!

@amywng amywng force-pushed the acw/SSF-64-volunteer-backend branch 3 times, most recently from b5d2a30 to 619fbf3 Compare November 26, 2025 17:38
@amywng amywng removed the blocked label Nov 26, 2025
Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

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

Few small changes

@amywng amywng requested a review from dburkhart07 November 27, 2025 01:48
Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

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

Few final changes!

@amywng amywng requested a review from dburkhart07 November 28, 2025 12:57
Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

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

2 small changes to make, but other than that lgtm!! 🍡 🔢

Copy link
Collaborator

@sam-schu sam-schu left a comment

Choose a reason for hiding this comment

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

Initial thoughts:

  • Could we simplify some of the users service logic by adding into the user entity a many-to-many relationship with pantries that would allow you to directly access all the pantries assigned to a volunteer through the user repo? Going through the user repo should be cleaner than having to manually access the junction table
  • With any remaining logic that requires directly accessing the assignments or pantry entities (hopefully not that much), could we make service functions in the corresponding services for that logic so we only directly access the user repo in the users service?

@PrimaryColumn({ name: 'pantry_id' })
pantryId: number;

@ManyToOne(() => User, { nullable: false, onDelete: 'CASCADE' })
Copy link
Collaborator

Choose a reason for hiding this comment

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

me neither!

@amywng amywng force-pushed the acw/SSF-64-volunteer-backend branch from 49f97bb to 192c9a5 Compare November 29, 2025 20:23
@amywng amywng force-pushed the acw/SSF-64-volunteer-backend branch from 113d065 to 1205abc Compare November 29, 2025 21:39
Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

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

Few small changes 🥜

@amywng amywng requested a review from dburkhart07 November 30, 2025 18:53
@amywng amywng force-pushed the acw/SSF-64-volunteer-backend branch from b13da6b to 8600652 Compare November 30, 2025 21:11
@amywng amywng force-pushed the acw/SSF-64-volunteer-backend branch from 8600652 to 76c4a47 Compare December 1, 2025 00:39
Copy link

@dburkhart07 dburkhart07 left a comment

Choose a reason for hiding this comment

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

LGTM!! 🎲

Copy link
Collaborator

@sam-schu sam-schu left a comment

Choose a reason for hiding this comment

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

Just two nits, looks great! Awesome we're getting rid of a whole module :)

@amywng amywng merged commit bc0f539 into main Dec 4, 2025
1 check failed
@amywng amywng deleted the acw/SSF-64-volunteer-backend branch December 4, 2025 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants