修改提交

This commit is contained in:
2026-08-11 20:11:00 +08:00
parent acc594655e
commit 917ffa73c7
3 changed files with 12 additions and 6 deletions
@@ -69,11 +69,11 @@ describe('unified orders API contract', () => {
it('normalizes C02 row IDs and keeps inboundId for measurement routing', async () => {
vi.mocked(http.get).mockResolvedValue({ data: {
records: [{ orderId: '90001', tenantId: '208', inboundId: '77', inboundVersion: 3, mainStatus: 'WAIT_MEASURE', customerRemark: '客户备注', latestInternalNote: '最新内部备注', measurement: null, preload: null, loading: null, delivery: null, transport: null }],
records: [{ orderId: '90001', tenantId: '208', inboundId: '77', inboundVersion: 3, mainStatus: 'WAIT_MEASURE', recommendedPalletType: 'STANDARD', locationCodes: 'A0-01, B2-03', customerRemark: '客户备注', latestInternalNote: '最新内部备注', measurement: null, preload: null, loading: null, delivery: null, transport: null }],
page: 1, size: 20, total: 1, pages: 1,
} })
await expect(listPlatformUnifiedOrders({ page: 1, size: 20 })).resolves.toMatchObject({
records: [{ orderId: '90001', tenantId: '208', inboundId: '77', inboundVersion: 3, customerRemark: '客户备注', latestInternalNote: '最新内部备注' }],
records: [{ orderId: '90001', tenantId: '208', inboundId: '77', inboundVersion: 3, recommendedPalletType: 'STANDARD', locationCodes: 'A0-01, B2-03', customerRemark: '客户备注', latestInternalNote: '最新内部备注' }],
})
})
@@ -105,6 +105,9 @@ export interface UnifiedOrderResource {
taxMode?: string | null
fullContainer?: boolean | null
customsInspection?: boolean | null
recommendedPalletType?: string | null
locationCodes?: string | null
/** Legacy aliases retained while older order responses are still deployed. */
totalPalletCount?: number | null
chargeableVolumeCbm?: number | null
volumetricWeightKg?: number | null
@@ -315,6 +318,9 @@ function normalizeRow(raw: UnifiedOrderResource): UnifiedOrderResource {
inboundId: id(raw.inboundId),
inboundVersion: nullableInteger(raw.inboundVersion),
totalPackageCount: nullableInteger(raw.totalPackageCount),
totalPalletCount: nullableInteger(raw.totalPalletCount),
recommendedPalletType: raw.recommendedPalletType ?? null,
locationCodes: raw.locationCodes ?? raw.location ?? null,
measurement: raw.measurement ? {
...raw.measurement,
actualGrossWeightKg: numberValue(raw.measurement.actualGrossWeightKg),