Merge origin/dev into release/test preserving current workflows

This commit is contained in:
2026-09-14 11:05:48 +08:00
17 changed files with 328 additions and 24 deletions
+20
View File
@@ -16,6 +16,26 @@ test('inventory resources expose distinct locations and total available cartons'
assert.deepEqual(state.summarizeInventoryResources(null), { location: '', availablePackageCount: null })
})
test('sealed pallet matches its DP code and resolves member cartons as an atomic pallet', () => {
const pallet = { id: '1', unitType: 'SEALED_PALLET', indivisible: true, palletNo: 'DP-260909-0143', boxCodes: ['IN#2-1', 'IN#2-2'], qty: 2 }
assert.equal(state.classifyScan([pallet], {}, 'IN#2-1').type, 'pallet')
assert.equal(state.classifyScan([pallet], {}, pallet.palletNo).type, 'pallet')
assert.equal(state.classifyScan([pallet], { 1: state.ITEM_STATUS.PICKED }, pallet.palletNo).type, 'processed')
})
test('only the authoritative sealed-pallet unit type selects pallet behavior', () => {
assert.equal(state.isSealedPalletItem({ unitType: 'SEALED_PALLET', indivisible: true }), true)
assert.equal(state.isSealedPalletItem({ unitType: 'PALLET', indivisible: true }), false)
assert.equal(state.isSealedPalletItem({ unitType: 'PACKAGE', indivisible: true }), false)
})
test('mixed task keeps package scanning separate from sealed pallet scanning', () => {
const mixed = [{ id: '1', unitType: 'SEALED_PALLET', palletNo: 'DP-260909-0001', boxCodes: ['BOX-1'] }, { id: '2', unitType: 'PACKAGE', boxCodes: ['BOX-2'] }]
assert.equal(state.classifyScan(mixed, {}, 'BOX-2').item.id, '2')
assert.equal(state.classifyScan(mixed, {}, 'DP-260909-0001').item.id, '1')
assert.equal(state.classifyScan(mixed, {}, 'BOX-1').type, 'pallet')
})
test('createItemStates initializes every item as pending', () => {
assert.deepEqual(state.createItemStates(items), {
1: state.ITEM_STATUS.PENDING,