feat: move create inventory to @medusajs/workflows (#5301)

**Why**
- We have some workflow-like flows in @medusajs/medusa. These should be moved over to the workflows package.
- Inventory Items <> Variant currently assume a 1-1 mapping. There should be support for a many-to-many mapping.

**What**
- PR introduces a feature flag for supporting many-to-many mappings for inventory and variants.
- Deletes legacy transaction handler in @medusajs/medusa.
- Adjusts existing createInventoryItems handler to remove dependency on variant data.

**Unkowns**
~~1. Couldn't find an existing test for the CreateProduct workflow. It should be tested that this still works as expected.~~
2. Have removed transaction managers as we should move to handling consistency through orchestration tooling. Are we ready for that?
This commit is contained in:
Sebastian Rindom
2023-10-11 11:01:56 -07:00
committed by GitHub
parent bbd9dd408f
commit 66413d094e
25 changed files with 480 additions and 281 deletions

View File

@@ -6499,7 +6499,7 @@ __metadata:
languageName: node
linkType: hard
"@medusajs/inventory@workspace:packages/inventory":
"@medusajs/inventory@workspace:^, @medusajs/inventory@workspace:packages/inventory":
version: 0.0.0-use.local
resolution: "@medusajs/inventory@workspace:packages/inventory"
dependencies:
@@ -26516,6 +26516,7 @@ __metadata:
"@babel/node": ^7.12.10
"@medusajs/cache-inmemory": "workspace:*"
"@medusajs/event-bus-local": "workspace:*"
"@medusajs/inventory": "workspace:^"
"@medusajs/medusa": "workspace:*"
"@medusajs/product": "workspace:^"
babel-preset-medusa-package: "*"