新增接单平台第一期闭环
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
export const WORK_ORDER_STATUS = {
|
||||
PENDING_MATERIAL: 'pending_material',
|
||||
UNASSIGNED: 'unassigned',
|
||||
OPEN: 'open',
|
||||
IN_PROGRESS: 'in_progress',
|
||||
PENDING_ACCEPTANCE: 'pending_acceptance',
|
||||
PROBLEM: 'problem',
|
||||
ACCEPTED: 'accepted',
|
||||
CANCELLED: 'cancelled',
|
||||
} as const
|
||||
|
||||
export type WorkOrderStatus = (typeof WORK_ORDER_STATUS)[keyof typeof WORK_ORDER_STATUS] | (string & {})
|
||||
|
||||
const FINAL_STATUSES = new Set<WorkOrderStatus>([
|
||||
WORK_ORDER_STATUS.ACCEPTED,
|
||||
WORK_ORDER_STATUS.CANCELLED,
|
||||
])
|
||||
|
||||
export function normalizeWorkOrderStatus(value: unknown): WorkOrderStatus {
|
||||
return String(value || '').trim() as WorkOrderStatus
|
||||
}
|
||||
|
||||
export function isWorkOrderFinalStatus(value: unknown): boolean {
|
||||
return FINAL_STATUSES.has(normalizeWorkOrderStatus(value))
|
||||
}
|
||||
Reference in New Issue
Block a user