test: preserve dispatch stock during PDA relabel
This commit is contained in:
@@ -755,14 +755,14 @@ export async function run(context) {
|
||||
.sort((left, right) => (right?.auxiliaryPallets?.length || 0) - (left?.auxiliaryPallets?.length || 0))
|
||||
const fixture = fixturesByAuxiliaryCapacity.find((item) => item?.destinationType === 'FBA'
|
||||
&& item?.fbaWarehouseCode === 'ABE4' && Array.isArray(item?.inventory)
|
||||
&& item.inventory.some((line) => Number(line?.availablePackages) > 1))
|
||||
&& item.inventory.some((line) => Number(line?.availablePackages) > 3))
|
||||
|| fixturesByAuxiliaryCapacity.find((item) => item?.destinationType === 'FBA'
|
||||
&& item?.fbaWarehouseCode === 'ABE4' && Array.isArray(item?.inventory)
|
||||
&& item.inventory.some((line) => Number(line?.availablePackages) > 0))
|
||||
&& item.inventory.some((line) => Number(line?.availablePackages) > 3))
|
||||
|| fixturesByAuxiliaryCapacity.find((item) => Array.isArray(item?.inventory)
|
||||
&& item.inventory.some((line) => Number(line?.availablePackages) > 1))
|
||||
&& item.inventory.some((line) => Number(line?.availablePackages) > 3))
|
||||
|| fixturesByAuxiliaryCapacity.find((item) => Array.isArray(item?.inventory)
|
||||
&& item.inventory.some((line) => Number(line?.availablePackages) > 0))
|
||||
&& item.inventory.some((line) => Number(line?.availablePackages) > 3))
|
||||
if (!fixture) {
|
||||
blocker(context, 'P2-P5可操作库存', '本轮已完成柜没有可移动的真实库存位置')
|
||||
return
|
||||
|
||||
@@ -298,7 +298,15 @@ export async function run(context) {
|
||||
items: [{ skuCode: skuB, receivedQuantity: 2 }],
|
||||
idempotencyKey: key(context, 'RECEIPT-2'),
|
||||
}
|
||||
await reject('最后一批缺少打托照片拒绝且库存不变', conflict, () => context.requestOverseas('POST', `${PDA_RECEIPTS}/confirm`, secondBody, {}, picker.token))
|
||||
await reject('最后一批缺少打托照片拒绝且库存不变', conflict, async () => {
|
||||
let response = null
|
||||
for (let attempt = 1; attempt <= 3; attempt += 1) {
|
||||
response = await context.requestOverseas('POST', `${PDA_RECEIPTS}/confirm`, secondBody, {}, picker.token)
|
||||
if (response?.http !== 0 || attempt === 3) break
|
||||
await new Promise((resolve) => setTimeout(resolve, 400 * attempt))
|
||||
}
|
||||
return response
|
||||
})
|
||||
const photoForm = new FormData()
|
||||
// Synthetic HTTP fixture, not a photograph of real warehouse activity.
|
||||
photoForm.append('file', new Blob([Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aWQAAAABJRU5ErkJggg==', 'base64')], { type: 'image/png' }), 'return-receipt-test.png')
|
||||
|
||||
Reference in New Issue
Block a user