5.8 KiB
Class: StoreService
Hierarchy
-
TransactionBaseService<StoreService>↳
StoreService
Constructors
constructor
• new StoreService(__namedParameters)
Parameters
| Name | Type |
|---|---|
__namedParameters |
InjectedDependencies |
Overrides
TransactionBaseService<StoreService>.constructor
Defined in
Properties
configModule
• Protected Optional Readonly configModule: Record<string, unknown>
Inherited from
TransactionBaseService.configModule
container
• Protected Readonly container: unknown
Inherited from
TransactionBaseService.container
currencyRepository_
• Protected Readonly currencyRepository_: typeof CurrencyRepository
Defined in
eventBus_
• Protected Readonly eventBus_: EventBusService
Defined in
manager_
• Protected manager_: EntityManager
Overrides
TransactionBaseService.manager_
Defined in
storeRepository_
• Protected Readonly storeRepository_: typeof StoreRepository
Defined in
transactionManager_
• Protected transactionManager_: EntityManager
Overrides
TransactionBaseService.transactionManager_
Defined in
Methods
addCurrency
▸ addCurrency(code): Promise<Store>
Parameters
| Name | Type | Description |
|---|---|---|
code |
string |
Returns
Promise<Store>
Defined in
atomicPhase_
▸ Protected atomicPhase_<TResult, TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise<TResult>
Type parameters
| Name |
|---|
TResult |
TError |
Parameters
| Name | Type | Description |
|---|---|---|
work |
(transactionManager: EntityManager) => Promise<TResult> |
|
isolationOrErrorHandler? |
IsolationLevel | (error: TError) => Promise<void | TResult> |
|
maybeErrorHandlerOrDontFail? |
(error: TError) => Promise<void | TResult> |
Returns
Promise<TResult>
Inherited from
TransactionBaseService.atomicPhase_
Defined in
interfaces/transaction-base-service.ts:53
create
▸ create(): Promise<Store>
Returns
Promise<Store>
Defined in
getDefaultCurrency_
▸ Protected getDefaultCurrency_(code): Partial<Currency>
Parameters
| Name | Type |
|---|---|
code |
string |
Returns
Partial<Currency>
Defined in
removeCurrency
▸ removeCurrency(code): Promise<any>
Parameters
| Name | Type | Description |
|---|---|---|
code |
string |
Returns
Promise<any>
Defined in
retrieve
▸ retrieve(config?): Promise<Store>
Parameters
| Name | Type | Description |
|---|---|---|
config |
FindConfig<Store> |
Returns
Promise<Store>
Defined in
shouldRetryTransaction_
▸ Protected shouldRetryTransaction_(err): boolean
Parameters
| Name | Type |
|---|---|
err |
Record<string, unknown> | { code: string } |
Returns
boolean
Inherited from
TransactionBaseService.shouldRetryTransaction_
Defined in
interfaces/transaction-base-service.ts:34
update
▸ update(data): Promise<Store>
Parameters
| Name | Type | Description |
|---|---|---|
data |
UpdateStoreInput |
Returns
Promise<Store>
Defined in
withTransaction
▸ withTransaction(transactionManager?): StoreService
Parameters
| Name | Type |
|---|---|
transactionManager? |
EntityManager |
Returns
Inherited from
TransactionBaseService.withTransaction