fix: restrict order quantity edits to pending orders #16

Open
cq0622 wants to merge 1 commits from fix/order-quantity-validation into master
Collaborator

Summary

Quantity editing was available for processing orders. This fix limits edits to pending orders in both the UI and API; direct requests for non-pending orders return HTTP 400.

Ticket / Assignment

  • Ticket: Order quantity lifecycle validation (assignment 3)

What changed

  • Allow item quantity edits only while an order is pending.
  • Display quantities read-only for non-pending orders.
  • Preserve the existing quantity and inventory validation rules.

How to test

  • bun test apps/api/src/orders/order-quantity-assignment-3.test.ts — 5 passed, 0 failed.
  • bun run test — 21 passed, 0 failed.
  • bun run check:web — passed.
  • bun run build:web — passed.
  • bun run check — blocked by pre-existing type errors in two untouched assignment test files.
bun run test
bun run build:web

Manual checks:

  • Pending order: quantity form visible and editable.
  • Processing and shipped orders: quantity displayed read-only.

Screenshots or recordings

Processing & Shipped:
image.png
image.png
Pending:
image.png

Risks / follow-ups

PR checklist

  • change is scoped to one ticket or one small reviewable concern
  • acceptance criteria were checked
  • code follows CONTRIBUTING.md
  • no unrelated refactor is mixed in
  • debug code and temporary logs are removed
  • relevant automated checks were run locally
  • changed behavior was manually tested when needed
  • known risks or follow-ups are called out
## Summary Quantity editing was available for processing orders. This fix limits edits to pending orders in both the UI and API; direct requests for non-pending orders return HTTP 400. ## Ticket / Assignment - Ticket: Order quantity lifecycle validation (assignment 3) ## What changed - Allow item quantity edits only while an order is pending. - Display quantities read-only for non-pending orders. - Preserve the existing quantity and inventory validation rules. ## How to test - `bun test apps/api/src/orders/order-quantity-assignment-3.test.ts` — 5 passed, 0 failed. - `bun run test` — 21 passed, 0 failed. - `bun run check:web` — passed. - `bun run build:web` — passed. - `bun run check` — blocked by pre-existing type errors in two untouched assignment test files. ```bash bun run test bun run build:web ``` Manual checks: - Pending order: quantity form visible and editable. - Processing and shipped orders: quantity displayed read-only. ## Screenshots or recordings Processing & Shipped: <img width="856" alt="image.png" src="attachments/fa7ccbd8-3c4a-489b-b379-0972641fb574"> <img width="860" alt="image.png" src="attachments/79fc905c-fc30-4d86-8d95-9fd475eb1ba7"> Pending: <img width="851" alt="image.png" src="attachments/8ef77ee4-3b92-478c-b4a9-927545e9a69e"> ## Risks / follow-ups - - ## PR checklist - [x] change is scoped to one ticket or one small reviewable concern - [x] acceptance criteria were checked - [x] code follows `CONTRIBUTING.md` - [x] no unrelated refactor is mixed in - [x] debug code and temporary logs are removed - [x] relevant automated checks were run locally - [x] changed behavior was manually tested when needed - [x] known risks or follow-ups are called out
cq0622 added 1 commit 2026-09-29 04:22:16 +00:00
fix: restrict order quantity edits to pending orders
Runner Test / test (push) Successful in 36s
Runner Test / test (pull_request) Successful in 15s
7dac01acb7
cq0622 requested review from derrick 2026-09-29 04:22:21 +00:00
cq0622 removed review request for derrick 2026-09-29 04:23:06 +00:00
cq0622 requested review from derrick 2026-09-29 04:27:33 +00:00
All checks were successful
Runner Test / test (push) Successful in 36s
Runner Test / test (pull_request) Successful in 15s
This pull request doesn't have enough required approvals yet. 0 of 1 approvals granted from users or teams on the allowlist.
You are not authorized to merge this pull request.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/order-quantity-validation:fix/order-quantity-validation
git checkout fix/order-quantity-validation
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: derrick/ai-wave-02#16