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
EntityManager
EntityManagerRequiredInherited 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.
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
<TResult
>
Promise
Promise<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
variantIds
string[]RequiredReturns
Promise
<void
>
Promise
Promise<void>RequiredImplementation of
IPriceSelectionStrategy.onVariantsPricesUpdate
shouldRetryTransaction_
Protected
shouldRetryTransaction_(err
): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanInherited from
TransactionBaseService.shouldRetryTransaction_
withTransaction
withTransaction(transactionManager?
): AbstractPriceSelectionStrategy
Parameters
transactionManager
EntityManagerReturns
AbstractPriceSelectionStrategy
Implementation of
IPriceSelectionStrategy.withTransaction