feat(dashboard,core-flows,medusa): update fulfillment flows (#7589)
* fix: fulfillment ops * fix: cancel fulfillment route * fix: adjustInventoryLevelsStep throwing * feat: cancel order and fix endpoint * fix: type * feat: order domain sdk * feat: delete unused file * fix: import
This commit is contained in:
@@ -4,7 +4,7 @@ import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
||||
|
||||
type CancelOrderFulfillmentStepInput = CancelOrderFulfillmentDTO
|
||||
|
||||
export const cancelOrderFulfillmentStepId = "cancel-order-fullfillment"
|
||||
export const cancelOrderFulfillmentStepId = "cancel-order-fulfillment"
|
||||
export const cancelOrderFulfillmentStep = createStep(
|
||||
cancelOrderFulfillmentStepId,
|
||||
async (data: CancelOrderFulfillmentStepInput, { container }) => {
|
||||
|
||||
@@ -87,11 +87,14 @@ function prepareInventoryUpdate({
|
||||
}[] = []
|
||||
|
||||
for (const item of fulfillment.items) {
|
||||
inventoryAdjustment.push({
|
||||
inventory_item_id: item.inventory_item_id as string,
|
||||
location_id: fulfillment.location_id,
|
||||
adjustment: item.quantity,
|
||||
})
|
||||
// if this is `null` this means that item is from variant that has `manage_inventory` false
|
||||
if (item.inventory_item_id) {
|
||||
inventoryAdjustment.push({
|
||||
inventory_item_id: item.inventory_item_id as string,
|
||||
location_id: fulfillment.location_id,
|
||||
adjustment: item.quantity,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user