From af417ca4df3f381d9302016c551bc69ce71d2820 Mon Sep 17 00:00:00 2001 From: Benson Cho <100653148+choden-dev@users.noreply.github.com> Date: Fri, 17 Jul 2026 10:20:04 +1000 Subject: [PATCH] fix(orders): let customers change pickup slot on PRINTED orders (frontend) PR #100 allowed the select-timeslot endpoint to accept PRINTED orders, but the customer-facing frontend never surfaced a way to trigger it: - my-orders.tsx: 'Change Pickup' action was only shown for PAID and AWAITING_PICKUP orders, so a customer with a PRINTED order had no button. - OrderContainer.tsx: navigating via ?pickupFor= only forced the PICKUP step for PAID/AWAITING_PICKUP; PRINTED orders fell through to statusToStep() which sends them to COMPLETE, hiding the timeslot picker. Both now include PRINTED. The PICKUP step already renders TimeslotSelector unconditionally, so the change UI works once the step is reached. --- components/ordercontainer/OrderContainer.tsx | 8 ++++++-- pages/my-orders.tsx | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/components/ordercontainer/OrderContainer.tsx b/components/ordercontainer/OrderContainer.tsx index 5f9f99a..1c2d6d5 100644 --- a/components/ordercontainer/OrderContainer.tsx +++ b/components/ordercontainer/OrderContainer.tsx @@ -114,11 +114,15 @@ const OrderContainerInner = ({ setActiveOrderId(order.id); setActiveOrderNumber(order.orderNumber); - // If pickupFor query param, force pickup step (if order is PAID or AWAITING_PICKUP) + // If pickupFor query param, force pickup step so the customer can + // (re)select their timeslot. PRINTED orders are still allowed to + // change their slot (see select-timeslot route), so include it here + // too — otherwise statusToStep would send them to COMPLETE. if ( pickupForOrderId && (order.status === OrderStatus.PAID || - order.status === OrderStatus.AWAITING_PICKUP) + order.status === OrderStatus.AWAITING_PICKUP || + order.status === OrderStatus.PRINTED) ) { setOrderStep(OrderStep.PICKUP); } else { diff --git a/pages/my-orders.tsx b/pages/my-orders.tsx index 33b4d22..ccc2f5b 100644 --- a/pages/my-orders.tsx +++ b/pages/my-orders.tsx @@ -170,7 +170,10 @@ const MyOrders: NextPage = ({ contactInfo }) => { ); } - if (order.status === OrderStatus.AWAITING_PICKUP) { + if ( + order.status === OrderStatus.AWAITING_PICKUP || + order.status === OrderStatus.PRINTED + ) { return (