import { BigNumberInput, Context, DAL, IInventoryService, InferEntityType, InternalModuleDeclaration, InventoryTypes, ModuleJoinerConfig, ModulesSdkTypes, RestoreReturn, SoftDeleteReturn } from "@medusajs/framework/types"; import { BigNumber } from "@medusajs/framework/utils"; import { InventoryItem, InventoryLevel, ReservationItem } from "../models"; import InventoryLevelService from "./inventory-level"; type InjectedDependencies = { baseRepository: DAL.RepositoryService; inventoryItemService: ModulesSdkTypes.IMedusaInternalService; inventoryLevelService: InventoryLevelService; reservationItemService: ModulesSdkTypes.IMedusaInternalService; }; declare const InventoryModuleService_base: import("@medusajs/framework/utils").MedusaServiceReturnType<{ InventoryItem: { dto: InventoryTypes.InventoryItemDTO; }; InventoryLevel: { dto: InventoryTypes.InventoryLevelDTO; }; ReservationItem: { dto: InventoryTypes.ReservationItemDTO; }; }>; export default class InventoryModuleService extends InventoryModuleService_base implements IInventoryService { protected readonly moduleDeclaration?: InternalModuleDeclaration | undefined; protected baseRepository_: DAL.RepositoryService; protected readonly inventoryItemService_: ModulesSdkTypes.IMedusaInternalService; protected readonly reservationItemService_: ModulesSdkTypes.IMedusaInternalService; protected readonly inventoryLevelService_: InventoryLevelService; constructor({ baseRepository, inventoryItemService, inventoryLevelService, reservationItemService, }: InjectedDependencies, moduleDeclaration?: InternalModuleDeclaration | undefined); __joinerConfig(): ModuleJoinerConfig; private ensureInventoryLevels; private sanitizeInventoryLevelInput; private sanitizeInventoryItemInput; createReservationItems(input: InventoryTypes.CreateReservationItemInput[], context?: Context): Promise; createReservationItems(input: InventoryTypes.CreateReservationItemInput, context?: Context): Promise; createReservationItems_(input: InventoryTypes.CreateReservationItemInput[], context?: Context): Promise[]>; createInventoryItems(input: InventoryTypes.CreateInventoryItemInput, context?: Context): Promise; createInventoryItems(input: InventoryTypes.CreateInventoryItemInput[], context?: Context): Promise; createInventoryItems_(input: InventoryTypes.CreateInventoryItemInput[], context?: Context): Promise; createInventoryLevels(input: InventoryTypes.CreateInventoryLevelInput, context?: Context): Promise; createInventoryLevels(input: InventoryTypes.CreateInventoryLevelInput[], context?: Context): Promise; createInventoryLevels_(input: InventoryTypes.CreateInventoryLevelInput[], context?: Context): Promise[]>; updateInventoryItems(input: InventoryTypes.UpdateInventoryItemInput[], context?: Context): Promise; updateInventoryItems(input: InventoryTypes.UpdateInventoryItemInput, context?: Context): Promise; updateInventoryItems_(input: (Partial & { id: string; })[], context?: Context): Promise[]>; deleteInventoryItemLevelByLocationId(locationId: string | string[], context?: Context): Promise<[object[], Record]>; /** * Deletes an inventory level * @param inventoryItemId - the id of the inventory item associated with the level * @param locationId - the id of the location associated with the level * @param context */ deleteInventoryLevel(inventoryItemId: string, locationId: string, context?: Context): Promise; updateInventoryLevels(updates: InventoryTypes.UpdateInventoryLevelInput[], context?: Context): Promise; updateInventoryLevels(updates: InventoryTypes.UpdateInventoryLevelInput, context?: Context): Promise; updateInventoryLevels_(updates: InventoryTypes.UpdateInventoryLevelInput[], context?: Context): Promise; /** * Updates a reservation item * @param reservationItemId * @param input - the input object * @param context * @param context * @return The updated inventory level */ updateReservationItems(input: InventoryTypes.UpdateReservationItemInput[], context?: Context): Promise; updateReservationItems(input: InventoryTypes.UpdateReservationItemInput, context?: Context): Promise; updateReservationItems_(input: (InventoryTypes.UpdateReservationItemInput & { id: string; })[], context?: Context): Promise[]>; deleteReservationItems(ids: string | string[], context?: Context): Promise; protected deleteReservationItems_(ids: string | string[], context?: Context): Promise; softDeleteReservationItems(ids: string | string[], config?: SoftDeleteReturn, context?: Context): Promise; protected softDeleteReservationItems_(ids: string | string[], config?: SoftDeleteReturn, context?: Context): Promise; restoreReservationItems(ids: string | string[], config?: RestoreReturn, context?: Context): Promise; protected restoreReservationItems_(ids: string | string[], config?: RestoreReturn, context?: Context): Promise; deleteReservationItemByLocationId(locationId: string | string[], context?: Context): Promise; protected deleteReservationItemByLocationId_(locationId: string | string[], context?: Context): Promise; /** * Deletes reservation items by line item * @param lineItemId - the id of the line item associated with the reservation item * @param context */ deleteReservationItemsByLineItem(lineItemId: string | string[], context?: Context): Promise; protected deleteReservationItemsByLineItem_(lineItemId: string | string[], context?: Context): Promise; /** * Deletes reservation items by line item * @param lineItemId - the id of the line item associated with the reservation item * @param context */ restoreReservationItemsByLineItem(lineItemId: string | string[], context?: Context): Promise; protected restoreReservationItemsByLineItem_(lineItemId: string | string[], context?: Context): Promise; /** * Adjusts the inventory level for a given inventory item and location. * @param inventoryItemId - the id of the inventory item * @param locationId - the id of the location * @param adjustment - the number to adjust the inventory by (can be positive or negative) * @param context * @return The updated inventory level * @throws when the inventory level is not found */ adjustInventory(inventoryItemId: string, locationId: string, adjustment: BigNumberInput, context: Context): Promise; adjustInventory(data: { inventoryItemId: string; locationId: string; adjustment: BigNumberInput; }[], context: Context): Promise; adjustInventory_(inventoryItemId: string, locationId: string, adjustment: BigNumberInput, context?: Context): Promise>; retrieveInventoryLevelByItemAndLocation(inventoryItemId: string, locationId: string, context?: Context): Promise; /** * Retrieves the available quantity of a given inventory item in a given location. * @param inventoryItemId - the id of the inventory item * @param locationIds - the ids of the locations to check * @param context * @return The available quantity * @throws when the inventory item is not found */ retrieveAvailableQuantity(inventoryItemId: string, locationIds: string[], context?: Context): Promise; /** * Retrieves the stocked quantity of a given inventory item in a given location. * @param inventoryItemId - the id of the inventory item * @param locationIds - the ids of the locations to check * @param context * @return The stocked quantity * @throws when the inventory item is not found */ retrieveStockedQuantity(inventoryItemId: string, locationIds: string[], context?: Context): Promise; /** * Retrieves the reserved quantity of a given inventory item in a given location. * @param inventoryItemId - the id of the inventory item * @param locationIds - the ids of the locations to check * @param context * @return The reserved quantity * @throws when the inventory item is not found */ retrieveReservedQuantity(inventoryItemId: string, locationIds: string[], context?: Context): Promise; /** * Confirms whether there is sufficient inventory for a given quantity of a given inventory item in a given location. * @param inventoryItemId - the id of the inventory item * @param locationIds - the ids of the locations to check * @param quantity - the quantity to check * @param context * @return Whether there is sufficient inventory */ confirmInventory(inventoryItemId: string, locationIds: string[], quantity: BigNumberInput, context?: Context): Promise; private adjustInventoryLevelsForReservationsDeletion; private adjustInventoryLevelsForReservationsRestore; private adjustInventoryLevelsForReservations_; } export {}; //# sourceMappingURL=inventory-module.d.ts.map