1. Order Details page (OrderDetails.tsx)
- A Cancel button shows only when the order is eligible, and only to signed-in users. Signed-out users see "Sign in to cancel this order."
- A green banner shows the refunded amount, for example "$29.19 refunded to your original payment method". It also says card refunds take 5–10 business days.
- Each cancelled line shows a Cancelled tag and "Refund $X", with its own paid breakdown (discounts, tax, shipping).
- It has the cancellation refund summary and the order status timeline.
2. Item Cancel modal (ItemCancelModal.tsx)
- The customer ticks the items to cancel and enters a reason.
- It shows the product's cancellation policy message.
- Items that can't be cancelled show "Unavailable" with the reason, such as "Cancellation request is already pending", or already delivered.
- A "Cancellation requests" history lists the request status, staff review note, refund status and recovery status.
3. Cancellation Management page (/dashboard/cancellation-management, CancellationManagement.tsx)
- It holds the other two admin screens as tabs and has a Back button.
- It shows a short 3-step guide: review the request, execute the cancellation, then track the refund and goods.
4. Requests and recovery tab (CancellationQueue.tsx)
- Summary cards act as filters: To approve / cancel, In progress, Refund problems, Goods coming back, All requests.
- Search by order number.
- A table with a "Your next step" column. Examples are "Approve or reject", "Cancel the items" and "Fix the refund".
- An action history timeline per request: requested, cancelled, refunded, goods received, stock added back.
- Export to CSV, Refresh, and an "Open order" button that jumps to the order.
5. Refunds and money tracking tab (/dashboard/cancellation-money, CancellationMoneyTracking.tsx)
- Totals: refund attempts, refunded, in progress, needs attention.
- Filter by status (Refunded, In progress, Action needed, Sending, Check needed, Failed, Canceled) and search by order.
- A details drawer showing the amount asked, amount refunded, Stripe refund ID, Stripe payment ID, timestamps and any error.
- A Check with Stripe button re-checks a refund whose outcome is unknown.
- Export to CSV and Refresh.
6. Order cancellation panel (inside the admin order view, OrderCancellationPanel.tsx)
- Approve a request, with a partner confirmation reference for each item.
- Reject a request, with a required note.
- Execute an approved cancellation, which cancels the items and starts the refund.
- Repair skipped refund for requests where the refund didn't go through.
- Goods recovery: Receive goods (quantity plus a unique receipt reference), then Inspect them as "Suitable for stock" or "Damaged / unusable". A Reconcile button fixes recovery items stuck in review.
- Inspect order operation and Refresh Stripe refunds buttons.
- Warning alerts for refund errors, inventory errors, adjustment errors and refund notification errors.
7. Cancellation policy section (inside Create Product, CancellationPolicySection.tsx)
- A switch to inherit the policy from the product.
- A switch to allow customer cancellation.
- A switch to allow requests after the delivery partner has collected the item.
- The last permitted stage: before packing, before partner handover, after collection, in transit, or out for delivery.
- Approval before collection: automatic or by staff.
- A time limit in days, hours and minutes, or no limit.
- An optional message shown to the customer.
8. Menu access: the cancellation pages are limited by role. See roleMenuAccess.ts.
If you want these notes as a file (for example CANCELLATION_FEATURES.md), say so and I'll write it. I haven't covered the return request screens (ReturnRequestsPage, OrderReturnTrackingPanel, ReturnRequestModal). I can add those too.
Created a new company and tested orders containing multiple products, including cancelled products. Updated the order display logic to exclude cancelled products from the total product count and show only the active products in each order. Also ensured the overall product count and individual product quantities are calculated and displayed correctly.
- Implemented a centralized Stripe refund tracking page with refund summary cards, order search, status filters, refund transaction details, Stripe refund IDs, transaction dates, refund history, order navigation, CSV export, refresh, and pagination to monitor and manage refund transactions efficiently.