SalesChannelInventoryService
Constructors
constructor
**new SalesChannelInventoryService**(«destructured»)
Parameters
Properties
__configModule__Record<string, unknown>__container__anyRequired__moduleDeclaration__Record<string, unknown>manager_EntityManagerRequiredtransactionManager_undefined | EntityManagerRequiredAccessors
activeManager_
Protected get**activeManager_**(): EntityManager
Returns
EntityManager
EntityManagerEntityManagerRequiredinventoryService_
Protected get**inventoryService_**(): [IInventoryService](/references/services/interfaces/IInventoryService)
Returns
adjustInventory(inventoryItemId: string, locationId: string, adjustment: number, context?: SharedContext) => Promise<InventoryLevelDTO>RequiredconfirmInventory(inventoryItemId: string, locationIds: string[], quantity: number, context?: SharedContext) => Promise<boolean>RequiredcreateInventoryItem(input: CreateInventoryItemInput, context?: SharedContext) => Promise<InventoryItemDTO>RequiredcreateInventoryItems(input: CreateInventoryItemInput[], context?: SharedContext) => Promise<InventoryItemDTO[]>RequiredcreateInventoryLevel(data: CreateInventoryLevelInput, context?: SharedContext) => Promise<InventoryLevelDTO>RequiredcreateInventoryLevels(data: CreateInventoryLevelInput[], context?: SharedContext) => Promise<InventoryLevelDTO[]>RequiredcreateReservationItem(input: CreateReservationItemInput, context?: SharedContext) => Promise<ReservationItemDTO>RequiredcreateReservationItems(input: CreateReservationItemInput[], context?: SharedContext) => Promise<ReservationItemDTO[]>RequireddeleteInventoryItem(inventoryItemId: string | string[], context?: SharedContext) => Promise<void>RequireddeleteInventoryItemLevelByLocationId(locationId: string | string[], context?: SharedContext) => Promise<void>RequireddeleteInventoryLevel(inventoryItemId: string, locationId: string, context?: SharedContext) => Promise<void>RequireddeleteReservationItem(reservationItemId: string | string[], context?: SharedContext) => Promise<void>RequireddeleteReservationItemByLocationId(locationId: string | string[], context?: SharedContext) => Promise<void>RequireddeleteReservationItemsByLineItem(lineItemId: string | string[], context?: SharedContext) => Promise<void>RequiredlistInventoryItems(selector: FilterableInventoryItemProps, config?: FindConfig<InventoryItemDTO>, context?: SharedContext) => Promise<[InventoryItemDTO[], number]>RequiredlistInventoryLevels(selector: FilterableInventoryLevelProps, config?: FindConfig<InventoryLevelDTO>, context?: SharedContext) => Promise<[InventoryLevelDTO[], number]>RequiredlistReservationItems(selector: FilterableReservationItemProps, config?: FindConfig<ReservationItemDTO>, context?: SharedContext) => Promise<[ReservationItemDTO[], number]>RequiredrestoreInventoryItem(inventoryItemId: string | string[], context?: SharedContext) => Promise<void>RequiredretrieveAvailableQuantity(inventoryItemId: string, locationIds: string[], context?: SharedContext) => Promise<number>RequiredretrieveInventoryItem(inventoryItemId: string, config?: FindConfig<InventoryItemDTO>, context?: SharedContext) => Promise<InventoryItemDTO>RequiredretrieveInventoryLevel(inventoryItemId: string, locationId: string, context?: SharedContext) => Promise<InventoryLevelDTO>RequiredretrieveReservationItem(reservationId: string, context?: SharedContext) => Promise<ReservationItemDTO>RequiredretrieveReservedQuantity(inventoryItemId: string, locationIds: string[], context?: SharedContext) => Promise<number>RequiredretrieveStockedQuantity(inventoryItemId: string, locationIds: string[], context?: SharedContext) => Promise<number>RequiredupdateInventoryItem(inventoryItemId: string, input: Partial<CreateInventoryItemInput>, context?: SharedContext) => Promise<InventoryItemDTO>RequiredupdateInventoryLevel(inventoryItemId: string, locationId: string, update: UpdateInventoryLevelInput, context?: SharedContext) => Promise<InventoryLevelDTO>RequiredupdateInventoryLevels(updates: BulkUpdateInventoryLevelInput[], context?: SharedContext) => Promise<InventoryLevelDTO[]>RequiredupdateReservationItem(reservationItemId: string, input: UpdateReservationItemInput, context?: SharedContext) => Promise<ReservationItemDTO>RequiredMethods
atomicPhase_
Protected **atomicPhase_**<TypeParameter TResult, TypeParameter TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise<TResult>
Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created.
TResultobjectRequiredTErrorobjectRequiredParameters
work(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>Returns
Promise<TResult>
PromisePromise<TResult>RequiredretrieveAvailableItemQuantity
**retrieveAvailableItemQuantity**(salesChannelId, inventoryItemId): Promise<number>
Retrieves the available quantity of an item across all sales channel locations
Parameters
salesChannelIdstringRequiredinventoryItemIdstringRequiredReturns
Promise<number>
PromisePromise<number>RequiredshouldRetryTransaction_
Protected **shouldRetryTransaction_**(err): boolean
Parameters
errRecord<string, unknown> | { code: string }RequiredReturns
boolean
booleanbooleanwithTransaction
**withTransaction**(transactionManager?): [SalesChannelInventoryService](/references/services/classes/SalesChannelInventoryService)
Parameters
transactionManagerEntityManager