Requested Changes + New Lil Features#200
Conversation
Add a shippingCostPaidBySsf flag to orders (migration + entity + bulk tracking DTO) and surface it through manufacturer donation details and pantry stats. SSF-paid shipping is now excluded from totalShippingCost and reported separately as totalShippingCostPaidBySsf. Also adds the foodRescueLbs pantry stat. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add foodManufacturerId to CreateDonationDto and pass it from the new donation and resubmit donation forms. Also tweaks the fair-market-value column header copy on the new donation form. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Display the recurring-reminders indicator and the list of upcoming reminder email dates for recurring donations in the donation details modal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Route pending pantry applications to PANTRY_APPLICATION_DETAILS (keyed by applicationId) instead of PANTRY_MANAGEMENT_DETAILS, which expected a pantryId and was being given an application id. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add Role.ADMIN to the /volunteers/:id/pantries endpoint so admins can read a volunteer's assigned pantries. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c735f05 to
b621dd7
Compare
dburkhart07
left a comment
There was a problem hiding this comment.
3 small things. also getting some errors with closed donations in the adminOrderManagement page i think. since theres a lot of changes here, can you merge main so that we can smoke test all these pages in full?
- Remove foodManufacturerId from CreateDonationDto and its create-endpoint CheckOwnership. donations.service.create resolves the manufacturer from the authenticated user (req.user.id), so the body id and the ownership check were dead weight; @roles(FOODMANUFACTURER) already gates it. Also collapses a duplicate @roles decorator on the create handler. - Drop foodManufacturerId from the frontend CreateDonationDto type and the new/resubmit donation forms and their container props. - Replace the read-only "Make Donation Recurring Reminders" checkbox in the donation details modal with a bold "Recurring Donation" label. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # apps/frontend/src/components/forms/donationDetailsModal.tsx # apps/frontend/src/components/forms/newDonationFormModal.tsx
Follows the DTO field removal so donations.service.spec compiles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Prettier cleanup of the over-indented recurrence lines left behind by dropping foodManufacturerId from CreateDonationDto. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dburkhart07
left a comment
There was a problem hiding this comment.
few things. see slack as well for other comments
A food-manufacturer representative was tied to a single manufacturer (findByUserId returned one arbitrary FM), so someone representing more than one couldn't donate for each and the approval check keyed off the wrong manufacturer. Backend: - Map foodManufacturerRepresentative as @manytoone so manufacturers can share a representative; approval reuses an existing Cognito-provisioned account by email instead of failing on the second approval. - POST /donations now requires foodManufacturerId, gated by CheckOwnership plus an approval check for that specific manufacturer. - Add GET /manufacturers/me (rep's approved manufacturers); aggregate donations, dashboard stats, and reminders across all of a rep's approved manufacturers. /manufacturers/my-id returns the lowest-id approved one. - Remove the now-unused findByUserId. Frontend: - Log-donation modal adds a manufacturer dropdown, defaulting to the most recent donation's manufacturer; resubmit targets the donation's own manufacturer; the donation list shows a manufacturer column when donations span more than one. Also widens two BulkUpdate/OrderSummary types to allow null, which code already on this branch depends on to typecheck. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When a volunteer is removed from a pantry, their open (pending/shipped) orders for that pantry become unassigned; when a volunteer is added, that volunteer inherits the pantry's unassigned open orders. Delivered/closed orders keep their historical assignee. - Make orders.assignee_id nullable (migration + entity) - Unassign/inherit cascade in updatePantryVolunteers, wrapped in a transaction with the volunteer-save so it can't half-apply - Null-safe order reads, ownership resolver, and volunteer emails (fall back to SSF contact / skip when unassigned) - Frontend: render an Unassigned state on admin/pantry order tables and dashboards - Cascade tests in pantries.service.spec.ts Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| {filteredDonations.length === 0 ? ( | ||
| <PageEmptyState entity="donations" /> | ||
| ) : ( |
| {filteredRequests.length === 0 ? ( | ||
| <PageEmptyState entity="food requests" /> | ||
| ) : ( |
| totalDonatedFoodValue, | ||
| totalShippingCost, | ||
| totalShippingCostPaidBySsf, | ||
| totalValue: totalDonatedFoodValue + totalShippingCost, | ||
| percentageFoodRescueItems: |
dburkhart07
left a comment
There was a problem hiding this comment.
approving pending just some small comments
| req.user.id, | ||
| ); | ||
|
|
||
| const approved = manufacturers |
There was a problem hiding this comment.
for this, and the logic below, can we move this into the service function? maybe a new service function like findApprovedManufacturersByUserId, and just add that in there?
| pantryName: request.pantry.pantryName, | ||
| volunteerName: `${assignee.firstName} ${assignee.lastName}`, | ||
| volunteerEmail: assignee.email, | ||
| volunteerName: assignee |
There was a problem hiding this comment.
can we reuse the function you wrote in order.service.ts here?
| const totalShippingCost = shippingMap.get(Number(row.pantryId)) ?? 0; | ||
| const totalFoodRescueItems = Number(row.totalFoodRescueItems); | ||
| const shipping = shippingMap.get(Number(row.pantryId)); | ||
| const totalShippingCost = shipping?.totalShippingCost ?? 0; |
There was a problem hiding this comment.
confirming that totalShippingCost includes totalShippingCostPaidBySsf?
| return this.pantriesService.getDashboardStats(pantry.pantryId); | ||
| } else if (user.role === Role.FOODMANUFACTURER) { | ||
| const foodManufacturer = await this.foodManufacturersService.findByUserId( | ||
| return this.foodManufacturersService.getDashboardStatsForRepresentative( |
There was a problem hiding this comment.
we should create a function like this for the pantry
| const dto: CreateDonationDto = { | ||
| // Resubmit under the original donation's manufacturer, since the list | ||
| // can span multiple manufacturers the representative belongs to. | ||
| foodManufacturerId: |
There was a problem hiding this comment.
why do we need this check? why cant we just use foodManufacturerId?
ℹ️ Issue
SSF-236
📝 Description
Changes:
7/12
Pantry Management Unassign & Reassign Volunteers:
1 User Representative: M FMs
Admin Donation Stats Page wording:
Admin Donation Management
Updated Wording:

FM Confirm Delivery Action Modal - new boolean checkbox determines if shipping cost was paid by SSF


Admin Dashboard Applications Bug:
FM Submit Donation Bug:
Login & Sign up Page:
Pantry/FM Application Form:
remove last checkbox: "By submitting this form, you agree to receive automated emails..."
auth gated GET /volunteers/:id/pantries to also allow ADMIN
✔️ Verification
🏕️ (Optional) Future Work / Notes