This commit is contained in:
2026-09-30 17:13:11 +08:00
parent babc7de4b6
commit 32fb9ec7b3
26 changed files with 1484 additions and 70 deletions
@@ -18,6 +18,17 @@ test('orders fixture verifies the complete pricing tuple before selecting an FBA
assert.match(source, /warehouse\?\.status === 'ACTIVE'/)
})
test('private addresses select an authoritative channel without requiring a warehouse destination rate row', async () => {
const result = await findPricedOrderRouteAcrossOrigins({
receivings: [{ id: 'origin' }], destinations: [], destinationType: 'PRIVATE',
loadChannels: async () => ({ http: 200, body: { code: '200', data: [{ channelCode: 'C', pricingTaxModes: ['TAX_INCLUDED'] }] } }),
estimate: async () => { throw new Error('private address is not a warehouse destination') },
})
assert.equal(result.priced.channel.channelCode, 'C')
assert.equal(result.priced.destination, null)
assert.equal(result.attempts, 0)
})
test('FBA order fixture excludes warehouses without the internal code required by pallet labels', () => {
const warehouses = [
{ id: 'abe3', warehouseCode: 'ABE3', status: 'ACTIVE', internalCode: null },