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,6 +1,16 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import { customsRetentionDigest, verifyTaxCustomsAfterShipEdit } from './phase3-port-schedules.mjs'
import { customsRetentionDigest, verifyTaxCustomsAfterShipEdit, portScheduleCustomerScope } from './phase3-port-schedules.mjs'
test('public booking null scope becomes platform zero; positive IDs retain exact precision', () => {
assert.equal(portScheduleCustomerScope(null), '0')
assert.equal(portScheduleCustomerScope(undefined), '0')
assert.equal(portScheduleCustomerScope('2105227486329671682'), '2105227486329671682')
assert.equal(portScheduleCustomerScope(123), '123')
for (const invalid of ['', '0', 0, '-1', 'customer']) {
assert.throws(() => portScheduleCustomerScope(invalid), /null or a positive ID/)
}
})
test('customs retention digest includes documents, receipt versions, confirmations and completion facts', () => {
const before = { status: 'COMPLETED', documents: [{ fileId: '1', tenantId: 'A', version: 2 }],