Added private isPendingOrProcessing helper in apps/api/src/orders/order status.ts, used by shipping edits and cancellation.
Added apps/api/src/orders/order-status.test.ts with 15 checks covering all three predicates across all five statuses.
How to test
List exact commands and manual checks.
bun test apps/api/src/orders/order-status.test.ts
bun run test
bun run check
Manual checks:
Reviewed the status matrix:
Made sure everything worked as normal on frontend browser
Screenshots or recordings
N/A
Risks / follow-ups
Existing API typecheck errors need a separate fix.
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
Clarify order status rules by extracting the repeated pending-or-processing check. Preserve each action’s existing permissions.
## Ticket / Assignment
- Ticket: Assignment 4 https://git.letphil.com/derrick/ai-wave-02/issues/22
## What changed
- Added private `isPendingOrProcessing` helper in `apps/api/src/orders/order status.ts`, used by shipping edits and cancellation.
- Added `apps/api/src/orders/order-status.test.ts` with 15 checks covering all three predicates across all five statuses.
## How to test
List exact commands and manual checks.
```bash
bun test apps/api/src/orders/order-status.test.ts
bun run test
bun run check
```
Manual checks:
- Reviewed the status matrix:
- Made sure everything worked as normal on frontend browser
## Screenshots or recordings
`N/A`
## Risks / follow-ups
- Existing API typecheck errors need a separate fix.
## 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
Clarify order status rules by extracting the repeated pending-or-processing check. Preserve each action’s existing permissions.
Ticket / Assignment
What changed
isPendingOrProcessinghelper inapps/api/src/orders/order status.ts, used by shipping edits and cancellation.apps/api/src/orders/order-status.test.tswith 15 checks covering all three predicates across all five statuses.How to test
List exact commands and manual checks.
Manual checks:
Screenshots or recordings
N/ARisks / follow-ups
PR checklist
CONTRIBUTING.mdView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.