DiscountConditionService
internal.internal.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_
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_
delete
delete(discountConditionId
): Promise
<void
| DiscountCondition
>
Parameters
discountConditionId
stringRequiredReturns
Promise
<void
| DiscountCondition
>
removeResources
removeResources(data
): Promise
<void
>
Parameters
Returns
Promise
<void
>
Promise
Promise<void>Requiredretrieve
retrieve(conditionId
, config?
): Promise
<DiscountCondition
>
Parameters
conditionId
stringRequiredconfig
FindConfig<DiscountCondition>Returns
Promise
<DiscountCondition
>
shouldRetryTransaction_
Protected
shouldRetryTransaction_(err
): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanInherited from
TransactionBaseService.shouldRetryTransaction_
upsertCondition
upsertCondition(data
, overrideExisting?
): Promise
<(DiscountConditionCustomerGroup
| DiscountConditionProduct
| DiscountConditionProductCollection
| DiscountConditionProductTag
| DiscountConditionProductType
)[]>
Parameters
overrideExisting
booleanReturns
Promise
<(DiscountConditionCustomerGroup
| DiscountConditionProduct
| DiscountConditionProductCollection
| DiscountConditionProductTag
| DiscountConditionProductType
)[]>
Promise
Promise<(DiscountConditionCustomerGroup | DiscountConditionProduct | DiscountConditionProductCollection | DiscountConditionProductTag | DiscountConditionProductType)[]>Required
Promise
Promise<(DiscountConditionCustomerGroup | DiscountConditionProduct | DiscountConditionProductCollection | DiscountConditionProductTag | DiscountConditionProductType)[]>RequiredwithTransaction
withTransaction(transactionManager?
): DiscountConditionService
Parameters
transactionManager
EntityManagerReturns
Inherited from
TransactionBaseService.withTransaction
resolveConditionType_
Static
Protected
resolveConditionType_(data
): undefined
| { resource_ids
: (string
| { id
: string
})[] ; type
: DiscountConditionType
}
Parameters
Returns
undefined
| { resource_ids
: (string
| { id
: string
})[] ; type
: DiscountConditionType
}
undefined \| { `resource_ids`: (`string` \| { `id`: `string` })[] ; `type`: [`DiscountConditionType`](/references/js-client/internal/enums/admin_collections.internal.DiscountConditionType) }
undefined | { resource_ids: (string | { id: string })[] ; type: DiscountConditionType }