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 activeManager_: [object Object]
stockLocationService_
Protected stockLocationService_: [object Object]
Methods
associateLocation
**associateLocation**(salesChannelId, locationId): Promise<void>
Associates a sales channel with a stock location.
Parameters
salesChannelIdstringRequiredlocationIdstringRequiredReturns
Promise<void>
PromisePromise<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.
Type Parameters
TResultobjectRequiredTErrorobjectRequiredParameters
work(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>Returns
Promise<TResult>
PromisePromise<TResult>RequiredlistLocationIds
**listLocationIds**(salesChannelId): Promise<string[]>
Lists the stock locations associated with a sales channel.
Parameters
salesChannelIdstring | string[]RequiredReturns
Promise<string[]>
PromisePromise<string[]>RequiredlistSalesChannelIds
**listSalesChannelIds**(locationId): Promise<string[]>
Lists the sales channels associated with a stock location.
Parameters
locationIdstringRequiredReturns
Promise<string[]>
PromisePromise<string[]>RequiredremoveLocation
**removeLocation**(locationId, salesChannelId?): Promise<void>
Removes an association between a sales channel and a stock location.
Parameters
locationIdstringRequiredsalesChannelIdstringReturns
Promise<void>
PromisePromise<void>RequiredshouldRetryTransaction_
Protected **shouldRetryTransaction_**(err): boolean
Parameters
errRecord<string, unknown> | { code: string }RequiredReturns
boolean
booleanbooleanwithTransaction
**withTransaction**(transactionManager?): [SalesChannelLocationService](/references/services/classes/SalesChannelLocationService)
Parameters
transactionManagerEntityManager