Class: SalesChannelLocationService
Service for managing the stock locations of sales channels
Hierarchy
TransactionBaseService
Copy to Clipboard↳
SalesChannelLocationService
Copy to Clipboard
Constructors
constructor
• new SalesChannelLocationService(__namedParameters
Copy to Clipboard)
Parameters
Name | Type |
---|---|
__namedParameters Copy to Clipboard | InjectedDependencies Copy to Clipboard |
Overrides
TransactionBaseService.constructor
Defined in
packages/medusa/src/services/sales-channel-location.ts:26
Properties
__configModule__
• Protected
Copy to Clipboard Optional
Copy to Clipboard Readonly
Copy to Clipboard __configModule__: Record
Copy to Clipboard<string
Copy to Clipboard, unknown
Copy to Clipboard>
Inherited from
TransactionBaseService.__configModule__
Defined in
packages/medusa/src/interfaces/transaction-base-service.ts:10
__container__
• Protected
Copy to Clipboard Readonly
Copy to Clipboard __container__: any
Copy to Clipboard
Inherited from
TransactionBaseService.__container__
Defined in
packages/medusa/src/interfaces/transaction-base-service.ts:9
__moduleDeclaration__
• Protected
Copy to Clipboard Optional
Copy to Clipboard Readonly
Copy to Clipboard __moduleDeclaration__: Record
Copy to Clipboard<string
Copy to Clipboard, unknown
Copy to Clipboard>
Inherited from
TransactionBaseService.__moduleDeclaration__
Defined in
packages/medusa/src/interfaces/transaction-base-service.ts:11
eventBusService
• Protected
Copy to Clipboard Readonly
Copy to Clipboard eventBusService: EventBusService
Copy to Clipboard
Defined in
packages/medusa/src/services/sales-channel-location.ts:23
manager_
• Protected
Copy to Clipboard manager_: EntityManager
Copy to Clipboard
Overrides
TransactionBaseService.manager_
Defined in
packages/medusa/src/services/sales-channel-location.ts:19
salesChannelService_
• Protected
Copy to Clipboard Readonly
Copy to Clipboard salesChannelService_: SalesChannelService
Copy to Clipboard
Defined in
packages/medusa/src/services/sales-channel-location.ts:22
stockLocationService
• Protected
Copy to Clipboard Readonly
Copy to Clipboard stockLocationService: IStockLocationService
Copy to Clipboard
Defined in
packages/medusa/src/services/sales-channel-location.ts:24
transactionManager_
• Protected
Copy to Clipboard transactionManager_: undefined
Copy to Clipboard | EntityManager
Copy to Clipboard
Overrides
TransactionBaseService.transactionManager_
Defined in
packages/medusa/src/services/sales-channel-location.ts:20
Methods
associateLocation
▸ associateLocation(salesChannelId
Copy to Clipboard, locationId
Copy to Clipboard): Promise
Copy to Clipboard<void
Copy to Clipboard>
Associates a sales channel with a stock location.
Parameters
Name | Type | Description |
---|---|---|
salesChannelId Copy to Clipboard | string Copy to Clipboard | The ID of the sales channel. |
locationId Copy to Clipboard | string Copy to Clipboard | The ID of the stock location. |
Returns
Promise
Copy to Clipboard<void
Copy to Clipboard>
A promise that resolves when the association has been created.
Defined in
packages/medusa/src/services/sales-channel-location.ts:77
atomicPhase_
▸ Protected
Copy to Clipboard atomicPhase_<TResult
Copy to Clipboard, TError
Copy to Clipboard>(work
Copy to Clipboard, isolationOrErrorHandler?
Copy to Clipboard, maybeErrorHandlerOrDontFail?
Copy to Clipboard): Promise
Copy to Clipboard<TResult
Copy to Clipboard>
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 Copy to Clipboard |
TError Copy to Clipboard |
Parameters
Name | Type | Description |
---|---|---|
work Copy to Clipboard | (transactionManager Copy to Clipboard: EntityManager Copy to Clipboard) => Promise Copy to Clipboard<TResult Copy to Clipboard> | the transactional work to be done |
isolationOrErrorHandler? Copy to Clipboard | IsolationLevel Copy to Clipboard | (error Copy to Clipboard: TError Copy to Clipboard) => Promise Copy to Clipboard<void Copy to Clipboard | TResult Copy to Clipboard> | the isolation level to be used for the work. |
maybeErrorHandlerOrDontFail? Copy to Clipboard | (error Copy to Clipboard: TError Copy to Clipboard) => Promise Copy to Clipboard<void Copy to Clipboard | TResult Copy to Clipboard> | Potential error handler |
Returns
Promise
Copy to Clipboard<TResult
Copy to Clipboard>
the result of the transactional work
Inherited from
TransactionBaseService.atomicPhase_
Defined in
packages/medusa/src/interfaces/transaction-base-service.ts:50
listLocations
▸ listLocations(salesChannelId
Copy to Clipboard): Promise
Copy to Clipboard<string
Copy to Clipboard[]>
Lists the stock locations associated with a sales channel.
Parameters
Name | Type | Description |
---|---|---|
salesChannelId Copy to Clipboard | string Copy to Clipboard | The ID of the sales channel. |
Returns
Promise
Copy to Clipboard<string
Copy to Clipboard[]>
A promise that resolves with an array of location IDs.
Defined in
packages/medusa/src/services/sales-channel-location.ts:104
removeLocation
▸ removeLocation(locationId
Copy to Clipboard, salesChannelId?
Copy to Clipboard): Promise
Copy to Clipboard<void
Copy to Clipboard>
Removes an association between a sales channel and a stock location.
Parameters
Name | Type | Description |
---|---|---|
locationId Copy to Clipboard | string Copy to Clipboard | The ID of the stock location. |
salesChannelId? Copy to Clipboard | string Copy to Clipboard | The ID of the sales channel or undefined if all the sales channel will be affected. |
Returns
Promise
Copy to Clipboard<void
Copy to Clipboard>
A promise that resolves when the association has been removed.
Defined in
packages/medusa/src/services/sales-channel-location.ts:47
shouldRetryTransaction_
▸ Protected
Copy to Clipboard shouldRetryTransaction_(err
Copy to Clipboard): boolean
Copy to Clipboard
Parameters
Name | Type |
---|---|
err Copy to Clipboard | Record Copy to Clipboard<string Copy to Clipboard, unknown Copy to Clipboard> | { code Copy to Clipboard: string Copy to Clipboard } |
Returns
boolean
Copy to Clipboard
Inherited from
TransactionBaseService.shouldRetryTransaction_
Defined in
packages/medusa/src/interfaces/transaction-base-service.ts:31
withTransaction
▸ withTransaction(transactionManager?
Copy to Clipboard): SalesChannelLocationService
Copy to Clipboard
Parameters
Name | Type |
---|---|
transactionManager? Copy to Clipboard | EntityManager Copy to Clipboard |
Returns
SalesChannelLocationService
Copy to Clipboard
Inherited from
TransactionBaseService.withTransaction
Defined in
packages/medusa/src/interfaces/transaction-base-service.ts:14