Align admin orders with the shop pre-order flow.

Admins create product-based pre-orders, price real line items, reach final approval after cash or checks, and only ship eligible orders.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-10 21:41:09 +03:30
co-authored by Cursor
parent 37cb1ad859
commit f68fd820e7
12 changed files with 411 additions and 153 deletions
+14
View File
@@ -74,6 +74,20 @@ export function canPriceOrder(order: {
return PRE_INVOICE_ADMIN_STATUSES.includes(order.status)
}
export function canFinalApproveOrder(order: { rawStatus?: RawOrderStatus }): boolean {
return order.rawStatus === 'checks_approved' || order.rawStatus === 'cash_confirmed'
}
export const SHIPPABLE_RAW_STATUSES: RawOrderStatus[] = [
'final_approved',
'preparing',
'ready_to_ship',
]
export function canCreateShipment(order: { rawStatus?: RawOrderStatus }): boolean {
return !!order.rawStatus && SHIPPABLE_RAW_STATUSES.includes(order.rawStatus)
}
export const ORDER_TABS = [
{ key: 'all', label: 'همه' },
{ key: 'pending_review', label: 'در انتظار بررسی' },