fix(admin): validate co-load routes by business code
This commit is contained in:
@@ -91,6 +91,7 @@ export interface UnifiedOrderResource {
|
||||
internalOrderStatus: string | null
|
||||
customerId: number | string | null
|
||||
customerName: string | null
|
||||
channelCode: string | null
|
||||
channelName: string | null
|
||||
receivingWarehouseId: number | string | null
|
||||
receivingWarehouseName: string | null
|
||||
@@ -328,6 +329,11 @@ function id(value: number | string | null | undefined) {
|
||||
return value === null || value === undefined || value === '' ? null : String(value)
|
||||
}
|
||||
|
||||
function optionalText(value: string | null | undefined) {
|
||||
const normalized = value?.trim()
|
||||
return normalized || null
|
||||
}
|
||||
|
||||
function queryParams(query: UnifiedOrderQuery) {
|
||||
return Object.fromEntries(Object.entries(query).filter(([, value]) => value !== undefined && value !== ''))
|
||||
}
|
||||
@@ -338,6 +344,7 @@ function normalizeRow(raw: UnifiedOrderResource): UnifiedOrderResource {
|
||||
orderId: String(raw.orderId),
|
||||
tenantId: String(raw.tenantId),
|
||||
customerId: id(raw.customerId),
|
||||
channelCode: optionalText(raw.channelCode),
|
||||
receivingWarehouseId: id(raw.receivingWarehouseId),
|
||||
destinationWarehouseId: id(raw.destinationWarehouseId),
|
||||
inboundId: id(raw.inboundId),
|
||||
|
||||
Reference in New Issue
Block a user