Repository: medusajs/medusa
Pull request #12115: fix(core-flows): draft order reservations
Author: login: fPolic
Labels: name: type: bug
name: team: medusa
Created: 2025-04-08T09:16:34Z | Merged: 2025-04-13T15:40:17Z

**What**
- On edit confirmation all previous reservations are deleted. When we confirm an edit we create reservations only for added/updated items which would leave previous items without recreated reservations.
- Dispatch order placed event when a draft order is converted to an order.

---

CLOSES CMRC-1015


Diff:
diff --git a/.changeset/eleven-readers-film.md b/.changeset/eleven-readers-film.md
new file mode 100644
index 0000000000000..d18ea0a331a84
--- /dev/null
+++ b/.changeset/eleven-readers-film.md
@@ -0,0 +1,5 @@
+---
+"@medusajs/core-flows": patch
+---
+
+fix(core-flows): draft order reservations + emit order placedevent on convert
diff --git a/integration-tests/http/__tests__/draft-order/admin/draft-order.spec.ts b/integration-tests/http/__tests__/draft-order/admin/draft-order.spec.ts
index b5523f09cb417..0efbc0d44f071 100644
--- a/integration-tests/http/__tests__/draft-order/admin/draft-order.spec.ts
+++ b/integration-tests/http/__tests__/draft-order/admin/draft-order.spec.ts
@@ -12,6 +12,8 @@ jest.setTimeout(300000)
 medusaIntegrationTestRunner({
   testSuite: ({ dbConnection, getContainer, api }) => {
     let region: HttpTypes.AdminRegion
+    let salesChannel: HttpTypes.AdminSalesChannel
+    let stockLocation: HttpTypes.AdminStockLocation
     let testDraftOrder: HttpTypes.AdminDraftOrder
 
     beforeEach(async () => {
@@ -32,10 +34,32 @@ medusaIntegrationTestRunner({
         )
       ).data.region
 
+      salesChannel = (
+        await api.post("/admin/sales-channels", { name: "test" }, adminHeaders)
+      ).data.sales_channel
+
+      stockLocation = (
+        await api.post(
+          `/admin/stock-locations`,
+          { name: "test location" },
+          adminHeaders
+        )
+      ).data.stock_location
+
+      await api.post(
+        `/admin/stock-locations/${stockLocation.id}/sales-channels`,
+        { add: [salesChannel.id] },
+        adminHeaders
+      )
+
       testDraftOrder = (
         await api.post(
           "/admin/draft-orders",
-          { email: "test@test.com", region_id: region.id },
+          {
+            email: "test@test.com",
+            region_id: region.id,
+            sales_channel_id: salesChannel.id,
+          },
           adminHeaders
         )
       ).data.draft_order
@@ -115,5 +139,152 @@ medusaIntegrationTestRunner({
         expect(response.data.order.status).toBe("pending")
       })
     })
+
+    describe("POST /draft-orders/:id/edit/items/:item_id", () => {
+      let product
+
+      beforeEach(async () => {
+        const inventoryItem = (
+          await api.post(
+            `/admin/inventory-items`,
+            { sku: "shirt" },
+            adminHeaders
+          )
+        ).data.inventory_item
+
+        await api.post(
+          `/admin/inventory-items/${inventoryItem.id}/location-levels`,
+          {
+            location_id: stockLocation.id,
+            stocked_quantity: 10,
+          },
+          adminHeaders
+        )
+
+        product = (
+          await api.post(
+            "/admin/products",
+            {
+              title: "Shirt",
+              options: [{ title: "size", values: ["large", "small"] }],
+              variants: [
+                {
+                  title: "L shirt",
+                  options: { size: "large" },
+                  inventory_items: [
+                    {
+                      inventory_item_id: inventoryItem.id,
+                      required_quantity: 1,
+                    },
+                  ],
+                  prices: [
+                    {
+                      currency_code: "usd",
+                      amount: 10,
+                    },
+                  ],
+                },
+                {
+                  title: "S shirt",
+                  options: { size: "small" },
+                  inventory_items: [
+                    {
+                      inventory_item_id: inventoryItem.id,
+                      required_quantity: 1,
+                    },
+                  ],
+                  prices: [
+                    {
+                      currency_code: "usd",
+                      amount: 10,
+                    },
+                  ],
+                },
+              ],
+            },
+            adminHeaders
+          )
+        ).data.product
+      })
+
+      it("should create reservations for added items", async () => {
+        // 1. Create first edit and add items to it
+        let edit = (
+          await api.post(
+            `/admin/draft-orders/${testDraftOrder.id}/edit`,
+            {},
+            adminHeaders
+          )
+        ).data.draft_order_preview
+
+        await api.post(
+          `/admin/draft-orders/${testDraftOrder.id}/edit/items`,
+          {
+            items: [{ variant_id: product.variants[0].id, quantity: 1 }],
+          },
+          adminHeaders
+        )
+
+        edit = (
+          await api.post(
+            `/admin/draft-orders/${testDraftOrder.id}/edit/confirm`,
+            {},
+            adminHeaders
+          )
+        ).data.draft_order_preview
+
+        // Create second edit and add items to it
+        edit = (
+          await api.post(
+            `/admin/draft-orders/${testDraftOrder.id}/edit`,
+            {},
+            adminHeaders
+          )
+        ).data.draft_order_preview
+
+        await api.post(
+          `/admin/draft-orders/${testDraftOrder.id}/edit/items`,
+          {
+            items: [{ variant_id: product.variants[1].id, quantity: 2 }],
+          },
+          adminHeaders
+        )
+
+        edit = (
+          await api.post(
+            `/admin/draft-orders/${testDraftOrder.id}/edit/confirm`,
+            {},
+            adminHeaders
+          )
+        ).data.draft_order_preview
+
+        const reservations = (
+          await api.get(`/admin/reservations`, adminHeaders)
+        ).data.reservations
+
+        const lineItem1Id = edit.items.find(
+          (item) => item.variant_id === product.variants[0].id
+        )?.id
+
+        const lineItem2Id = edit.items.find(
+          (item) => item.variant_id === product.variants[1].id
+        )?.id
+
+        // second edit didn't override the reservations for the first edit
+        expect(reservations.length).toBe(2)
+        expect(reservations).toEqual(
+          expect.arrayContaining([
+            expect.objectContaining({
+              line_item_id: lineItem1Id,
+              quantity: 1,
+            }),
+            expect.objectContaining({
+              line_item_id: lineItem2Id,
+              quantity: 2,
+            }),
+          ])
+        )
+      })
+    })
   },
 })
