SSF-219 New Donation Form Required Fields Backend Updates#190
SSF-219 New Donation Form Required Fields Backend Updates#190Juwang110 wants to merge 2 commits into
Conversation
dburkhart07
left a comment
There was a problem hiding this comment.
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:
- donationItems entity
- manufacturer service getFmDonations function
- donation-details-dto
- We also need to write a migration to reflect these changes in the DB
| itemName: string; | ||
| quantity: number; | ||
| reservedQuantity: number; | ||
| ozPerItem?: number; |
| foodType: FoodType; | ||
| allocatedQuantity: number; | ||
| detailsConfirmed: boolean; | ||
| ozPerItem?: number; |
| }) | ||
| .map((item) => { | ||
| const formData = itemFormData[item.itemId]; | ||
| // Submit is gated on ozPerItem and estimatedValue being filled for every |
There was a problem hiding this comment.
we can delete this comment probably, i think its pretty straightforward
| .filter((item) => { | ||
| const formData = itemFormData[item.itemId]; | ||
| return ( | ||
| formData.ozPerItem !== (item.ozPerItem?.toString() ?? '') || |
There was a problem hiding this comment.
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 ?? '') !== '' && |
There was a problem hiding this comment.
no longer need the ?? for each here
| donation.relevantDonationItems.map((item) => [ | ||
| item.itemId, | ||
| { | ||
| ozPerItem: item.ozPerItem?.toString() ?? '', |
Yurika-Kan
left a comment
There was a problem hiding this comment.
LGTM. This is awesome. Thanks Justin!
Yurika-Kan
left a comment
There was a problem hiding this comment.
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
ℹ️ 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