test: verify pallet block settlement over HTTP

This commit is contained in:
2026-09-04 13:48:03 +08:00
parent 660e284e25
commit 7feb80689b
6 changed files with 110 additions and 155 deletions
@@ -240,21 +240,17 @@ test('finalize rechecks the same unified order detail and list as LOADED', () =>
assert.match(source('./phase3-loading.mjs'), /tenantId, orderId: id\(source\?\.orderId\), inboundId/)
})
test('PDA inventory snapshot gates batch and records the only safe mutation gap', () => {
test('PDA inventory snapshot gates batch and records whole-ticket block identity', () => {
const loading = source('./phase3-loading.mjs')
assertOrder(loading, [
'读取 PDA 提交前实时库存快照',
'未发生库存变化时重复读取实时库存快照',
'PDA 库存快照按入仓单返回唯一整票库位块身份',
'客户身份无权读取平台 PDA 实时库存快照',
'const overflowResource =',
'通过公开 A0 换绑接口制造真实库存变化',
'真实库存变化后旧 snapshot token 提交返回冲突',
'旧 token 冲突对任务、明细、已拣数量和操作历史零写入',
'库存变化后刷新 PDA 实时库存快照',
'const canonicalPick = await request',
'const canonicalBatchReplay = await request',
])
assert.match(loading, /inventorySnapshotToken: refreshedInventory\.snapshotToken/)
assert.match(loading, /inventorySnapshotToken: inventory\.snapshotToken/)
assert.match(loading, /warehouseId, loadingPlanId, containerBookingId,/)
assert.match(loading,
/LATE_CONTAINER_GATE_ONLY \? inventory\?\.currentContainerNo == null : inventory\?\.currentContainerNo === containerNo/)
@@ -262,13 +258,14 @@ test('PDA inventory snapshot gates batch and records the only safe mutation gap'
assert.doesNotMatch(batchPayload, /containerNo[,\s]/)
assert.doesNotMatch(loading, /\/loading\/picking\/(?:start|complete)/)
assert.match(loading, /inventorySnapshotVerified: inventorySnapshotVerified && atomicBatchReplayVerified/)
assert.match(loading, /inventoryMutationVerified, inventoryMutationCleanup/)
assert.match(loading, /当前唯一平台代理库存变更入口只允许 A0 临时占用换绑/)
assert.match(loading, /inventoryBlockIdentityVerified, inventoryBlockSnapshots/)
assert.match(loading, /partialBlockSnapshot/)
assert.doesNotMatch(loading, /occupancyId|temporary-occupancies|\/rebind/)
const convergence = source('./phase3-pda-convergence.mjs')
assert.doesNotMatch(convergence, /未公开实时库存查询或库存版本快照端点/)
assert.match(convergence, /fixture\?\.inventorySnapshotVerified !== true/)
assert.match(convergence, /fixture\?\.inventoryMutationVerified !== true/)
assert.match(convergence, /fixture\?\.inventoryBlockIdentityVerified !== true/)
})
test('container loading arranges a simulation before linking a released booking requirement', () => {