优化
This commit is contained in:
@@ -14,16 +14,32 @@ describe('unified orders API contract', () => {
|
||||
vi.mocked(http.get).mockResolvedValue({ data: { records: [], page: '2', size: '20', total: '0', pages: '0' } })
|
||||
await expect(listPlatformUnifiedOrders({
|
||||
keyword: 'CC', orderNo: 'CC-1', mainStatus: 'WAIT_SPLIT', customerId: '30001',
|
||||
receivingWarehouseId: '11', destinationWarehouseId: '22', page: 2, size: 20,
|
||||
receivingWarehouseId: '11', destinationWarehouseId: '22', inboundCode: 'RK-1', internalOrderStatus: 'ACCEPTED',
|
||||
expectedArrivalDate: '2026-08-10', feeReviewStatus: 'APPROVED', channelName: '海运', containerNo: 'CONT-1',
|
||||
cabinetNo: 'CAB-1', sailingDate: '2026-08-12', loaded: true, fullContainer: false,
|
||||
measurementReviewStatus: 'PENDING', fbaCode: 'FBA-1', createdFrom: '2026-08-01T00:00:00',
|
||||
createdTo: '2026-08-31T23:59:59', page: 2, size: 20,
|
||||
})).resolves.toMatchObject({ page: 2, size: 20, total: 0, pages: 0 })
|
||||
expect(http.get).toHaveBeenCalledWith('/platform/v1/orders', {
|
||||
params: {
|
||||
keyword: 'CC', orderNo: 'CC-1', mainStatus: 'WAIT_SPLIT', customerId: '30001',
|
||||
receivingWarehouseId: '11', destinationWarehouseId: '22', page: 2, size: 20,
|
||||
receivingWarehouseId: '11', destinationWarehouseId: '22', inboundCode: 'RK-1', internalOrderStatus: 'ACCEPTED',
|
||||
expectedArrivalDate: '2026-08-10', feeReviewStatus: 'APPROVED', channelName: '海运', containerNo: 'CONT-1',
|
||||
cabinetNo: 'CAB-1', sailingDate: '2026-08-12', loaded: true, fullContainer: false,
|
||||
measurementReviewStatus: 'PENDING', fbaCode: 'FBA-1', createdFrom: '2026-08-01T00:00:00',
|
||||
createdTo: '2026-08-31T23:59:59', page: 2, size: 20,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('omits empty optional filters while preserving false boolean values', async () => {
|
||||
vi.mocked(http.get).mockResolvedValue({ data: { records: [], page: 1, size: 20, total: 0, pages: 0 } })
|
||||
await listPlatformUnifiedOrders({ keyword: '', loaded: false, fullContainer: false, page: 1, size: 20 })
|
||||
expect(http.get).toHaveBeenCalledWith('/platform/v1/orders', {
|
||||
params: { loaded: false, fullContainer: false, page: 1, size: 20 },
|
||||
})
|
||||
})
|
||||
|
||||
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', measurement: null, preload: null, loading: null, delivery: null, transport: null }],
|
||||
|
||||
Reference in New Issue
Block a user