优化
This commit is contained in:
@@ -22,6 +22,21 @@ test('reservation mismatch asks for the reserved pallet and retains diagnostics'
|
||||
assert.equal(result.traceId, 'trace-1')
|
||||
})
|
||||
|
||||
test('cargo and destination-pallet scan errors use concise Chinese and retain diagnostics', () => {
|
||||
for (const [code, message, expected] of [
|
||||
['A0409', 'Carton mark must contain a non-empty inbound code prefix', '请扫描箱码或国内DP码'],
|
||||
['A0404', 'Pallet code is not part of the current FBA destination group', '托盘不属于当前目的仓,请重扫'],
|
||||
['B0404', 'Pallet code is not part of the current FBA destination group', '托盘不属于当前目的仓,请重扫'],
|
||||
[404, 'Pallet code is not part of the current FBA destination group', '托盘不属于当前目的仓,请重扫'],
|
||||
]) {
|
||||
const result = toReceivingError({ code, message, requestId: 'scan-request', traceId: 'scan-trace' })
|
||||
assert.equal(result.message, expected)
|
||||
assert.equal(result.code, code)
|
||||
assert.equal(result.requestId, 'scan-request')
|
||||
assert.equal(result.traceId, 'scan-trace')
|
||||
}
|
||||
})
|
||||
|
||||
test('first scan and receipt requests confirm server reservations without resource assignment commands', async () => {
|
||||
const source = await readFile(new URL('../src/api/inbound.js', import.meta.url), 'utf8')
|
||||
const calls = []
|
||||
|
||||
Reference in New Issue
Block a user