This commit is contained in:
2026-08-26 15:24:48 +08:00
parent 3f9ee28d22
commit 4ae236fe11
18 changed files with 198 additions and 92 deletions
@@ -12,9 +12,9 @@ export async function run(context) {
'本轮未取得 phase3-outbound-dispatch 的 marker 隔离聚合,未使用历史资源', 'fixture')
return
}
const selector = `inboundId=${encodeURIComponent(fixture.inboundId)}&containerBookingId=${encodeURIComponent(fixture.containerBookingId)}`
const response = await context.request('GET', `${BASE}/detail?${selector}`)
const detail = context.apiSuccess(MODULE, '回查 WAITING_FOR_LOADING 状态历史', response, selector, OPTIONS)
const response = await context.request('GET', `${BASE}/${encodeURIComponent(fixture.containerBookingId)}`)
const detail = context.apiSuccess(MODULE, '回查柜级 WAITING_FOR_LOADING 状态历史', response,
`containerBookingId=${fixture.containerBookingId}`, OPTIONS)
const history = Array.isArray(detail?.timeline)
? detail.timeline.filter((item) => item.module === 'OUTBOUND_DISPATCH') : []
const confirmations = history.filter((item) => item.action === 'CONFIRM_DISPATCH')
@@ -27,7 +27,8 @@ export async function run(context) {
&& Boolean(confirmed?.operatorId) && Boolean(confirmed?.operatorName) && Boolean(confirmed?.occurredAt),
`confirmed=${confirmed?.fromStatus || 'missing'}->${confirmed?.toStatus || 'missing'}, version=${fixture.confirmedVersion ?? 'missing'}`, OPTIONS)
context.assert(MODULE, '实际离仓节点冻结后保持一次确认且零次成功撤销', response,
detail?.aggregate?.dispatchStatus === 'WAITING_FOR_LOADING' && detail?.aggregate?.inboundStatus === 'LOADED'
detail?.aggregate?.dispatchStatus === 'WAITING_FOR_LOADING'
&& detail?.aggregate?.inbounds?.every?.((item) => item?.inboundStatus === 'LOADED')
&& confirmations.length === 1 && reversed.length === 0,
`current=${detail?.aggregate?.dispatchStatus || 'missing'}, confirmations=${confirmations.length}, reversals=${reversed.length}`, OPTIONS)
}