diff --git a/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts b/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts
index 2a74e810ab262..e1f5d9a62eaf3 100644
--- a/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts
+++ b/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts
@@ -114,19 +114,25 @@ export const confirmDraftOrderEditWorkflow = createWorkflow(
       throw_if_key_not_found: true,
     }).config({ name: "order-items-query" })
 
-    const lineItemIds = transform(
+    const { removedLineItemIds } = transform(
       { orderItems, previousOrderItems: order.items },
-
       (data) => {
         const previousItemIds = (data.previousOrderItems || []).map(
           ({ id }) => id
-        ) // items that have been removed with the change
-        const newItemIds = data.orderItems.items.map(({ id }) => id)
-        return [...new Set([...previousItemIds, ...newItemIds])]
+        )
+        const currentItemIds = data.orderItems.items.map(({ id }) => id)
+
+        const removedItemIds = previousItemIds.filter(
+          (id) => !currentItemIds.includes(id)
+        )
+
+        return {
+          removedLineItemIds: removedItemIds,
+        }
       }
     )
 
-    deleteReservationsByLineItemsStep(lineItemIds)
+    deleteReservationsByLineItemsStep(removedLineItemIds)
 
     const { variants, items } = transform(
       { orderItems, orderPreview },
diff --git a/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts b/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts
index b9cda1b4fae1e..a2285e089bb88 100644
--- a/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts
+++ b/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts
@@ -1,4 +1,8 @@
-import { Modules, OrderStatus } from "@medusajs/framework/utils"
+import {
+  Modules,
+  OrderStatus,
+  OrderWorkflowEvents,
+} from "@medusajs/framework/utils"
 import {
   createStep,
   createWorkflow,
@@ -7,7 +11,7 @@ import {
   WorkflowResponse,
 } from "@medusajs/framework/workflows-sdk"
 import { IOrderModuleService, OrderDTO } from "@medusajs/types"
-import { useRemoteQueryStep } from "../../common"
+import { emitEventStep, useRemoteQueryStep } from "../../common"
 import { validateDraftOrderStep } from "../steps/validate-draft-order"
 
 const convertDraftOrderWorkflowId = "convert-draft-order"
@@ -91,6 +95,11 @@ export const convertDraftOrderWorkflow = createWorkflow(
 
     const updatedOrder = convertDraftOrderStep({ id: input.id })
 
+    emitEventStep({
+      eventName: OrderWorkflowEvents.PLACED,
+      data: { id: updatedOrder.id },
+    })
+
     return new WorkflowResponse(updatedOrder)
   }
 )


Reviews:
user: login: olivermrbl
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-08T16:34:52Z
user: login: fPolic
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-08T18:17:50Z
user: login: olivermrbl
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-13T15:40:09Z

Review comments:
diff_hunk: @@ -114,19 +114,25 @@ export const confirmDraftOrderEditWorkflow = createWorkflow(
       throw_if_key_not_found: true,
     }).config({ name: "order-items-query" })
 
