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:
@@ -1,3 +1,4 @@
|
||||
export * as CartWorkflow from "./cart"
|
||||
export * as CommonWorkflow from "./common"
|
||||
export * as ProductWorkflow from "./product"
|
||||
export * as InventoryWorkflow from "./inventory"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
export interface CreateInventoryItemInputDTO {
|
||||
sku?: string
|
||||
hs_code?: string
|
||||
weight?: number
|
||||
length?: number
|
||||
height?: number
|
||||
width?: number
|
||||
origin_country?: string
|
||||
mid_code?: string
|
||||
material?: string
|
||||
title?: string
|
||||
description?: string
|
||||
thumbnail?: string
|
||||
metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface CreateInventoryItemsWorkflowInputDTO {
|
||||
inventoryItems: CreateInventoryItemInputDTO[]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./create-inventory-items"
|
||||
Reference in New Issue
Block a user