优化
This commit is contained in:
@@ -6,7 +6,7 @@ vi.mock('@/shared/api/overseasHttp', () => ({ overseasHttp: overseas }))
|
||||
import {
|
||||
createLocalLooseboardOrder, createUsTruckOrder, getLocalLooseboardOrder, getOverseasPurchase, getUsTruckOrder,
|
||||
listLocalLooseboardOrders, listOverseasPurchaseCustomerOptions, listOverseasPurchases,
|
||||
listOverseasPurchaseWarehouseOptions, listUsTruckOrders, updateLocalLooseboardOrder, updateOverseasPurchase,
|
||||
listOverseasPurchaseWarehouseOptions, listUsTruckOrders, reviewOverseasPurchase, updateLocalLooseboardOrder, updateOverseasPurchase,
|
||||
updateUsTruckOrder,
|
||||
} from './platformOverseasBusiness'
|
||||
import type { UpdateLocalTransportOrderRequest } from '../types'
|
||||
@@ -57,6 +57,16 @@ describe('platform overseas business API adapter', () => {
|
||||
expect(overseas.patch).toHaveBeenCalledWith('/platform/v1/last-leg/overseas-procurements/OP-1', payload, { params: { customerId: '10001' } })
|
||||
})
|
||||
|
||||
it('submits procurement review with version and idempotency data', async () => {
|
||||
const detail = { summary: { ...purchaseSummary, status: 'APPROVED', version: 5 }, histories: [] }
|
||||
overseas.post.mockResolvedValue(envelope(detail))
|
||||
const payload = { version: 4, decision: 'APPROVE' as const, idempotencyKey: 'review-key', remark: '资料齐全' }
|
||||
const result = await reviewOverseasPurchase('OP/1', '10001', payload)
|
||||
expect(overseas.post).toHaveBeenCalledWith('/platform/v1/last-leg/overseas-procurements/OP%2F1/review', payload, { params: { customerId: '10001' } })
|
||||
expect(result.status).toBe('APPROVED')
|
||||
expect(result.version).toBe(5)
|
||||
})
|
||||
|
||||
it('supports platform truck list/detail/create/update without status endpoints', async () => {
|
||||
const detail = { summary: truckSummary, pallets: [{ id: '9007199254741001', warehousePalletId: '9007199254741003', palletNo: 'P-1' }], histories: [] }
|
||||
overseas.get.mockResolvedValueOnce(envelope({ records: [truckSummary], page: '1', size: '20', total: '1', pages: '1' })).mockResolvedValueOnce(envelope(detail))
|
||||
|
||||
Reference in New Issue
Block a user