DiscountConditionService
Provides layer to manipulate discount conditions.
Implements
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>discountConditionRepository_
Repository<DiscountCondition> & { addConditionResources: Method addConditionResources ; canApplyForCustomer: Method canApplyForCustomer ; findOneWithDiscount: Method findOneWithDiscount ; getJoinTableResourceIdentifiers: Method getJoinTableResourceIdentifiers ; isValidForProduct: Method isValidForProduct ; queryConditionTable: Method queryConditionTable ; removeConditionResources: Method removeConditionResources }Requiredmanager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
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.
Parameters
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
delete
Parameters
discountConditionId
stringRequiredReturns
removeResources
Parameters
Returns
Promise
Promise<void>Requiredretrieve
Parameters
conditionId
stringRequiredconfig
FindConfig<DiscountCondition>Returns
shouldRetryTransaction_
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
booleanupsertCondition
Parameters
overrideExisting
booleanReturns
Promise
Promise<(DiscountConditionCustomerGroup | DiscountConditionProduct | DiscountConditionProductCollection | DiscountConditionProductTag | DiscountConditionProductType)[]>RequiredwithTransaction
Parameters
transactionManager
EntityManagerReturns
resolveConditionType_
Parameters
Returns
undefined \| { resource_ids: (string \| { id: string })[] ; type: DiscountConditionType }
undefined | { resource_ids: (string \| { id: string })[] ; type: [DiscountConditionType](/references/js-client/internal/enums/internal.internal.DiscountConditionType) }Was this section helpful?