From ff725090bb4ec848cb82c5411bdc25c4b72252ab Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 10 Jan 2025 03:23:29 +0200 Subject: [PATCH] fix(types): add missing inventory_items to input of createProductsWorkflow (#10892) The `createProductsWorkflow` allows passing an `inventory_items` property to assign the inventory items of a product variant, and we even pass it in the `/admin/products` API route when creating a variant, but the workflow's input type doesn't include that property. This PR adds it to the workflow's input type. --- .changeset/angry-jobs-prove.md | 5 +++++ packages/core/types/src/product/common.ts | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .changeset/angry-jobs-prove.md diff --git a/.changeset/angry-jobs-prove.md b/.changeset/angry-jobs-prove.md new file mode 100644 index 0000000000..99188d9f0d --- /dev/null +++ b/.changeset/angry-jobs-prove.md @@ -0,0 +1,5 @@ +--- +"@medusajs/types": patch +--- + +fix(types): add missing inventory_items to input of createProductsWorkflow diff --git a/packages/core/types/src/product/common.ts b/packages/core/types/src/product/common.ts index e3f7fdc4d9..4fc9bc8c99 100644 --- a/packages/core/types/src/product/common.ts +++ b/packages/core/types/src/product/common.ts @@ -1237,6 +1237,16 @@ export interface UpdateProductOptionValueDTO { metadata?: MetadataType } +/** + * @interface + * + * Inventory kit for creating a product variant. + */ +export interface CreateProductVariantInventoryKit { + inventory_item_id: string + required_quantity?: number +} + /** * @interface * @@ -1275,6 +1285,11 @@ export interface CreateProductVariantDTO { * Whether the product variant's inventory should be managed by the core system. */ manage_inventory?: boolean + /** + * The variant's inventory items. It's only + * available if `manage_inventory` is enabled. + */ + inventory_items?: CreateProductVariantInventoryKit[] /** * The HS Code of the product variant. */