test(acceptance): follow automatic departure flow

This commit is contained in:
2026-09-02 14:16:44 +08:00
parent 5d098c9762
commit b6800a48c6
3 changed files with 41 additions and 5 deletions
@@ -79,6 +79,22 @@ export async function run(context) {
&& gateItems.every((item) => !['TRUCK_DEPARTED', 'SAILING_SCHEDULE'].includes(item.code)),
`truck=${aggregate?.truckAppointmentStatus || 'none'}, ocean=${aggregate?.oceanBookingStatus || 'none'}`, OPTIONS)
if (aggregate?.dispatchStatus === 'WAITING_FOR_LOADING') {
context.assert(MODULE, '整柜报关完成后系统已自动确认国内离仓', detailResponse,
aggregate?.inbounds?.every?.((item) => item?.inboundStatus === 'LOADED')
&& detail?.timeline?.some?.((item) => item.module === 'OUTBOUND_DISPATCH'
&& item.action === 'CONFIRM_DISPATCH'),
`dispatch=${aggregate.dispatchStatus}, inbounds=${aggregate?.inbounds?.length ?? 'missing'}`, OPTIONS)
context.createdResources.phase3OutboundDispatch = {
marker: context.marker, inboundId, containerBookingId,
orderId: id(inboundBinding?.orderId), tenantId: id(inboundBinding?.tenantId),
confirmedStatus: aggregate.dispatchStatus, confirmedInboundStatus: 'LOADED',
confirmedVersion: Number(aggregate.version), finalStatus: aggregate.dispatchStatus,
finalInboundStatus: 'LOADED', finalVersion: Number(aggregate.version),
}
return
}
const expectedVersion = Number(aggregate.version)
const confirmKey = `${context.marker}-outbound-confirm`.slice(0, 128)
if (!gate?.passed) {