-    const lineItemIds = transform(
+    const { removedLineItemIds } = transform(
path: packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts
user: login: olivermrbl
body: comment: We should be able to write a test for this no?
created_at: 2025-04-08T16:34:52Z
author_association: CONTRIBUTOR
diff_hunk: @@ -114,19 +114,25 @@ export const confirmDraftOrderEditWorkflow = createWorkflow(
       throw_if_key_not_found: true,
     }).config({ name: "order-items-query" })
 
-    const lineItemIds = transform(
+    const { removedLineItemIds } = transform(
path: packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts
user: login: fPolic
body: @oli - added
created_at: 2025-04-08T18:17:49Z
author_association: CONTRIBUTOR

PR comments:
user: login: vercel[bot]
created_at: 2025-04-08T09:16:40Z
body: [vc]: #jpO0mVQ91CxIhPFIcqq9TIjznzbhcFLgPSL3fDv7cgk=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJtZWR1c2EtZG9jcyIsInJvb3REaXJlY3RvcnkiOiJ3d3cvYXBwcy9kb2NzIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6IiJ9LCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vbWVkdXNhanMvbWVkdXNhLWRvY3MvNkRqaWZ2ZDh3NkdheDM1dGhZdUF0VER2UHBtUCIsIm5leHRDb21taXRTdGF0dXMiOiJJR05PUkVEIiwicHJldmlld1VybCI6Im1lZHVzYS1kb2NzLWdpdC1maXgtZHJhZnQtb3JkZXItcmVzZXJ2YXRpb25zLW1lZHVzYWpzLnZlcmNlbC5hcHAifSx7Im5hbWUiOiJhcGktcmVmZXJlbmNlIiwicm9vdERpcmVjdG9yeSI6Ind3dy9hcHBzL2FwaS1yZWZlc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b3J5Ijoid3d3L2FwcHMvYm9vayIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiIifSwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL21lZHVzYWpzL2RvY3MtdjIvMVdCdHBwTENUUVNncWFZVTNWSm1FMXV4WGFmcyIsIm5leHRDb21taXRTdGF0dXMiOiJJR05PUkVEIiwicHJldmlld1VybCI6ImRvY3MtdjItZ2l0LWZpeC1kcmFmdC1vcmRlci1yZXNlcnZhdGlvbnMtbWVkdXNhanMudmVyY2VsLmFwcCJ9LHsibmFtZSI6InVzZXItZ3VpZGUiLCJyb290RGlyZWN0b3J5Ijoid3d3L2FwcHMvdXNlci1ndWlkZSIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiIifSwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL21lZHVzYWpzL3VzZXItZ3VpZGUvNmRhZXJ3cWJDRTFoU0hFYW9ib3BHUkdyU0ZWZSIsIm5leHRDb21taXRTdGF0dXMiOiJJR05PUkVEIiwicHJldmlld1VybCI6InVzZXItZ3VpZGUtZ2l0LWZpeC1kcmFmdC1vcmRlci1yZXNlcnZhdGlvbnMtbWVkdXNhanMudmVyY2VsLmFwcCJ9XX0=
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **medusa-dashboard** | ✅ Ready ([Inspect](https://vercel.com/medusajs/medusa-dashboard/8WSQRxKJ7A8YB137V6TpsDPuxdq5)) | [Visit Preview](https://medusa-dashboard-git-fix-draft-order-reservations-medusajs.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/medusa-dashboard-git-fix-draft-order-reservations-medusajs.vercel.app?via=pr-comment-feedback-link) | Apr 8, 2025 7:24pm |

<details><summary>7 Skipped Deployments</summary>

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **api-reference** | ⬜️ Ignored ([Inspect](https://vercel.com/medusajs/api-reference/GwrLonU5A1xWJye7ibBkhfwvRYyB)) |  |  | Apr 8, 2025 7:24pm |
| **api-reference-v2** | ⬜️ Ignored ([Inspect](https://vercel.com/medusajs/api-reference-v2/3SRRdPM8gPpXBMfPrW6sMrVUgcDo)) | [Visit Preview](https://api-reference-v2-git-fix-draft-order-reservations-medusajs.vercel.app) |  | Apr 8, 2025 7:24pm |
| **docs-ui** | ⬜️ Ignored ([Inspect](https://vercel.com/medusajs/docs-ui/Go53E7Ey8XcnEpQCcnm7q3o5VpwU)) | [Visit Preview](https://docs-ui-git-fix-draft-order-reservations-medusajs.vercel.app) |  | Apr 8, 2025 7:24pm |
| **docs-v2** | ⬜️ Ignored ([Inspect](https://vercel.com/medusajs/docs-v2/1WBtppLCTQSgqaYU3VJmE1uxXafs)) | [Visit Preview](https://docs-v2-git-fix-draft-order-reservations-medusajs.vercel.app) |  | Apr 8, 2025 7:24pm |
| **medusa-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/medusajs/medusa-docs/6Djifvd8w6Gax35thYuAtTDvPpmP)) | [Visit Preview](https://medusa-docs-git-fix-draft-order-reservations-medusajs.vercel.app) |  | Apr 8, 2025 7:24pm |
| **resources-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/medusajs/resources-docs/6Xgus2FNwCY6Rtmz7k7BHnT9WCUr)) | [Visit Preview](https://resources-docs-git-fix-draft-order-reservations-medusajs.vercel.app) |  | Apr 8, 2025 7:24pm |
| **user-guide** | ⬜️ Ignored ([Inspect](https://vercel.com/medusajs/user-guide/6daerwqbCE1hSHEaobopGRGrSFVe)) | [Visit Preview](https://user-guide-git-fix-draft-order-reservations-medusajs.vercel.app) |  | Apr 8, 2025 7:24pm |
</details>









author_association: NONE
user: login: changeset-bot[bot]
created_at: 2025-04-08T09:16:40Z
body: ###  🦋  Changeset detected

Latest commit: 2d77b5b8a32dc78bee5d2944420406f333848c7e

**The changes in this PR will be included in the next version bump.**

<details><summary>This PR includes changesets to release 66 packages</summary>

  | Name                               | Type  |
| ---------------------------------- | ----- |
| @medusajs/core-flows               | Patch |
| @medusajs/medusa                   | Patch |
| integration-tests-http             | Patch |
| @medusajs/test-utils               | Patch |
| @medusajs/medusa-oas-cli           | Patch |
| @medusajs/api-key                  | Patch |
| @medusajs/auth                     | Patch |
| @medusajs/cart                     | Patch |
| @medusajs/currency                 | Patch |
| @medusajs/customer                 | Patch |
| @medusajs/file                     | Patch |
| @medusajs/fulfillment              | Patch |
| @medusajs/index                    | Patch |
| @medusajs/inventory                | Patch |
| @medusajs/link-modules             | Patch |
| @medusajs/locking                  | Patch |
| @medusajs/notification             | Patch |
| @medusajs/order                    | Patch |
| @medusajs/payment                  | Patch |
| @medusajs/pricing                  | Patch |
| @medusajs/product                  | Patch |
| @medusajs/promotion                | Patch |
| @medusajs/region                   | Patch |
| @medusajs/sales-channel            | Patch |
| @medusajs/stock-location           | Patch |
| @medusajs/store                    | Patch |
| @medusajs/tax                      | Patch |
| @medusajs/user                     | Patch |
| @medusajs/workflow-engine-inmemory | Patch |
| @medusajs/workflow-engine-redis    | Patch |
| @medusajs/oas-github-ci            | Patch |
| @medusajs/cache-inmemory           | Patch |
| @medusajs/cache-redis              | Patch |
| @medusajs/event-bus-local          | Patch |
| @medusajs/event-bus-redis          | Patch |
| @medusajs/auth-emailpass           | Patch |
| @medusajs/auth-github              | Patch |
| @medusajs/auth-google              | Patch |
| @medusajs/file-local               | Patch |
| @medusajs/file-s3                  | Patch |
| @medusajs/fulfillment-manual       | Patch |
| @medusajs/locking-postgres         | Patch |
| @medusajs/locking-redis            | Patch |
| @medusajs/notification-local       | Patch |
| @medusajs/notification-sendgrid    | Patch |
| @medusajs/payment-stripe           | Patch |
| @medusajs/framework                | Patch |
| @medusajs/js-sdk                   | Patch |
| @medusajs/modules-sdk              | Patch |
| @medusajs/orchestration            | Patch |
| @medusajs/types                    | Patch |
| @medusajs/utils                    | Patch |
| @medusajs/workflows-sdk            | Patch |
| @medusajs/cli                      | Patch |
| @medusajs/telemetry                | Patch |
| @medusajs/admin-bundler            | Patch |
| @medusajs/admin-sdk                | Patch |
| @medusajs/admin-shared             | Patch |
| @medusajs/admin-vite-plugin        | Patch |
| @medusajs/dashboard                | Patch |
| @medusajs/icons                    | Patch |
| @medusajs/toolbox                  | Patch |
| @medusajs/ui-preset                | Patch |
| create-medusa-app                  | Patch |
| medusa-dev-cli                     | Patch |
| @medusajs/ui                       | Patch |

</details>

Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/medusajs/medusa/new/fix/draft-order-reservations?filename=.changeset/rotten-kids-fold.md&value=---%0A%22%40medusajs%2Fcore-flows%22%3A%20patch%0A%22integration-tests-http%22%3A%20patch%0A---%0A%0Afix(core-flows)%3A%20draft%20order%20reservations%0A)


author_association: NONE