Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
7.5 KiB
displayed_sidebar
| displayed_sidebar |
|---|
| jsClientSidebar |
Class: SalesChannelLocationService
internal.internal.SalesChannelLocationService
Service for managing the stock locations of sales channels
Hierarchy
-
↳
SalesChannelLocationService
Properties
__configModule__
• Protected Optional Readonly __configModule__: Record<string, unknown>
Inherited from
TransactionBaseService.configModule
Defined in
packages/medusa/dist/interfaces/transaction-base-service.d.ts:5
__container__
• Protected Readonly __container__: any
Inherited from
TransactionBaseService.container
Defined in
packages/medusa/dist/interfaces/transaction-base-service.d.ts:4
__moduleDeclaration__
• Protected Optional Readonly __moduleDeclaration__: Record<string, unknown>
Inherited from
TransactionBaseService.moduleDeclaration
Defined in
packages/medusa/dist/interfaces/transaction-base-service.d.ts:6
eventBusService_
• Protected Readonly eventBusService_: IEventBusService
Defined in
packages/medusa/dist/services/sales-channel-location.d.ts:16
manager_
• Protected manager_: EntityManager
Inherited from
TransactionBaseService.manager_
Defined in
packages/medusa/dist/interfaces/transaction-base-service.d.ts:7
salesChannelService_
• Protected Readonly salesChannelService_: SalesChannelService
Defined in
packages/medusa/dist/services/sales-channel-location.d.ts:15
stockLocationService_
• Protected Readonly stockLocationService_: IStockLocationService
Defined in
packages/medusa/dist/services/sales-channel-location.d.ts:17
transactionManager_
• Protected transactionManager_: undefined | EntityManager
Inherited from
TransactionBaseService.transactionManager_
Defined in
packages/medusa/dist/interfaces/transaction-base-service.d.ts:8
Accessors
activeManager_
• Protected get activeManager_(): EntityManager
Returns
EntityManager
Inherited from
TransactionBaseService.activeManager_
Defined in
packages/medusa/dist/interfaces/transaction-base-service.d.ts:9
Methods
associateLocation
▸ associateLocation(salesChannelId, locationId): Promise<void>
Associates a sales channel with a stock location.
Parameters
| Name | Type | Description |
|---|---|---|
salesChannelId |
string |
The ID of the sales channel. |
locationId |
string |
The ID of the stock location. |
Returns
Promise<void>
A promise that resolves when the association has been created.
Defined in
packages/medusa/dist/services/sales-channel-location.d.ts:32
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.
Type parameters
| Name |
|---|
TResult |
TError |
Parameters
| Name | Type | Description |
|---|---|---|
work |
(transactionManager: EntityManager) => Promise<TResult> |
the transactional work to be done |
isolationOrErrorHandler? |
IsolationLevel | (error: TError) => Promise<void | TResult> |
the isolation level to be used for the work. |
maybeErrorHandlerOrDontFail? |
(error: TError) => Promise<void | TResult> |
Potential error handler |
Returns
Promise<TResult>
the result of the transactional work
Inherited from
TransactionBaseService.atomicPhase_
Defined in
packages/medusa/dist/interfaces/transaction-base-service.d.ts:24
listLocationIds
▸ listLocationIds(salesChannelId): Promise<string[]>
Lists the stock locations associated with a sales channel.
Parameters
| Name | Type | Description |
|---|---|---|
salesChannelId |
string | string[] |
The ID of the sales channel. |
Returns
Promise<string[]>
A promise that resolves with an array of location IDs.
Defined in
packages/medusa/dist/services/sales-channel-location.d.ts:38
listSalesChannelIds
▸ listSalesChannelIds(locationId): Promise<string[]>
Lists the sales channels associated with a stock location.
Parameters
| Name | Type |
|---|---|
locationId |
string |
Returns
Promise<string[]>
A promise that resolves with an array of sales channel IDs.
Defined in
packages/medusa/dist/services/sales-channel-location.d.ts:44
removeLocation
▸ removeLocation(locationId, salesChannelId?): Promise<void>
Removes an association between a sales channel and a stock location.
Parameters
| Name | Type | Description |
|---|---|---|
locationId |
string |
The ID of the stock location. |
salesChannelId? |
string |
The ID of the sales channel or undefined if all the sales channel will be affected. |
Returns
Promise<void>
A promise that resolves when the association has been removed.
Defined in
packages/medusa/dist/services/sales-channel-location.d.ts:25
shouldRetryTransaction_
▸ Protected shouldRetryTransaction_(err): boolean
Parameters
| Name | Type |
|---|---|
err |
Record<string, unknown> | { code: string } |
Returns
boolean
Inherited from
TransactionBaseService.shouldRetryTransaction_
Defined in
packages/medusa/dist/interfaces/transaction-base-service.d.ts:12
withTransaction
▸ withTransaction(transactionManager?): SalesChannelLocationService
Parameters
| Name | Type |
|---|---|
transactionManager? |
EntityManager |
Returns
Inherited from
TransactionBaseService.withTransaction
Defined in
packages/medusa/dist/interfaces/transaction-base-service.d.ts:11