feat(types,medusa): add inventory quantity to products endpoint (#7541)
what: - when inventory_quantity is requested through the API, we calculate the inventory based on sales channels + stock locations and return the total available inventory. A variant can have multiple inventory items. As an example: Table: (variant) - 4 (required_quantity via link) x legs (inventory item) - 2 x table top Only if all individual inventory items of a variant are available, do we mark the variant as available as a single unit. RESOLVES CORE-2187
This commit is contained in:
@@ -88,6 +88,7 @@ export type InventoryItemDTO = {
|
||||
created_at: string | Date
|
||||
updated_at: string | Date
|
||||
deleted_at: string | Date | null
|
||||
location_levels?: InventoryLevelDTO[]
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,6 +196,7 @@ export type InventoryLevelDTO = {
|
||||
location_id: string
|
||||
stocked_quantity: number
|
||||
reserved_quantity: number
|
||||
available_quantity: number
|
||||
incoming_quantity: number
|
||||
metadata: Record<string, unknown> | null
|
||||
created_at: string | Date
|
||||
|
||||
Reference in New Issue
Block a user