exclude primary FBA destination for second producer
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user