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:
Pending:
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
What changed
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.Manual checks:
Screenshots or recordings
Processing & Shipped:



Pending:
Risks / follow-ups
PR checklist
CONTRIBUTING.mdView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.