优化
This commit is contained in:
@@ -5,7 +5,24 @@ import test from 'node:test'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
import { normalizeModuleOrder } from '../admin-test-env-acceptance.mjs'
|
||||
import { run, remainingRelabelItem, selectPhysicalRelabelSources } from './phase4-overseas-pda-operations.mjs'
|
||||
import { run, remainingRelabelItem, selectPhysicalRelabelSources, fundRelabelWallet, RELABEL_CHARGE_AMOUNT } from './phase4-overseas-pda-operations.mjs'
|
||||
|
||||
test('fixed customer relabel wallet only reads existing available funds', async () => {
|
||||
assert.equal(RELABEL_CHARGE_AMOUNT, 0.01)
|
||||
for (const availableBalance of ['0.01', '0.00', undefined]) {
|
||||
const calls = [], steps = []
|
||||
const context = { options: { fixedCustomerId: '123' },
|
||||
async request(method, path) {
|
||||
calls.push({ method, path })
|
||||
return { http: 200, body: { code: '200', data: [{ customerId: '123', accountVersion: 1, actualBalance: 100, availableBalance }] } }
|
||||
},
|
||||
addStep(...args) { steps.push(args) },
|
||||
}
|
||||
assert.equal(await fundRelabelWallet(context, '123'), availableBalance === '0.01')
|
||||
assert.equal(calls.length, 1)
|
||||
assert.equal(calls[0].method, 'GET')
|
||||
}
|
||||
})
|
||||
|
||||
test('relabel uses three physical cartons across current inbounds, never UNBOUND or duplicate positions', () => {
|
||||
const a = { inventoryBalanceId: 'A', inboundOrderId: '1', positions: [
|
||||
@@ -69,7 +86,7 @@ test('P2 to P5 cover all frozen endpoints, replays and conflict boundaries witho
|
||||
]) assert.ok(source.includes(endpoint), endpoint)
|
||||
for (const marker of ['按原数计数', '同键重放', '同键异载荷A0409', '旧版本A0409',
|
||||
'SUBMITTED', '移回原库位', 'WAIT_REVIEW', 'REWORK', 'COMPLETED',
|
||||
'chargeAmount: 0.01', 'cartonMark:', 'fbaCartonMark:',
|
||||
'chargeAmount: RELABEL_CHARGE_AMOUNT', 'cartonMark:', 'fbaCartonMark:',
|
||||
'inventory-candidates', 'sourceInventoryBalanceId:', 'sourceInventoryPositionId:',
|
||||
'sourceInboundOrderId:', 'operationWarehouseId:', 'relabelItemForUnit', 'sourceLines.map',
|
||||
'sourceLines.push({ source, position, packageCount: 1 })', 'oldLabel: item.cartonMark',
|
||||
|
||||
Reference in New Issue
Block a user