fix(core-flows): pass backorder flag when recreating reservations after fulfilment cancelation (#13076)

This commit is contained in:
Frane Polić
2025-08-27 21:22:03 +02:00
committed by GitHub
parent 059bfc1475
commit 6b04fbcc50
3 changed files with 214 additions and 0 deletions

View File

@@ -205,6 +205,7 @@ function prepareInventoryUpdate({
location_id: string
quantity: BigNumberInput
line_item_id: string
allow_backorder: boolean
}[] = []
const toUpdate: {
id: string
@@ -244,6 +245,7 @@ function prepareInventoryUpdate({
location_id: fulfillment.location_id,
quantity: fulfillmentItem.quantity, // <- this is the inventory quantity that is being fulfilled so it means it does include the required quantity
line_item_id: fulfillmentItem.line_item_id as string,
allow_backorder: !!orderItem?.variant?.allow_backorder,
})
} else {
toUpdate.push({
@@ -313,6 +315,7 @@ export const cancelOrderFulfillmentWorkflow = createWorkflow(
"status",
"items.id",
"items.quantity",
"items.variant.allow_backorder",
"items.variant.manage_inventory",
"items.variant.inventory_items.inventory.id",
"items.variant.inventory_items.required_quantity",