fix:allow item quantity changes only for pending orders
Runner Test / test (push) Successful in 18s
Runner Test / test (pull_request) Successful in 16s

This commit is contained in:
Abdulaziz Salim Said AL-Gharbi
2026-10-01 19:11:44 +04:00
parent 82ed809f32
commit 7069a7801f
4 changed files with 22 additions and 8 deletions
+6
View File
@@ -1,3 +1,9 @@
export const orderStatuses = ["pending", "processing", "shipped", "cancelled", "refunded"] as const;
export type OrderStatus = (typeof orderStatuses)[number];
// Item quantities can only be adjusted before fulfillment starts. Shared so the UI
// matches the API rule; the API stays the authoritative check.
export function canEditOrderItems(status: OrderStatus) {
return status === "pending";
}