This commit is contained in:
2026-08-18 16:39:39 +08:00
parent 7fe5b4e31f
commit a9061eca54
43 changed files with 821 additions and 1217 deletions
+27 -19
View File
@@ -46,21 +46,18 @@ test('test-environment full acceptance executes warehouse-scoped booking channel
assert.match(fixture, /createdResources\.platformLogisticsChannels/)
})
test('test-environment full acceptance keeps assigned and unassigned customer booking chains', () => {
test('test-environment full acceptance keeps the DRAFT to RELEASED booking chain', () => {
const loadingIndex = adminAcceptance.indexOf("'phase3-container-loading'")
const bookingIndex = adminAcceptance.indexOf("'ocean-bookings'")
assert.ok(loadingIndex >= 0 && bookingIndex > loadingIndex,
'ocean-bookings must run after the assigned-customer container fixture')
const bookingModule = readFileSync(resolve(scriptsDir, 'admin-test-env-modules', 'ocean-bookings.mjs'), 'utf8')
assert.match(bookingModule, /oceanBookingDraftWithoutCustomer/)
assert.match(bookingModule, /createdResources\.oceanBookingUnassignedCustomer/)
assert.match(bookingModule, /customerId == null[\s\S]*customerName == null/)
assert.match(bookingModule, /status === 'CONFIRMED'[\s\S]*containers\?\.length === 1/)
assert.match(bookingModule, /keyword=\$\{encodeURIComponent\(bookingNo\)\}/)
assert.doesNotMatch(bookingModule, /keyword=\$\{encodeURIComponent\(context\.marker\)\}/)
assert.match(bookingModule, /指定客户订舱持久化本轮客户范围快照/)
assert.match(bookingModule, /phase3Loading[\s\S]*phase3ContainerLoading/)
assert.match(bookingModule, /创建订舱 DRAFT(不生成真实柜号\/货柜分配)/)
assert.match(bookingModule, /containerRequirements/)
assert.match(bookingModule, /完整 DRAFT 放舱为 RELEASED 且冻结五项运输事实/)
assert.match(bookingModule, /RELEASED 编辑拒绝且零写入/)
assert.doesNotMatch(bookingModule, /realContainerBookingId|CHANGE_PENDING|CANCELLED/)
})
test('test-environment loading chains push without a number and open PDA only after all prerequisites', () => {
@@ -69,32 +66,33 @@ test('test-environment loading chains push without a number and open PDA only af
const bridgeLoading = readFileSync(
resolve(scriptsDir, 'admin-test-env-modules', 'phase3-loading.mjs'), 'utf8')
assert.match(containerLoading, /realContainerBookingId: id\(requirement\.containerBookingId\)/)
assert.match(containerLoading, /oceanBookingId: bookingId, requirementId: id\(requirement\.id\), containerNo: realContainerNo/)
assert.doesNotMatch(containerLoading, /realContainerBookingId/)
const pushIndex = bridgeLoading.indexOf('无真实柜号推送预装成功并冻结柜次明细')
const absentIndex = bridgeLoading.indexOf('无号 push 成功后 PDA 查询明确 A0404')
const linkIndex = bridgeLoading.indexOf('模拟柜原地合并三期 CONFIRMED 真实订舱柜')
const releaseIndex = bridgeLoading.indexOf('三期订舱携带已冻结运输快照并放舱')
const releaseIndex = bridgeLoading.indexOf('三期订舱 RELEASED 冻结运输快照')
const linkIndex = bridgeLoading.indexOf('模拟柜原地关联三期 RELEASED 订舱需求并补真实柜号')
const confirmIndex = bridgeLoading.indexOf('计划级原子确认整份预装并触发唯一 PDA 任务')
const pdaIndex = bridgeLoading.indexOf('读取柜次级 PDA 唯一事实任务')
assert.ok(pushIndex >= 0 && absentIndex > pushIndex
&& linkIndex > absentIndex && releaseIndex > linkIndex && confirmIndex > releaseIndex && pdaIndex > confirmIndex)
&& releaseIndex > absentIndex && linkIndex > releaseIndex && confirmIndex > linkIndex && pdaIndex > confirmIndex)
assert.match(bridgeLoading, /codeOf\(missingContainerTaskResponse\) === 'A0404'/)
assert.match(bridgeLoading, /push exact replay 对计划版本历史关联和任务零漂移/)
assert.match(bridgeLoading, /bookingReleased\?\.oceanBooking\?\.status === 'RELEASED'/)
assert.match(bridgeLoading, /bookingConfirmed\?\.oceanBooking\?\.status === 'RELEASED'/)
assert.match(bridgeLoading, /loading-plans\/\$\{loadingPlanId\}\/confirm/)
assert.match(bridgeLoading, /readiness\?\.readyForPda === true/)
assert.match(bridgeLoading, /计划级确认同 key 异参返回冲突[\s\S]*已确认计划使用新 key 重复确认返回冲突/)
assert.doesNotMatch(bridgeLoading, /\/preload\/confirming|\/preload\/confirm\?tenantId=/)
const containerPushIndex = containerLoading.indexOf('无真实柜号推送预装计划成功')
const containerLinkIndex = containerLoading.indexOf('首次关联真实已确认订舱柜')
const containerReleaseIndex = containerLoading.indexOf('订舱携带已冻结运输快照放舱并满足 PDA 门禁')
const containerReleaseIndex = containerLoading.indexOf('订舱放舱为 RELEASED 且不预生成真实货柜')
const containerLinkIndex = containerLoading.indexOf('首次关联 RELEASED 订舱需求并补真实柜号')
const containerConfirmIndex = containerLoading.indexOf('计划级原子确认整份预装并触发唯一 PDA 任务')
const containerPdaIndex = containerLoading.indexOf('查询本轮柜次 PDA 拣货任务')
assert.ok(containerPushIndex >= 0 && containerLinkIndex > containerPushIndex
&& containerReleaseIndex > containerLinkIndex
&& containerConfirmIndex > containerReleaseIndex
assert.ok(containerPushIndex >= 0 && containerReleaseIndex > containerPushIndex
&& containerLinkIndex > containerReleaseIndex
&& containerConfirmIndex > containerLinkIndex
&& containerPdaIndex > containerConfirmIndex)
assert.match(containerLoading, /loading-plans\/\$\{planId\}\/confirm/)
assert.match(containerLoading, /readiness\?\.readyForPda === true/)
@@ -102,6 +100,16 @@ test('test-environment loading chains push without a number and open PDA only af
assert.doesNotMatch(containerLoading, /\/preload\/confirming|\/preload\/confirm\?tenantId=/)
})
test('default loading chain carries the three loading-list remarks contract', () => {
const loading = readFileSync(resolve(scriptsDir, 'admin-test-env-modules', 'phase3-loading.mjs'), 'utf8')
assert.match(adminAcceptance, /CONFIGURED_MODULES\s*=\s*\[[^\]]*'phase3-loading'/s)
assert.match(loading, /装柜明细客户备注与最新内部备注来源精确且不冒用货物备注/)
assert.match(loading, /warehouse-remark/)
assert.match(loading, /仓库备注相同 operationId 与原请求精确重放/)
assert.match(loading, /仓库备注旧版本冲突后版本与备注事实零漂移/)
assert.match(loading, /preservedRemarkItem\?\.warehouseRemark === warehouseRemark/)
})
test('default Admin HTTP entry carries evidence chain through settlement-aware PDA completion', () => {
const focused = normalizeModuleOrder([
'merchant-qualification-fixture', 'orders', 'inbound-measurement',