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

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