fix(orders): allow pickup slot change after order is PRINTED#100
Merged
Conversation
The select-timeslot endpoint previously rejected any order that was not PAID or AWAITING_PICKUP, so customers could not change their pickup slot once an admin marked the order PRINTED. Allow PRINTED orders to change their timeslot. The status is preserved (PRINTED -> PRINTED) so no invalid state transition occurs, and the previous timeslot's bookedCount is correctly decremented.
Pin the Node runtime to v24 everywhere the version is declared: - .nvmrc: lts/* -> 24 - package.json engines.node: >=20 -> >=24 - Dockerfile: node:22-slim -> node:24-slim (builder + runner) - docker-entrypoint.sh / scripts/docker-build-step.sh: comment refs updated CI (actions/setup-node) reads node-version-file: .nvmrc, so it picks up 24 automatically.
choden-dev
added a commit
that referenced
this pull request
Jul 17, 2026
…tend) (#101) 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
The order state machine did not allow the pickup slot to be changed once an order had been marked
PRINTED. ThePOST /api/shop/:orderId/select-timeslotendpoint rejected any order whose status was notPAIDorAWAITING_PICKUP, so a customer could no longer change their pickup slot after an admin printed the order.Fix
app/api/shop/[orderId]/select-timeslot/route.ts:PRINTEDorders through the status guard (in addition toPAIDandAWAITING_PICKUP).PRINTEDas a change rather than a first-time selection, so:PRINTED→PRINTED) — no invalid state transition, and the admin still sees the order as printed;bookedCountis correctly decremented and the new slot's incremented.No frontend change is required —
OrderSteps.tsxalready permits navigating to the PICKUP step to change the slot forPRINTEDorders.Testing
biome checkpasses on the changed file.