fix(admin): validate co-load routes by business code

This commit is contained in:
2026-08-31 15:50:05 +08:00
parent afbee83b51
commit 1a81a5a2b6
5 changed files with 70 additions and 13 deletions
@@ -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),