SalesChannelLocationService
Service for managing the stock locations of sales channels
Constructors
constructor
**new SalesChannelLocationService**(«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
EntityManagerRequiredstockLocationService_
Protected get**stockLocationService_**(): [IStockLocationService](/references/services/interfaces/IStockLocationService)
Returns
create
(input: CreateStockLocationInput, context?: SharedContext) => Promise<StockLocationDTO>Requiredlist
(selector: FilterableStockLocationProps, config?: FindConfig<StockLocationDTO>, context?: SharedContext) => Promise<StockLocationDTO[]>RequiredlistAndCount
(selector: FilterableStockLocationProps, config?: FindConfig<StockLocationDTO>, context?: SharedContext) => Promise<[StockLocationDTO[], number]>Requiredretrieve
(id: string, config?: FindConfig<StockLocationDTO>, context?: SharedContext) => Promise<StockLocationDTO>Requiredupdate
(id: string, input: UpdateStockLocationInput, context?: SharedContext) => Promise<StockLocationDTO>RequiredMethods
associateLocation
**associateLocation**(salesChannelId, locationId): Promise<void>
Associates a sales channel with a stock location.
Parameters
salesChannelId
stringRequiredlocationId
stringRequiredReturns
Promise<void>
Promise
Promise<void>RequiredatomicPhase_
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.
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>RequiredlistLocationIds
**listLocationIds**(salesChannelId): Promise<string[]>
Lists the stock locations associated with a sales channel.
Parameters
salesChannelId
string | string[]RequiredReturns
Promise<string[]>
Promise
Promise<string[]>RequiredlistSalesChannelIds
**listSalesChannelIds**(locationId): Promise<string[]>
Lists the sales channels associated with a stock location.
Parameters
locationId
stringRequiredReturns
Promise<string[]>
Promise
Promise<string[]>RequiredremoveLocation
**removeLocation**(locationId, salesChannelId?): Promise<void>
Removes an association between a sales channel and a stock location.
Parameters
locationId
stringRequiredsalesChannelId
stringReturns
Promise<void>
Promise
Promise<void>RequiredshouldRetryTransaction_
Protected **shouldRetryTransaction_**(err): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanwithTransaction
**withTransaction**(transactionManager?): [SalesChannelLocationService](/references/services/classes/SalesChannelLocationService)
Parameters
transactionManager
EntityManager