AbstractPriceSelectionStrategy
internal.internal.AbstractPriceSelectionStrategy
Implements
Properties
__configModule__Record<string, unknown>__container__anyRequired__moduleDeclaration__Record<string, unknown>manager_EntityManagerRequiredtransactionManager_undefined | EntityManagerRequiredAccessors
activeManager_
Protected get activeManager_(): EntityManager
Returns
EntityManager
EntityManagerEntityManagerRequiredInherited from
TransactionBaseService.activeManager_
Methods
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.
TResultobjectRequiredTErrorobjectRequiredParameters
work(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>Returns
Promise<TResult>
PromisePromise<TResult>RequiredInherited from
TransactionBaseService.atomicPhase_
calculateVariantPrice
Abstract calculateVariantPrice(data, context): Promise<Map<string, PriceSelectionResult>>
Calculate the original and discount price for a given variant in a set of circumstances described in the context.
Parameters
Returns
Promise<Map<string, PriceSelectionResult>>
pricing details in an object containing the calculated lowest price,
the default price an all valid prices for the given variant
Implementation of
IPriceSelectionStrategy.calculateVariantPrice
onVariantsPricesUpdate
onVariantsPricesUpdate(variantIds): Promise<void>
Notify price selection strategy that variants prices have been updated.
Parameters
variantIdsstring[]RequiredReturns
Promise<void>
PromisePromise<void>RequiredImplementation of
IPriceSelectionStrategy.onVariantsPricesUpdate
shouldRetryTransaction_
Protected shouldRetryTransaction_(err): boolean
Parameters
errRecord<string, unknown> | { code: string }RequiredReturns
boolean
booleanbooleanInherited from
TransactionBaseService.shouldRetryTransaction_
withTransaction
withTransaction(transactionManager?): AbstractPriceSelectionStrategy
Parameters
transactionManagerEntityManagerReturns
AbstractPriceSelectionStrategy
Implementation of
IPriceSelectionStrategy.withTransaction