TaxRateService
Constructors
constructor
**new TaxRateService**(«destructured»)
Parameters
__namedParameters
ObjectRequiredProperties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtaxRateRepository_
Repository<TaxRate> & { addToProduct: Method addToProduct ; addToProductType: Method addToProductType ; addToShippingOption: Method addToShippingOption ; applyResolutionsToQueryBuilder: Method applyResolutionsToQueryBuilder ; findAndCountWithResolution: Method findAndCountWithResolution ; findOneWithResolution: Method findOneWithResolution ; findWithResolution: Method findWithResolution ; getFindQueryBuilder: Method getFindQueryBuilder ; listByProduct: Method listByProduct ; listByShippingOption: Method listByShippingOption ; removeFromProduct: Method removeFromProduct ; removeFromProductType: Method removeFromProductType ; removeFromShippingOption: Method removeFromShippingOption }RequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
activeManager_
Protected get**activeManager_**(): EntityManager
Returns
EntityManager
EntityManager
EntityManagerRequiredMethods
addToProduct
**addToProduct**(id, productIds, replace?): Promise<[ProductTaxRate](/references/services/classes/ProductTaxRate) \| [ProductTaxRate](/references/services/classes/ProductTaxRate)[]>
Parameters
id
stringRequiredproductIds
string | string[]Requiredreplace
booleanRequiredDefault: false
Returns
Promise<ProductTaxRate | ProductTaxRate[]>
addToProductType
**addToProductType**(id, productTypeIds, replace?): Promise<[ProductTypeTaxRate](/references/services/classes/ProductTypeTaxRate)[]>
Parameters
id
stringRequiredproductTypeIds
string | string[]Requiredreplace
booleanRequiredDefault: false
Returns
Promise<ProductTypeTaxRate[]>
addToShippingOption
**addToShippingOption**(id, optionIds, replace?): Promise<[ShippingTaxRate](/references/services/classes/ShippingTaxRate)[]>
Parameters
id
stringRequiredoptionIds
string | string[]Requiredreplace
booleanRequiredDefault: false
Returns
Promise<ShippingTaxRate[]>
atomicPhase_
Protected **atomicPhase_**<TypeParameter TResult, TypeParameter 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>Requiredcreate
**create**(data): Promise<[TaxRate](/references/services/classes/TaxRate)>
Parameters
Returns
Promise<TaxRate>
delete
**delete**(id): Promise<void>
Parameters
id
string | string[]RequiredReturns
Promise<void>
Promise
Promise<void>Requiredlist
**list**(selector, config?): Promise<[TaxRate](/references/services/classes/TaxRate)[]>
Parameters
Default: {}
Returns
Promise<TaxRate[]>
listAndCount
**listAndCount**(selector, config?): Promise<[[TaxRate](/references/services/classes/TaxRate)[], number]>
Parameters
Default: {}
Returns
Promise<[TaxRate[], number]>
listByProduct
**listByProduct**(productId, config): Promise<[TaxRate](/references/services/classes/TaxRate)[]>
Parameters
productId
stringRequiredReturns
Promise<TaxRate[]>
listByShippingOption
**listByShippingOption**(shippingOptionId): Promise<[TaxRate](/references/services/classes/TaxRate)[]>
Parameters
shippingOptionId
stringRequiredReturns
Promise<TaxRate[]>
removeFromProduct
**removeFromProduct**(id, productIds): Promise<void>
Parameters
id
stringRequiredproductIds
string | string[]RequiredReturns
Promise<void>
Promise
Promise<void>RequiredremoveFromProductType
**removeFromProductType**(id, typeIds): Promise<void>
Parameters
id
stringRequiredtypeIds
string | string[]RequiredReturns
Promise<void>
Promise
Promise<void>RequiredremoveFromShippingOption
**removeFromShippingOption**(id, optionIds): Promise<void>
Parameters
id
stringRequiredoptionIds
string | string[]RequiredReturns
Promise<void>
Promise
Promise<void>Requiredretrieve
**retrieve**(taxRateId, config?): Promise<[TaxRate](/references/services/classes/TaxRate)>
Parameters
taxRateId
stringRequiredDefault: {}
Returns
Promise<TaxRate>
shouldRetryTransaction_
Protected **shouldRetryTransaction_**(err): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanupdate
**update**(id, data): Promise<[TaxRate](/references/services/classes/TaxRate)>
Parameters
id
stringRequiredReturns
Promise<TaxRate>
withTransaction
**withTransaction**(transactionManager?): [TaxRateService](/references/services/classes/TaxRateService)
Parameters
transactionManager
EntityManager