test(overseas): align relabel and pallet acceptance
This commit is contained in:
@@ -50,6 +50,7 @@ test('P2 to P5 cover all frozen endpoints, replays and conflict boundaries witho
|
|||||||
'chargeAmount: 0.01', 'cartonMark:', 'fbaCartonMark:',
|
'chargeAmount: 0.01', 'cartonMark:', 'fbaCartonMark:',
|
||||||
'inventory-candidates', 'sourceInventoryBalanceId:', 'sourceInventoryPositionId:',
|
'inventory-candidates', 'sourceInventoryBalanceId:', 'sourceInventoryPositionId:',
|
||||||
'sourceInboundOrderId:', 'operationWarehouseId:', 'relabelItemForUnit', 'sourceLines.map',
|
'sourceInboundOrderId:', 'operationWarehouseId:', 'relabelItemForUnit', 'sourceLines.map',
|
||||||
|
"operationType: changesCartonLabel ? 'CARTON_AND_SKU' : 'SKU_LABEL'", 'skuItems:',
|
||||||
'P5换标费用冻结后开放PDA作业', 'P5换标完成后钱包结算收敛']) {
|
'P5换标费用冻结后开放PDA作业', 'P5换标完成后钱包结算收敛']) {
|
||||||
assert.ok(source.includes(marker), marker)
|
assert.ok(source.includes(marker), marker)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -386,18 +386,24 @@ async function verifyRelabel(context, token, merchantToken, fixture) {
|
|||||||
labelDeadline: new Date(Date.now() + 7 * 86400000).toISOString().slice(0, 19),
|
labelDeadline: new Date(Date.now() + 7 * 86400000).toISOString().slice(0, 19),
|
||||||
contactName: 'PDA换标验收', contactPhone: '13800000006', chargeAmount: 0.01, remark: context.marker,
|
contactName: 'PDA换标验收', contactPhone: '13800000006', chargeAmount: 0.01, remark: context.marker,
|
||||||
idempotencyKey: key(context, 'RELABEL-CREATE'),
|
idempotencyKey: key(context, 'RELABEL-CREATE'),
|
||||||
items: sourceLines.map(({ source, position, packageCount }, index) => ({
|
items: sourceLines.map(({ source, position, packageCount }, index) => {
|
||||||
sourceInventoryBalanceId: id(source.inventoryBalanceId),
|
const newSkuCode = `${source.skuCode}-NEW-${markerSuffix}-${index + 1}`.slice(0, 128)
|
||||||
sourceInventoryPositionId: id(position.positionId), sourceInboundOrderId: id(source.inboundOrderId),
|
const changesCartonLabel = nonBlank(source.destinationFbaWarehouseCode)
|
||||||
skuCode: source.skuCode, productNameZh: source.productNameZh || inventory.productName || '本轮库存商品',
|
return {
|
||||||
totalPackageCount: packageCount, notifiedPackageCount: packageCount,
|
sourceInventoryBalanceId: id(source.inventoryBalanceId),
|
||||||
shipmentNo: `SHIP-${context.marker}-${index + 1}`.slice(0, 128),
|
sourceInventoryPositionId: id(position.positionId), sourceInboundOrderId: id(source.inboundOrderId),
|
||||||
newSkuCode: `${source.skuCode}-NEW-${markerSuffix}-${index + 1}`.slice(0, 128),
|
skuCode: source.skuCode, productNameZh: source.productNameZh || inventory.productName || '本轮库存商品',
|
||||||
labelRequirement: context.marker,
|
totalPackageCount: packageCount, notifiedPackageCount: packageCount,
|
||||||
cartonMark: `CM-${String(context.marker).slice(-28)}-${index + 1}`,
|
shipmentNo: `SHIP-${context.marker}-${index + 1}`.slice(0, 128),
|
||||||
fbaCartonMark: `FBA-${String(context.marker).slice(-27)}-${index + 1}`,
|
newSkuCode,
|
||||||
destinationFbaWarehouseCode: source.destinationFbaWarehouseCode,
|
labelRequirement: context.marker,
|
||||||
})),
|
cartonMark: `CM-${String(context.marker).slice(-28)}-${index + 1}`,
|
||||||
|
fbaCartonMark: changesCartonLabel ? `FBA-${String(context.marker).slice(-27)}-${index + 1}` : null,
|
||||||
|
destinationFbaWarehouseCode: changesCartonLabel ? source.destinationFbaWarehouseCode : null,
|
||||||
|
operationType: changesCartonLabel ? 'CARTON_AND_SKU' : 'SKU_LABEL',
|
||||||
|
skuItems: [{ skuCode: source.skuCode, newSkuCode, quantity: packageCount, remark: context.marker }],
|
||||||
|
}
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
const createdResponse = await context.requestOverseas('POST',
|
const createdResponse = await context.requestOverseas('POST',
|
||||||
query(relabelBase, { customerId }), createBody)
|
query(relabelBase, { customerId }), createBody)
|
||||||
|
|||||||
+2
-1
@@ -60,7 +60,8 @@ test('托盘汇总和拆柜成本验证总数、分摊及跨区金额守恒', ()
|
|||||||
assert.match(source, /Number\(d\.totalCount\) === Number\(d\.idleCount\) \+ Number\(d\.occupiedCount\)/)
|
assert.match(source, /Number\(d\.totalCount\) === Number\(d\.idleCount\) \+ Number\(d\.occupiedCount\)/)
|
||||||
assert.match(source, /allocated === money\(fact\.expectedPalletCost\)/)
|
assert.match(source, /allocated === money\(fact\.expectedPalletCost\)/)
|
||||||
assert.match(source, /delivered\.reduce[\s\S]*fact\.expectedPalletCost/)
|
assert.match(source, /delivered\.reduce[\s\S]*fact\.expectedPalletCost/)
|
||||||
assert.match(pda, /unitPrice = Number\(\(1\.01 \+ index\)\.toFixed\(2\)\)/)
|
assert.match(pda, /unitPrice: Number\(pallet\?\.unitPrice \|\| 0\)/)
|
||||||
|
assert.match(pda, /Number\(stored\.unitPrice \|\| pallet\.unitPrice \|\| 0\)/)
|
||||||
assert.match(pda, /completedContainerFacts\.push/)
|
assert.match(pda, /completedContainerFacts\.push/)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user