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:
@@ -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: 'در انتظار بررسی' },
|
||||
|
||||
Reference in New Issue
Block a user