This commit is contained in:
2026-08-14 10:57:05 +08:00
parent 66089f9b99
commit 91e781b3ff
16 changed files with 219 additions and 119 deletions
@@ -26,6 +26,29 @@ test('PDA opens only after a real container number and uses stable plan identity
assert.doesNotMatch(source, /\$\{PDA\}\/tasks\?containerNo=/)
})
test('each remainder settles only through inventory snapshot, atomic batch and explicit complete', () => {
const claimIndex = source.indexOf("`${PDA}/tasks/${taskId}/claim`")
const snapshotIndex = source.indexOf('inventory-snapshot?warehouseId=')
const batchIndex = source.indexOf('const batchPath = `${PDA}/tasks/${taskId}/batch`')
const completeIndex = source.indexOf('const completePath = `${PDA}/tasks/${taskId}/complete`')
const treeIndex = source.indexOf('`回查 ${sourceOrderNo} 拆分后的根聚合`')
assert.ok(claimIndex >= 0 && snapshotIndex > claimIndex && batchIndex > snapshotIndex
&& completeIndex > batchIndex && treeIndex > completeIndex)
assert.match(source, /loadingPlanId: planId, containerBookingId: containerId/)
assert.match(source, /expectedVersion: Number\(inventory\.taskVersion\)/)
assert.match(source, /inventorySnapshotToken: inventory\.snapshotToken/)
assert.match(source, /action: 'PICK', pickedPackageCount: 1/)
assert.match(source, /version: Number\(claimedItem\.version\), releaseMode: 'MANUAL', locationIds: \[\]/)
assert.match(source, /'Idempotency-Key': batchKey/)
assert.match(source, /differentReplay/)
assert.match(source, /workflowStatus === 'AWAITING_REVIEW'/)
assert.match(source, /expectedTaskVersion: Number\(picked\?\.version\)/)
assert.match(source, /operationId: `\$\{operationBase\}-complete`/)
assert.match(source, /completeReplay/)
assert.match(source, /workflowStatus === 'COMPLETED'/)
assert.doesNotMatch(source, /\/items\/\$\{[^}]+\}\/pick/)
})
test('booking freezes the source customer channel and warehouse scope', () => {
assert.match(source, /customerId: source\.tenantId/)
assert.match(source, /channelCode: source\.channelCode/)