Skip to content

Commit

Permalink
fix(types): add missing inventory_items to input of createProductsWor…
Browse files Browse the repository at this point in the history
…kflow (#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.
  • Loading branch information
shahednasser authored Jan 10, 2025
1 parent c490e08 commit ff72509
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-jobs-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/types": patch
---

fix(types): add missing inventory_items to input of createProductsWorkflow
15 changes: 15 additions & 0 deletions packages/core/types/src/product/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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.
*/
Expand Down

0 comments on commit ff72509

Please sign in to comment.