exclude primary FBA destination for second producer

This commit is contained in:
2026-09-23 22:20:18 +08:00
parent b1f97bef0f
commit 85379df182
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -1521,6 +1521,8 @@ export class AcceptanceRun {
this.context.orderFulfillmentType = fulfillmentType
this.context.phase4ProducerMatrixMarker = matrixMarker
if (destinationType === 'FBA' && label === 'FBA-SECOND') {
const existingFba = this.createdResources.phase4InboundProducerFixtures?.byDestinationType?.FBA || []
const primaryCode = existingFba.map(item => String(item?.destinationWarehouseCode || '').trim().toUpperCase()).find(Boolean)
this.context.waitSplitRoute = {
...(this.context.waitSplitRoute || {}),
// The normal order route rotates the destination list from randomIndex;
@@ -1528,6 +1530,7 @@ export class AcceptanceRun {
// dispatch can exercise a multi-destination candidate set.
randomIndex: 17,
destinationIndex: 1,
excludeDestinationCodes: primaryCode ? [primaryCode] : [],
}
}
try {
@@ -290,6 +290,8 @@ async function loadMasterData(context, merchantToken) {
// a producer intended for the second FBA destination can silently reuse ABE4.
if (destinationType !== 'PRIVATE') {
destinations = [...new Map(destinations.map(value => [String(value.warehouseCode).trim().toUpperCase(), value])).values()]
const excluded = new Set((fixedRoute.excludeDestinationCodes || []).map(value => String(value).trim().toUpperCase()).filter(Boolean))
if (excluded.size) destinations = destinations.filter(value => !excluded.has(String(value.warehouseCode).trim().toUpperCase()))
}
let pricingResult