# Step 10 — Order management validation

## Migration
- [ ] Backup the NEW ResellBD database.
- [ ] Apply `database/migrations/004_order_management.sql` after migrations 001–003.
- [ ] Confirm `orders.status` contains `packed` and `order_status_history` exists.

## Lifecycle
- [ ] Place COD order; history starts at pending.
- [ ] pending → confirmed succeeds; pending → delivered is rejected.
- [ ] confirmed → processing → packed → shipped → delivered succeeds.
- [ ] Delivered order consumes reserved inventory once and writes a sale stock log.
- [ ] pending/confirmed cancellation releases reservations and writes release stock logs.
- [ ] Invalid status change leaves order and stock unchanged.
- [ ] Returned status can only be reached from shipped/delivered; returned stock is not automatically restocked.

## Access and UI
- [ ] Customer cannot open admin order pages.
- [ ] Admin can search/filter and view order details/history.
- [ ] Invoice page prints cleanly and can be saved as PDF from the browser print dialog.
- [ ] Customer sees only orders associated with their account; public tracking requires order number + phone.

## Live checks still required
- [ ] Real MySQL transaction and concurrent update tests.
- [ ] Browser/mobile layout, print layout, and all role permissions.
