test(firstleg): formalize late container gate acceptance

This commit is contained in:
2026-09-01 15:53:12 +08:00
parent aa828ca1eb
commit ca8127ce83
3 changed files with 37 additions and 6 deletions
@@ -925,17 +925,20 @@ export async function run(context) {
terminalResponse = await context.request('GET', taskDetailPath)
if (terminalResponse.http === 200 && codeOf(terminalResponse) === '200') terminalTask = terminalResponse.body?.data
}
context.assert(MODULE, '补号后的下一完成门禁返回明确终态而非柜号冲突', terminalResponse,
terminalTask?.workflowStatus !== 'PROCESSING'
&& !String(terminalTask?.completionCommand?.failureMessage || '').includes('集装箱号'),
const nextStage = terminalTask?.completionCommand?.failureStage || null
const nextCode = terminalTask?.completionCommand?.failureCode || null
const nextMessage = String(terminalTask?.completionCommand?.failureMessage || '')
context.assert(MODULE, '补号后已越过柜号门禁并允许进入柜级证据门禁', terminalResponse,
!nextMessage.includes('集装箱号')
&& (terminalTask?.workflowStatus !== 'PROCESSING'
|| (nextStage === 'CABINET_EVIDENCE' && nextCode === 'A0409')),
`workflow=${terminalTask?.workflowStatus || 'missing'}, stage=${terminalTask?.completionCommand?.failureStage || 'none'}, code=${terminalTask?.completionCommand?.failureCode || 'none'}, message=${terminalTask?.completionCommand?.failureMessage || 'none'}`, OPTIONS)
context.createdResources.phase3LateContainerGate = {
marker: context.marker, tenantId, inboundId, containerBookingId, cabinetNo: simulation.cabinetNo,
oceanBookingId: bookingId, loadingPlanId, taskId: canonicalTaskId, containerNo,
missingComplete: responseEvidence(missingComplete), fill: responseEvidence(transport),
acceptedComplete: responseEvidence(acceptedComplete), finalWorkflow: terminalTask?.workflowStatus || null,
nextFailureStage: terminalTask?.completionCommand?.failureStage || null,
nextFailureCode: terminalTask?.completionCommand?.failureCode || null,
nextFailureStage: nextStage, nextFailureCode: nextCode,
}
return
}