Feat(inventory-next, medusa): Add List inventory items endpoint (#6694)

* code for list inventory items

* fix integration tests

* move integration test

* calculate reserved and stocked quantities in db

* update lockfile
This commit is contained in:
Philip Korsholm
2024-03-14 14:48:34 +01:00
committed by GitHub
parent 3dd55efd15
commit c3f8c30ba6
14 changed files with 1247 additions and 16 deletions
@@ -15,10 +15,10 @@ import {
InjectManager,
InjectTransactionManager,
InventoryEvents,
isDefined,
MedusaContext,
MedusaError,
ModulesSdkUtils,
isDefined,
partitionArray,
} from "@medusajs/utils"
import { InventoryItem, InventoryLevel, ReservationItem } from "@models"
@@ -100,7 +100,7 @@ export default class InventoryModuleService<
{ location_id: string; inventory_item_id: string }[]
]
const inventoryLevels = await this.inventoryLevelService_.list(
const inventoryLevels = await this.listInventoryLevels(
{
$or: [
{ id: idData.filter(({ id }) => !!id).map((e) => e.id) },