-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Labels
Description
Description:
Build the multi-section form for shippers to create a new shipment. The form uses react-hook-form + zod and is grouped into logical card sections: Route, Cargo Details, Pricing, Schedule & Notes.
Create frontend/app/(dashboard)/shipments/new/page.tsx.
Acceptance Criteria:
-
'use client'directive - Zod schema validates all fields — see
CreateShipmentDtofor rules - Form sections (each in a
<Card>):- Route — origin, destination (side by side on sm+)
- Cargo Details — description textarea (min 10), weight, optional volume
- Pricing — price, currency (default USD)
- Schedule & Notes — pickupDate, estimatedDeliveryDate (datetime-local inputs), notes textarea
- Submit calls
shipmentApi.create(payload), thentoast.success+router.push(/shipments/${shipment.id}) - On error:
toast.error() - Submit button disabled + shows "Creating…" while submitting
- Cancel button calls
router.back() - All field errors shown inline below the relevant input
Reactions are currently unavailable