fix(orders): let customers change pickup slot on PRINTED orders (frontend)#101
Merged
Merged
Conversation
…tend) 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PR #100 updated the
POST /api/shop/:orderId/select-timeslotendpoint to acceptPRINTEDorders, so the backend now supports customers changing their pickup slot after an admin has printed the order.However, the customer-facing frontend never surfaced a way to trigger this, so in practice only admins could change the timeslot of a printed order. Two frontend touchpoints gated on
PAID/AWAITING_PICKUPonly:pages/my-orders.tsx— the Change Pickup button inrenderOrderActionwas only rendered forPAIDandAWAITING_PICKUPorders. A customer with aPRINTEDorder saw no action button.components/ordercontainer/OrderContainer.tsx— navigating via?pickupFor=<id>only forced thePICKUPstep forPAID/AWAITING_PICKUP. For aPRINTEDorder,statusToStep()returnedCOMPLETE, dropping the user on the confirmation screen instead of the timeslot picker.Fix
my-orders.tsx: show the Change Pickup button forPRINTEDorders too.OrderContainer.tsx: force thePICKUPstep forPRINTEDorders when arriving via?pickupFor=.The
PICKUPstep inOrderSteps.tsxalready rendersTimeslotSelectorunconditionally (andOrderStepsalready allows staying on the PICKUP step forPRINTED), so no further changes were needed once the step is reached. The COMPLETE step's existing Change Pickup button also now works end-to-end for printed orders.Testing
biome checkpasses on both changed files.tsc --noEmitpasses with no errors.