test(overseas): use authoritative fulfillment fixtures
This commit is contained in:
@@ -364,7 +364,7 @@ async function verifyRelabel(context, token, merchantToken, fixture) {
|
||||
if (!id(source?.inventoryBalanceId) || !id(source?.inboundOrderId)) continue
|
||||
for (const position of source?.positions || []) {
|
||||
if (!id(position?.positionId) || Number(position?.availablePackages) <= 0) continue
|
||||
const packageCount = Math.min(requiredPackages, Number(position.availablePackages))
|
||||
const packageCount = 1
|
||||
sourceLines.push({ source, position, packageCount })
|
||||
requiredPackages -= packageCount
|
||||
if (requiredPackages === 0) break
|
||||
@@ -444,7 +444,8 @@ async function verifyRelabel(context, token, merchantToken, fixture) {
|
||||
return false
|
||||
}
|
||||
const unitPath = `${pdaBase}/${encodeURIComponent(relabelNo)}/units`
|
||||
const scanBody = { itemId: id(item.itemId), oldLabel: `${context.marker}-OLD-1`, newLabel: item.newSkuCode,
|
||||
const scanBody = { itemId: id(item.itemId), oldLabel: item.cartonMark,
|
||||
newLabel: item.fbaCartonMark || item.newSkuCode,
|
||||
expectedVersion: Number(detail.version), idempotencyKey: key(context, 'RELABEL-NORMAL') }
|
||||
const scanned = await request(context, token, 'POST', 'P5正常换标一箱', unitPath, scanBody)
|
||||
const scanReplay = await request(context, token, 'POST', 'P5正常换标同键重放', unitPath, scanBody)
|
||||
@@ -456,7 +457,7 @@ async function verifyRelabel(context, token, merchantToken, fixture) {
|
||||
{ ...scanBody, oldLabel: `${context.marker}-OLD-STALE`, idempotencyKey: key(context, 'RELABEL-STALE') })
|
||||
detail = scanned.data
|
||||
const skipItem = relabelItemForUnit(detail, 1)
|
||||
const skipBody = { itemId: id(skipItem?.itemId), oldLabel: `${context.marker}-OLD-2`,
|
||||
const skipBody = { itemId: id(skipItem?.itemId), oldLabel: skipItem?.cartonMark,
|
||||
reason: `${context.marker}-skip`, expectedVersion: Number(detail.version),
|
||||
idempotencyKey: key(context, 'RELABEL-SKIP') }
|
||||
const skipped = await request(context, token, 'POST', 'P5跳过换标一箱', `${unitPath}/skip`, skipBody)
|
||||
@@ -465,7 +466,7 @@ async function verifyRelabel(context, token, merchantToken, fixture) {
|
||||
Number(skipReplay.data?.skippedPackages) === 1, trace(skipReplay.response), OPTIONS)
|
||||
detail = skipped.data
|
||||
const exceptionItem = relabelItemForUnit(detail, 2)
|
||||
const exceptionBody = { itemId: id(exceptionItem?.itemId), oldLabel: `${context.marker}-OLD-3`,
|
||||
const exceptionBody = { itemId: id(exceptionItem?.itemId), oldLabel: exceptionItem?.cartonMark,
|
||||
exceptionCode: 'DAMAGED', reason: `${context.marker}-damaged`, expectedVersion: Number(detail.version),
|
||||
idempotencyKey: key(context, 'RELABEL-EXCEPTION') }
|
||||
const exception = await request(context, token, 'POST', 'P5登记换标异常一箱',
|
||||
|
||||
Reference in New Issue
Block a user