--- displayed_sidebar: servicesSidebar --- import ParameterTypes from "@site/src/components/ParameterTypes" # SalesChannelLocationService Service for managing the stock locations of sales channels ## Constructors ### constructor `**new SalesChannelLocationService**(«destructured»)` #### Parameters ## Properties `", "description": "", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "__container__", "type": "`any`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "__moduleDeclaration__", "type": "`Record`", "description": "", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "eventBusService_", "type": "[IEventBusService](../interfaces/IEventBusService.mdx)", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "manager_", "type": "EntityManager", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "salesChannelService_", "type": "[SalesChannelService](SalesChannelService.mdx)", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "transactionManager_", "type": "`undefined` \\| EntityManager", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ]} /> ## Accessors ### activeManager\_ `Protected get**activeManager_**(): EntityManager` #### Returns EntityManager ___ ### stockLocationService\_ `Protected get**stockLocationService_**(): [IStockLocationService](../interfaces/IStockLocationService.mdx)` #### Returns [IStockLocationService](../interfaces/IStockLocationService.mdx) [ModuleJoinerConfig](../types/ModuleJoinerConfig.mdx)", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "create", "type": "(`input`: [CreateStockLocationInput](../types/CreateStockLocationInput.mdx), `context?`: [SharedContext](../types/SharedContext.mdx)) => Promise<[StockLocationDTO](../types/StockLocationDTO.mdx)>", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "delete", "type": "(`id`: `string`, `context?`: [SharedContext](../types/SharedContext.mdx)) => Promise<void>", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "list", "type": "(`selector`: [FilterableStockLocationProps](../types/FilterableStockLocationProps.mdx), `config?`: [FindConfig](../interfaces/FindConfig-1.mdx)<[StockLocationDTO](../types/StockLocationDTO.mdx)>, `context?`: [SharedContext](../types/SharedContext.mdx)) => Promise<[StockLocationDTO](../types/StockLocationDTO.mdx)[]>", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "listAndCount", "type": "(`selector`: [FilterableStockLocationProps](../types/FilterableStockLocationProps.mdx), `config?`: [FindConfig](../interfaces/FindConfig-1.mdx)<[StockLocationDTO](../types/StockLocationDTO.mdx)>, `context?`: [SharedContext](../types/SharedContext.mdx)) => Promise<[[StockLocationDTO](../types/StockLocationDTO.mdx)[], number]>", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "retrieve", "type": "(`id`: `string`, `config?`: [FindConfig](../interfaces/FindConfig-1.mdx)<[StockLocationDTO](../types/StockLocationDTO.mdx)>, `context?`: [SharedContext](../types/SharedContext.mdx)) => Promise<[StockLocationDTO](../types/StockLocationDTO.mdx)>", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "update", "type": "(`id`: `string`, `input`: [UpdateStockLocationInput](../types/UpdateStockLocationInput.mdx), `context?`: [SharedContext](../types/SharedContext.mdx)) => Promise<[StockLocationDTO](../types/StockLocationDTO.mdx)>", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ]} /> ## Methods ### associateLocation `**associateLocation**(salesChannelId, locationId): Promise<void>` Associates a sales channel with a stock location. #### Parameters #### Returns Promise<void> ___ ### atomicPhase\_ `Protected **atomicPhase_**(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. #### Parameters Promise<TResult>", "description": "the transactional work to be done", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "isolationOrErrorHandler", "type": "`IsolationLevel` \\| (`error`: `TError`) => Promise<void \\| TResult>", "description": "the isolation level to be used for the work.", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "maybeErrorHandlerOrDontFail", "type": "(`error`: `TError`) => Promise<void \\| TResult>", "description": "Potential error handler", "optional": true, "defaultValue": "", "expandable": false, "children": [] } ]} /> #### Returns Promise<TResult> ___ ### listLocationIds `**listLocationIds**(salesChannelId): Promise<string[]>` Lists the stock locations associated with a sales channel. #### Parameters #### Returns Promise<string[]> ___ ### listSalesChannelIds `**listSalesChannelIds**(locationId): Promise<string[]>` Lists the sales channels associated with a stock location. #### Parameters #### Returns Promise<string[]> ___ ### removeLocation `**removeLocation**(locationId, salesChannelId?): Promise<void>` Removes an association between a sales channel and a stock location. #### Parameters #### Returns Promise<void> ___ ### shouldRetryTransaction\_ `Protected **shouldRetryTransaction_**(err): boolean` #### Parameters ` \\| `{ code: string }`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ]} /> #### Returns `boolean` ___ ### withTransaction `**withTransaction**(transactionManager?): [SalesChannelLocationService](SalesChannelLocationService.mdx)` #### Parameters #### Returns [SalesChannelLocationService](SalesChannelLocationService.mdx)