chore(order): preview order change (#8025)
What: - new method `previewOrderChange` - Calculate all the actions related to an order change. - Return the preview of the final Order, with all the calculated values. - Associate actions with items and shipping_methods they modified. FIXES: CORE-2509
This commit is contained in:
committed by
GitHub
parent
4736d9e2dd
commit
2b2e2fbb3d
@@ -174,6 +174,7 @@ async function processAdditionalItems(
|
||||
reference_id: item.id,
|
||||
claim_id: claimReference.id,
|
||||
quantity: addedItem.quantity,
|
||||
unit_price: item.unit_price,
|
||||
metadata: addedItem.metadata,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -129,7 +129,9 @@ async function processAdditionalItems(
|
||||
|
||||
createItems.forEach((item, index) => {
|
||||
const addedItem = itemsToAdd[index]
|
||||
|
||||
additionalNewItems[index].item_id = item.id
|
||||
|
||||
actions.push({
|
||||
action: ChangeActionType.ITEM_ADD,
|
||||
exchange_id: exchangeReference.id,
|
||||
@@ -140,6 +142,7 @@ async function processAdditionalItems(
|
||||
reference_id: item.id,
|
||||
exchange_id: exchangeReference.id,
|
||||
quantity: addedItem.quantity,
|
||||
unit_price: item.unit_price,
|
||||
metadata: addedItem.metadata,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user