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
EntityManager
EntityManagerRequiredinventoryService_
Protected
get
inventoryService_(): 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
(inventoryLevelId: 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: CreateInventoryItemInput, context?: SharedContext) => Promise<InventoryItemDTO>RequiredupdateInventoryLevel
(inventoryItemId: string, locationId: string, update: UpdateInventoryLevelInput, context?: SharedContext) => Promise<InventoryLevelDTO>RequiredupdateInventoryLevels
(updates: { inventory_item_id: string ; location_id: string } & UpdateInventoryLevelInput[], context?: SharedContext) => Promise<InventoryLevelDTO[]>RequiredupdateReservationItem
(reservationItemId: string, input: UpdateReservationItemInput, context?: SharedContext) => Promise<ReservationItemDTO>RequiredMethods
atomicPhase_
Protected
atomicPhase_<TResult
, 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.
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
<TResult
>
Promise
Promise<TResult>RequiredretrieveAvailableItemQuantity
retrieveAvailableItemQuantity(salesChannelId
, inventoryItemId
): Promise
<number
>
Retrieves the available quantity of an item across all sales channel locations
Parameters
salesChannelId
stringRequiredinventoryItemId
stringRequiredReturns
Promise
<number
>
Promise
Promise<number>RequiredshouldRetryTransaction_
Protected
shouldRetryTransaction_(err
): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanwithTransaction
withTransaction(transactionManager?
): SalesChannelInventoryService
Parameters
transactionManager
EntityManager