fix(acceptance): align latest overseas contracts

This commit is contained in:
2026-09-09 00:53:40 +08:00
parent 5da3417429
commit 0d73e185c0
7 changed files with 76 additions and 11 deletions
@@ -306,7 +306,23 @@ async function convertReceivingContainers(context, producers) {
convertible,
`sourceContainerBookingId=${id(summary?.sourceContainerBookingId) || 'missing'}, allPlansReady=${summary?.allPlansReady === true}, orders=${totalOrders}, inboundCodes=${inboundCodes}, plans=${existingPlans}, pending=${pendingPlans}; ${trace(summaryResponse)}`, OPTIONS)
if (!convertible) return false
const body = { sourceContainerBookingId: id(summary.sourceContainerBookingId) }
const previewResponse = await context.requestOverseas('GET',
`/api/platform/v1/last-leg/inbound-plans/container-preview?sourceContainerBookingId=${encodeURIComponent(summary.sourceContainerBookingId)}`,
undefined, {}, context.overseasToken)
const preview = success(previewResponse) ? previewResponse.body?.data : null
const previewReady = preview?.ready === true
&& Number.isInteger(Number(preview?.snapshotVersion)) && Number(preview.snapshotVersion) >= 0
&& /^[0-9a-f]{64}$/.test(String(preview?.snapshotHash || ''))
&& Number(preview?.pendingOrderCount) === pendingPlans
context.addStep(MODULE, `预览整柜原子转换快照 ${containerNo}`, previewResponse,
previewReady,
`ready=${preview?.ready === true}, version=${preview?.snapshotVersion ?? 'missing'}, hash=${nonBlank(preview?.snapshotHash) ? 'present' : 'missing'}, pending=${preview?.pendingOrderCount ?? 'missing'}; ${trace(previewResponse)}`, OPTIONS)
if (!previewReady) return false
const body = {
sourceContainerBookingId: id(summary.sourceContainerBookingId),
snapshotVersion: Number(preview.snapshotVersion),
snapshotHash: String(preview.snapshotHash),
}
const key = `${context.marker}-pda-convert-${containerNo}`.slice(0, 128)
const convertedResponse = await context.requestOverseas('POST',
'/api/platform/v1/last-leg/inbound-plans/convert-container', body,