优化
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
acceptPlatformFirstLegOrder,
|
||||
addPlatformFirstLegOrderNote,
|
||||
approvePlatformFirstLegOrder,
|
||||
batchApprovePlatformFirstLegOrders,
|
||||
cancelPlatformFirstLegOrder,
|
||||
completePlatformFirstLegOrder,
|
||||
getPlatformFirstLegOrder,
|
||||
@@ -96,6 +97,22 @@ describe('platform first-leg order API', () => {
|
||||
expect(http.post).toHaveBeenNthCalledWith(6, '/platform/v1/orders/first-leg/90001/internal-notes', { content: '已联系客户确认' }, { params: { tenantId: '10001' } })
|
||||
})
|
||||
|
||||
it('uses the formal tenant-scoped batch approval contract and preserves long order ids', async () => {
|
||||
vi.mocked(http.post).mockResolvedValue({
|
||||
code: '200', message: 'success',
|
||||
data: { total: 2, successCount: 1, failureCount: 1, successOrderIds: ['2089223263733518337'], failedOrders: [{ orderId: '2089223263733518338', code: 'A0409', message: '订单状态已变化' }] },
|
||||
})
|
||||
|
||||
await expect(batchApprovePlatformFirstLegOrders('2089176869176389634', [
|
||||
'2089223263733518337', '2089223263733518338',
|
||||
])).resolves.toMatchObject({ total: 2, successCount: 1, failureCount: 1 })
|
||||
expect(http.post).toHaveBeenCalledWith(
|
||||
'/platform/v1/orders/first-leg/batch-approve',
|
||||
{ orderIds: ['2089223263733518337', '2089223263733518338'] },
|
||||
{ params: { tenantId: '2089176869176389634' } },
|
||||
)
|
||||
})
|
||||
|
||||
it('writes the backend express contract as names, not a guessed master-data ID', async () => {
|
||||
vi.mocked(http.put).mockResolvedValue({ code: '200', message: 'success', data: null })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user