test(fba): preserve verified fleet and fulfillment acceptance workflows

This commit is contained in:
2026-10-03 06:26:33 +08:00
parent c55bd7f4b6
commit d858357c5d
52 changed files with 4217 additions and 103 deletions
@@ -1,4 +1,5 @@
import { selectSessionPdaOperator } from './domestic-pda-operator.mjs'
import { createHash } from 'node:crypto'
const MODULE = 'phase3-order-splitting'
const SCENARIO = 'source-loaded-single-remainder-chain'
const OPTIONS = { scenario: SCENARIO, deploymentBlocker: true }
@@ -47,6 +48,8 @@ function sameBookingTransport(left, right) {
}
async function request(context, method, path, body, headers = {}, token = undefined) {
// Shared reads retry transport failures; business rejections remain final evidence.
if (method === 'GET') return context.request(method, path, body, token ?? context.token, headers)
try {
const response = await fetch(`${context.options.gateway}${path}`, {
method,
@@ -165,8 +168,9 @@ function snapshotMatches(tree, original, loaded, remaining, activeSuffix) {
&& activeMatches && quantityConserved(tree)
}
function bookingPayload(marker, sequence, source, agent, carrier) {
const suffix = `${marker}-${sequence}`.replace(/[^A-Za-z0-9]/g, '').slice(-18)
export function bookingPayload(marker, sequence, source, agent, carrier) {
const suffix = createHash('sha256').update(JSON.stringify([marker, sequence, id(source.sourceOrderId)]))
.digest('hex').slice(0, 18)
return oceanBookingDraft({ marker }, suffix, {
customerId: source.tenantId, customerName: source.customerName, channelCode: source.channelCode,
warehouseId: source.warehouseId, warehouseName: source.warehouseName,