[SSF 227] - Volunteer archive and edit orders backend#193
Open
dburkhart07 wants to merge 3 commits into
Open
Conversation
Yurika-Kan
requested changes
Jun 25, 2026
Yurika-Kan
left a comment
Collaborator
There was a problem hiding this comment.
looking pretty good~ crucial questions about donation status setting tho!
| donationItemId?: number; | ||
|
|
||
| @IsInt() | ||
| @Min(1) |
Collaborator
There was a problem hiding this comment.
in the case that we want to omit an item from being part of the update, we would want this value to be 0~ this contradicts the service logic that treats 0 as a legal drop
Author
There was a problem hiding this comment.
the way i intend for this to be used in the frontend is this:
- passing in an allocationId means you want to edit an existing allocations quantity to a new number (just decrease it, not delete it)
- passing in a donationItemId means you want to add a new allocation to the order
both cases above require the allocated quantity to be at minimum 1.
all allocations not included in here (which will happen if they are set to 0), will then be free'd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ℹ️ Issue
Closes #227
📝 Description
NOTE: For editing allocations, the way I designed it was that the dto would take in an allocationId or donationItemId. Should the allocationId be provided, it would be an edited allocation that already exists in the order. Should it be a donationItemId, it is a new allocation to be created for that order. Finally, all existing allocations that are do not get their ids provided will be assumed to be deleted. I made sure to check that all the donationItemIds involved in the editing are part of the donations from the food manufacturers, and all donations affected as assessed to see if they'ev either beomce matched or available as a result to gaining or losing allocations.
✔️ Verification
🏕️ (Optional) Future Work / Notes
We will have to account for this setup in our frontend implementation so that no allocations with a 0 quantity for the order get sent to the backend.