This commit is contained in:
2026-09-21 07:59:48 +08:00
parent 92286e18de
commit 3b4e288564
3 changed files with 16 additions and 3 deletions
@@ -108,3 +108,9 @@ test('relabel marks are checked on the authoritative outbound DTO without weaken
assert.match(source, /detail\.data\?\.outbound\?\.dispatchNo === relabel\.dispatchNo/)
assert.match(source, /relabel\?\.marker !== context\.marker/)
})
test('manual exception retries only a transport failure with the identical business body', () => {
assert.match(source, /manualException\.response\.http === 0/)
assert.match(source, /人工异常连接失败后使用同载荷重试/)
assert.match(source, /manualExceptionBody/)
})
@@ -468,11 +468,16 @@ export async function run(context) {
&& savedVisit.data?.visit?.selectedInboundCode === inbound.inboundCode
&& savedVisit.data?.visit?.visitResult === 'SATISFIED', trace(savedVisit.response), OPTIONS)
const manualException = await platform(context, 'POST', '为本轮尾程单创建人工异常',
`${LASTLEG_BASE}/exception-orders`, {
const manualExceptionBody = {
customerId, inboundCode: inbound.inboundCode, lastMileOrderNo: inbound.lastMileOrderNo,
exceptionType: 'DAMAGED', reason: `${context.marker}-manual-exception`, packageCount: 1, skuCode: null,
})
}
let manualException = await platform(context, 'POST', '为本轮尾程单创建人工异常',
`${LASTLEG_BASE}/exception-orders`, manualExceptionBody)
if (manualException.response.http === 0) {
manualException = await platform(context, 'POST', '人工异常连接失败后使用同载荷重试',
`${LASTLEG_BASE}/exception-orders`, manualExceptionBody)
}
const manualExceptionNo = id(manualException.data?.exceptionNo)
context.assert(MODULE, '人工异常进入PENDING并返回业务单号', manualException.response,
nonBlank(manualExceptionNo) && manualException.data?.status === 'PENDING', trace(manualException.response), OPTIONS)