StoreService
Provides layer to manipulate store settings.
constructor
Parameters
__namedParameters
InjectedDependenciesRequiredProperties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
addCurrency
Add a currency to the store
Parameters
code
stringRequired3 character ISO currency code
Returns
result after update
atomicPhase_
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
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>Requiredthe 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
Promise<TResult>Requiredthe result of the transactional work
create
Creates a store if it doesn't already exist.
Returns
The store.
getDefaultCurrency_
Parameters
code
stringRequiredReturns
removeCurrency
Removes a currency from the store
Parameters
code
stringRequired3 character ISO currency code
Returns
Promise
Promise<any>Requiredresult after update
retrieve
Retrieve the store settings. There is always a maximum of one store.
Parameters
The config object from which the query will be built
Default: {}
Returns
the store
shouldRetryTransaction_
Parameters
err
Record<string, unknown> | objectRequiredReturns
boolean
booleanupdate
Updates a store
Parameters
data
UpdateStoreInputRequiredan object with the update values.
Returns
resolves to the update result.
withTransaction
Parameters
transactionManager
EntityManagerReturns
StoreService
objectRequiredProvides layer to manipulate store settings.
Was this section helpful?