feat(pda): receive dropship cartons by sealed pallet
This commit is contained in:
@@ -25,7 +25,7 @@ test('reservation mismatch asks for the reserved pallet and retains diagnostics'
|
||||
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 = []
|
||||
const api = new Function('overseasRequest', 'normalizeReceivingAssignment', 'normalizeReceivingInbound', source.replace(/^import .*$/gm, '').replace(/^export /gm, '') + '; return {resolveCurrentCarton,resolveCurrentPallet,receiveCurrentBulk,receiveCurrentCarton};')(async (...args) => {
|
||||
const api = new Function('overseasRequest', 'normalizeReceivingAssignment', 'normalizeReceivingInbound', source.replace(/^import .*$/gm, '').replace(/^export /gm, '') + '; return {resolveCurrentCarton,resolveCurrentPallet,receiveCurrentBulk,receiveCurrentCarton,receiveCurrentWholePallet};')(async (...args) => {
|
||||
calls.push(args)
|
||||
return { compatible: true, assigned: true, mergeAllowed: 'true', urgent: true, mergeHint: 'unsafe hint' }
|
||||
}, normalizeReceivingAssignment, normalizeReceivingInbound)
|
||||
@@ -33,11 +33,13 @@ test('first scan and receipt requests confirm server reservations without resour
|
||||
assert.equal((await api.resolveCurrentPallet('P-1', 'IN-1')).compatible, true)
|
||||
assert.equal((await api.receiveCurrentBulk({ inboundCode: 'IN-1', palletCode: 'P-1', packageCount: 2 })).urgent, true)
|
||||
assert.equal((await api.receiveCurrentCarton({ cartonMark: 'BOX-1', palletCode: 'P-1' })).mergeHint, '')
|
||||
assert.equal((await api.receiveCurrentWholePallet({ sourcePalletNo: 'DP-1' })).urgent, true)
|
||||
assert.deepEqual(calls, [
|
||||
['POST', '/pda/v1/last-leg/receiving-containers/current/cartons/resolve', { cartonMark: 'BOX-1' }],
|
||||
['POST', '/pda/v1/last-leg/receiving-containers/current/pallets/resolve', { palletCode: 'P-1', inboundCode: 'IN-1' }],
|
||||
['POST', '/pda/v1/last-leg/receiving-containers/current/receipts/bulk', { inboundCode: 'IN-1', palletCode: 'P-1', packageCount: 2 }],
|
||||
['POST', '/pda/v1/last-leg/receiving-containers/current/receipts/carton', { cartonMark: 'BOX-1', palletCode: 'P-1' }]
|
||||
['POST', '/pda/v1/last-leg/receiving-containers/current/receipts/carton', { cartonMark: 'BOX-1', palletCode: 'P-1' }],
|
||||
['POST', '/pda/v1/last-leg/receiving-containers/current/receipts/pallet', { sourcePalletNo: 'DP-1' }]
|
||||
])
|
||||
const page = await readFile(new URL('../src/pages/operation/operation.vue', import.meta.url), 'utf8')
|
||||
assert.match(page, /activeInbound\.assigned/)
|
||||
@@ -49,6 +51,13 @@ test('first scan and receipt requests confirm server reservations without resour
|
||||
assert.match(gate, /resolvedPallet\?\.compatible/)
|
||||
})
|
||||
|
||||
test('one-click dropship inbound is marked only by an explicit server boolean', () => {
|
||||
for (const value of [undefined, null, false, 1, 'true', 'false']) {
|
||||
assert.equal(normalizeReceivingInbound({ wholePalletInbound: value }).wholePalletInbound, false)
|
||||
}
|
||||
assert.equal(normalizeReceivingInbound({ wholePalletInbound: true }).wholePalletInbound, true)
|
||||
})
|
||||
|
||||
test('receiving adapter preserves the three signed photo roles in workflow order', () => {
|
||||
const snowflakeFileId = '2092476334483931138'
|
||||
const session = normalizeReceivingSession({
|
||||
|
||||
Reference in New Issue
Block a user