Backend now rejects quantity edits for processing and shipped orders.
Frontend shows read-only quantities for non-pending orders.
How to test
bun.exe test apps/api/src/orders/order-quantity-assignment-3.test.ts
bun.exe run test
bun.exe run build:web
Manual checks:
Log in as an employee.
Open a pending order and confirm quantity can be edited and saved.
Open a processing order and confirm quantity is read-only.
Open a shipped order and confirm quantity is read-only.
Confirm non-pending orders show the pending-only message and no Save button.
Screenshots or recordings
Risks / follow-ups
Full typecheck is blocked by existing test cookie typing errors.
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 edits are now allowed only for pending orders. Non-pending orders show read only quantities in the UI.
## Ticket / Assignment
- Ticket: [Assignment 3](https://git.letphil.com/derrick/ai-wave-02/issues/15)
## What changed
- Added a shared `canEditOrderItems` rule.
- Backend now rejects quantity edits for processing and shipped orders.
- Frontend shows read-only quantities for non-pending orders.
## How to test
```bash
bun.exe test apps/api/src/orders/order-quantity-assignment-3.test.ts
bun.exe run test
bun.exe run build:web
```
Manual checks:
1. Log in as an employee.
2. Open a pending order and confirm quantity can be edited and saved.
3. Open a processing order and confirm quantity is read-only.
4. Open a shipped order and confirm quantity is read-only.
5. Confirm non-pending orders show the pending-only message and no Save button.
## Screenshots or recordings



## Risks / follow-ups
- Full typecheck is blocked by existing test cookie typing errors.
## 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 edits are now allowed only for pending orders. Non-pending orders show read only quantities in the UI.
Ticket / Assignment
What changed
canEditOrderItemsrule.How to test
Manual checks:
Screenshots or recordings
Risks / follow-ups
PR checklist
CONTRIBUTING.mdView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.