Skip to content

SSF-219 New Donation Form Required Fields Backend Updates#190

Open
Juwang110 wants to merge 2 commits into
mainfrom
jw/ssf-219-new-donation-form-backend-updates
Open

SSF-219 New Donation Form Required Fields Backend Updates#190
Juwang110 wants to merge 2 commits into
mainfrom
jw/ssf-219-new-donation-form-backend-updates

Conversation

@Juwang110

Copy link
Copy Markdown

ℹ️ Issue

Closes https://vidushimisra.atlassian.net/browse/SSF-219

📝 Description

Made it so oz. per item, donation value, and food rescue are required not nullable fields in backend dtos and updated tests.

Frontend: Minor visual changes to reflect these required fields (details in ticket)

✔️ Verification

Verified frontend design and tests passed in backend.

🏕️ (Optional) Future Work / Notes

N/A

@dburkhart07 dburkhart07 self-assigned this Jun 14, 2026

@dburkhart07 dburkhart07 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good, just missed a few spots.

Here are a few others that I think we can make sure we update the fact that these are now required in a few other spots in the backend:

  1. donationItems entity
  2. manufacturer service getFmDonations function
  3. donation-details-dto
  4. We also need to write a migration to reflect these changes in the DB

itemName: string;
quantity: number;
reservedQuantity: number;
ozPerItem?: number;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We need to update these

foodType: FoodType;
allocatedQuantity: number;
detailsConfirmed: boolean;
ozPerItem?: number;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Need to update these too

})
.map((item) => {
const formData = itemFormData[item.itemId];
// Submit is gated on ozPerItem and estimatedValue being filled for every

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

we can delete this comment probably, i think its pretty straightforward

.filter((item) => {
const formData = itemFormData[item.itemId];
return (
formData.ozPerItem !== (item.ozPerItem?.toString() ?? '') ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

these will no longer be optional so they can be changed to just item.ozPerItem.toString()

donation.relevantDonationItems.length > 0 &&
donation.relevantDonationItems.every(
(item) =>
(itemFormData[item.itemId]?.ozPerItem ?? '') !== '' &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

no longer need the ?? for each here

donation.relevantDonationItems.map((item) => [
item.itemId,
{
ozPerItem: item.ozPerItem?.toString() ?? '',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

no longer need these ? either

@Yurika-Kan Yurika-Kan self-requested a review June 20, 2026 22:56
@Yurika-Kan Yurika-Kan self-assigned this Jun 20, 2026

@Yurika-Kan Yurika-Kan 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.

LGTM. This is awesome. Thanks Justin!

@Yurika-Kan Yurika-Kan 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.

actually, could you update the confirm item details page since it is a similar ui?

can we match the required fields logic by having asterisks for the fields & grayed out submit button functionality when some fields are empty. let's ensure there are no workaround ways to submit "partial" donation items with empty required fields!

reword:
Please fill out the missing fields information to record donation details.
to:
Please confirm the following information to record donation details.
Please do not include shipping/delivery costs in Food Donation Value.

add (Fair Market Value of Food Only) to Donation Value

Image

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