补齐海外仓和私人地址正常及短少收货真实验收

This commit is contained in:
2026-11-04 14:23:41 +08:00
parent 40475388e1
commit fbdf58c23c
7 changed files with 341 additions and 27 deletions
@@ -2,9 +2,23 @@ import test from 'node:test'
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { normalizeModuleOrder } from '../admin-test-env-acceptance.mjs'
import { sameOutboundTask } from './dropship-pallet-matrix.mjs'
import { loadingUnitTypesMatch, sameOutboundTask } from './dropship-pallet-matrix.mjs'
import { receivingProgressMatches, outboundCandidateGuards, probePartialPick } from './dropship-outbound-edge-cases.mjs'
test('domestic loading units follow dropship, ordinary and mixed fixture composition', () => {
const dropship = { order: { fulfillmentType: 'ONE_CLICK_DROPSHIP' } }
const ordinary = { order: { fulfillmentType: 'STANDARD', destinationType: 'PRIVATE' } }
const sealed = { unitType: 'SEALED_PALLET' }
const packages = { unitType: 'PACKAGE' }
assert.equal(loadingUnitTypesMatch([dropship], [sealed]), true)
assert.equal(loadingUnitTypesMatch([ordinary], [packages]), true)
assert.equal(loadingUnitTypesMatch([dropship, ordinary], [sealed, packages]), true)
assert.equal(loadingUnitTypesMatch([ordinary], [sealed]), false)
assert.equal(loadingUnitTypesMatch([dropship, ordinary], [packages]), false)
assert.equal(loadingUnitTypesMatch([ordinary], []), false)
assert.equal(loadingUnitTypesMatch([ordinary], [{ unitType: 'UNKNOWN' }]), false)
})
test('loading confirmation assigns the authenticated PDA operator from the target warehouse', () => {
const source = readFileSync(new URL('./dropship-pallet-matrix.mjs', import.meta.url), 'utf8')
assert.match(source, /domestic-pda-operators\?warehouseId=\$\{summary\.warehouseId\}/)
@@ -249,6 +263,12 @@ test('overseas plans preserve per-inbound ownership and shared physical identity
assert.match(source, /JSON.stringify\(replay\) === JSON.stringify\(plans\)/)
})
test('private receiving mode is verified from the authoritative tail-order detail', () => {
assert.match(source, /读取私人地址尾程收货类型/)
assert.match(source, /detail.order.destinationType === 'OVERSEAS' && detail.order.orderType === 'FIRST_LEG'/)
assert.doesNotMatch(source, /line => line.destinationType === 'OVERSEAS'/)
})
test('overseas receipt uses scoped PDA identity and scans each physical pallet once', () => {
assert.match(source, /await createPicker\(context/)
assert.match(source, /await disablePicker\(context/)