test(acceptance): follow automatic departure flow
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user