SalesChannelLocationService
internal.internal.SalesChannelLocationService
Service for managing the stock locations of sales channels
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
activeManager_
Protected
get
activeManager_(): EntityManager
Returns
EntityManager
EntityManager
EntityManagerRequiredInherited from
TransactionBaseService.activeManager_
Methods
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_<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>RequiredInherited from
TransactionBaseService.atomicPhase_
listLocationIds
listLocationIds(salesChannelId
): Promise
<string
[]>
Lists the stock locations associated with a sales channel.
Parameters
salesChannelId
string | string[]RequiredReturns
Promise
<string
[]>
Promise
Promise<string[]>RequiredA promise that resolves with an array of location IDs.
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[]>RequiredA promise that resolves with an array of sales channel IDs.
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
booleanInherited from
TransactionBaseService.shouldRetryTransaction_
withTransaction
withTransaction(transactionManager?
): SalesChannelLocationService
Parameters
transactionManager
EntityManager