Skip to content

SSF-153 Volunteer Create Order Endpoint#126

Open
Juwang110 wants to merge 18 commits intomainfrom
jw/ssf-153-volunteer-create-order-endpoint
Open

SSF-153 Volunteer Create Order Endpoint#126
Juwang110 wants to merge 18 commits intomainfrom
jw/ssf-153-volunteer-create-order-endpoint

Conversation

@Juwang110
Copy link

ℹ️ Issue

(https://vidushimisra.atlassian.net/browse/SSF-153)

📝 Description

This PR adds an endpoint for volunteers to create a new order. There is a lot of criteria going into this route with lots of checks and side effects, the ticket details what I mean.

There were a decent amount of new routes that had to be added for this functionality to work. Here is the list:
/create-multiple in allocations
/associated-donations, /all, /set-quantities, in donation items
/match-all in donations
/create in order

✔️ Verification

I tested functionality of all backend routes with Postman and I also wrote and made sure all tests passed.

🏕️ (Optional) Future Work / Notes

As a note, there are no tests for allocations, and no service tests yet for donation items. These will be added in a future ticket.

Copy link
Member

@amywng amywng left a comment

Choose a reason for hiding this comment

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

r1

@Juwang110 Juwang110 requested a review from amywng March 12, 2026 14:40
@Juwang110 Juwang110 requested a review from amywng March 13, 2026 14:59
Copy link
Member

@amywng amywng left a comment

Choose a reason for hiding this comment

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

last few nits and a note of consideration @sam-schu @Yurika-Kan : the order create method does 4 db operations across 4 different tables but if one of the steps fails then the db could reflect a partially updated state (e.g. reservedQuantities aren't set but orders are made, or donations aren't matched). i looked into it and we could maybe wrap this in a transaction so that all operations succeed or are rolled back/fail. thoughts?

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.

Thanks for making separate service functions to better organize the logic not directly related to orders! What was the rationale for making endpoints corresponding to all of those service functions?

Also, agreeing with @amywng that using a transaction to make the database updates all-or-nothing is a great idea

@Juwang110 Juwang110 requested review from amywng and sam-schu March 15, 2026 16:06
Copy link
Member

@amywng amywng left a comment

Choose a reason for hiding this comment

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

one small nit but other than that LGTM!!!

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