test: preserve whole dropship pallets in producer flow

This commit is contained in:
2026-09-02 00:16:53 +08:00
parent cd749733de
commit 7e6c7a4b9d
3 changed files with 14 additions and 5 deletions
@@ -112,7 +112,7 @@ test('HTTP chain refreshes after stale inventory and keeps one stable PDA identi
assert.match(loading, /id\(incrementedTask\?\.containerBookingId\) === containerBookingId/)
assert.match(loading, /const taskDetailPath = `\$\{pdaBase\}\/tasks\/\$\{canonicalTaskId\}\?warehouseId=/)
assert.match(loading, /loadingPlanStatus: 'LOADING', finalStatus: 'AWAITING_REVIEW'/)
assert.match(loading, /expectedBatchOperationIds = \[batchKey, skipBatchKey, partialBatchKey, dynamicBatchKey\]/)
assert.match(loading, /expectedBatchOperationIds = dropshipWholePallet[\s\S]*\? \[batchKey\][\s\S]*: \[batchKey, skipBatchKey, partialBatchKey, dynamicBatchKey\]/)
assert.match(loading, /expectedBatchOperationIds, incrementalInboundId/)
assert.match(loading, /skipBatchVerified, partialBatchVerified, dynamicIncrementVerified/)
assert.doesNotMatch(loading, /if \(Number\(dynamicCandidate\?\.availablePackageCount\) < 2\) return/)
@@ -575,7 +575,10 @@ export async function run(context) {
const skipBatchKey = `${context.marker}-exception-skip-batch`.slice(0, 128)
const partialBatchKey = `${context.marker}-exception-partial-batch`.slice(0, 128)
const dynamicBatchKey = `${context.marker}-dynamic-pick`.slice(0, 128)
const expectedBatchOperationIds = [batchKey, skipBatchKey, partialBatchKey, dynamicBatchKey]
const dropshipWholePallet = source?.fulfillmentType === 'ONE_CLICK_DROPSHIP'
const expectedBatchOperationIds = dropshipWholePallet
? [batchKey]
: [batchKey, skipBatchKey, partialBatchKey, dynamicBatchKey]
const batchPayload = {
warehouseId, loadingPlanId, containerBookingId,
expectedVersion: Number(claimed?.version),
@@ -1100,7 +1103,10 @@ export async function run(context) {
let skipBatchVerified = false
let partialBatchVerified = false
let dynamicIncrementVerified = false
if (!incrementalInboundId || incrementalFixture?.marker !== context.marker || incrementalInboundId === inboundId) {
if (dropshipWholePallet) {
context.addStep(MODULE, '一件代发整托生产者不执行可拆分动态增量场景', null, true,
'逐箱封托事实必须整托守恒;SKIP、PARTIAL 和动态增删改由 STANDARD 生产者覆盖', OPTIONS)
} else if (!incrementalInboundId || incrementalFixture?.marker !== context.marker || incrementalInboundId === inboundId) {
context.addStep(MODULE, '取得本轮独立动态增量入库单', null, false,
`inboundId=${incrementalInboundId || 'missing'}, primaryInboundId=${inboundId}, marker=${incrementalFixture?.marker || 'missing'}`, OPTIONS)
} else {
@@ -1414,9 +1420,9 @@ export async function run(context) {
cartonMarks: stableLoadedCartonMarks(stagedTask?.items, loadingPlanId),
fulfillmentType: source?.fulfillmentType || 'STANDARD',
skuCodes: [...new Set([...(Array.isArray(source?.skuCodes) ? source.skuCodes : []),
...(Array.isArray(incrementalFixture?.skuCodes) ? incrementalFixture.skuCodes : [])])],
...(!dropshipWholePallet && Array.isArray(incrementalFixture?.skuCodes) ? incrementalFixture.skuCodes : [])])],
skuLines: [...(Array.isArray(source?.skuLines) ? source.skuLines : []),
...(Array.isArray(incrementalFixture?.skuLines) ? incrementalFixture.skuLines : [])],
...(!dropshipWholePallet && Array.isArray(incrementalFixture?.skuLines) ? incrementalFixture.skuLines : [])],
destinationType: initial?.summary?.destinationType || source?.destinationType || null,
destinationWarehouseId: id(initial?.summary?.destinationWarehouseId || source?.destinationWarehouseId),
destinationWarehouseCode: initial?.summary?.destinationCode || source?.destinationWarehouseCode || null,
@@ -91,6 +91,9 @@ test('measurement and loading pass destination identity into the LOADED producer
assert.match(loading, /inbound-assignments/)
assert.match(loading, /canonicalPickItems\.map/)
assert.match(loading, /pickedPackageCount: Number\(item\.plannedPackageCount\)/)
assert.match(loading, /const dropshipWholePallet = source\?\.fulfillmentType === 'ONE_CLICK_DROPSHIP'/)
assert.match(loading, /一件代发整托生产者不执行可拆分动态增量场景/)
assert.match(loading, /!dropshipWholePallet && Array\.isArray\(incrementalFixture\?\.skuCodes\)/)
assert.match(pda, /find\(\(item\) => item\?\.fulfillmentType === 'ONE_CLICK_DROPSHIP'\)/)
assert.match(pda, /resolveCartonFixtures\(context, token, current\.data\.inbounds, producerCartonMarks\)/)
assert.match(pda, /FBA与OVERSEAS箱码resolve均为纯查询且零状态写入/)