-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Labels
Description
Description:
Build the shipment detail page showing all shipment information, parties, and a sidebar status timeline. The page renders context-aware action buttons based on the user's role and the current shipment status.
Create frontend/app/(dashboard)/shipments/[id]/page.tsx.
Acceptance Criteria:
-
'use client'directive; usesuseParams<{ id: string }>() - Loads shipment and history in parallel:
Promise.all([shipmentApi.getById(id), shipmentApi.getHistory(id)]) - Shows loading skeleton while fetching; shows "not found" state with back button if null
- Layout: 3-column grid (left 2 cols: details + actions; right 1 col: timeline) on
lg+ - Details cards: Cargo (description, weight, volume, price), Parties (shipper name, carrier name or "—")
- Action buttons (in their own
<Card>):PENDING+ not shipper → "Accept Job" button (carrier)ACCEPTED+ assigned carrier → "Mark Picked Up" buttonIN_TRANSIT+ assigned carrier → "Mark Delivered" buttonDELIVERED+ shipper → "Confirm Delivery" buttonPENDINGorACCEPTED+ (shipper or carrier or admin) → "Cancel" outline buttonIN_TRANSITorDELIVERED+ (shipper or carrier) → "Raise Dispute" destructive buttonDISPUTED+ admin → "Resolve: Complete" and "Resolve: Cancel" buttonsCOMPLETEDorCANCELLED→ "No further actions" message
- All actions: call API,
toast.success/error, then re-fetch (reload()) - Action buttons disabled while
actionLoadingis true -
<StatusTimeline history={history} />in the right column
Reactions are currently unavailable