refactor pending or processing #23

Open
riso8739 wants to merge 1 commits from ld-refactor-order-status into master
Collaborator

Summary

Clarify order status rules by extracting the repeated pending-or-processing check. Preserve each action’s existing permissions.

Ticket / Assignment

  • Ticket: Assignment 4 #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.

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
riso8739 added 1 commit 2026-10-07 20:48:26 +00:00
refactor pending or processing
Runner Test / test (push) Successful in 17s
Runner Test / test (pull_request) Successful in 16s
f0c2c11f8e
All checks were successful
Runner Test / test (push) Successful in 17s
Runner Test / test (pull_request) Successful in 16s
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.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ld-refactor-order-status:ld-refactor-order-status
git checkout ld-refactor-order-status
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#23