Skip to main content
Skip to main content

TaxRateService

constructor

Parameters

__namedParametersobjectRequired
__namedParameters.productServiceanyRequired
__namedParameters.productTypeServiceanyRequired
__namedParameters.shippingOptionServiceanyRequired
__namedParameters.taxRateRepositoryanyRequired

Properties

manager_EntityManagerRequired
transactionManager_undefined | EntityManagerRequired
__container__anyRequired
productService_ProductServiceRequired
productTypeService_ProductTypeServiceRequired
shippingOptionService_ShippingOptionServiceRequired
taxRateRepository_Repository<TaxRate> & objectRequired
__configModule__Record<string, unknown>
__moduleDeclaration__Record<string, unknown>

Accessors

activeManager_

Returns

EntityManagerEntityManagerRequired

Methods

withTransaction

Parameters

transactionManagerEntityManager

Returns

thisthisRequired

shouldRetryTransaction_

Parameters

errRecord<string, unknown> | objectRequired

Returns

booleanbooleanRequired

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.

Type Parameters

TResultobjectRequired
TErrorobjectRequired

Parameters

work(transactionManager: EntityManager) => Promise<TResult>Required
the transactional work to be done
isolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>
the isolation level to be used for the work.
maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>
Potential error handler

Returns

PromisePromise<TResult>Required
the result of the transactional work

list

Parameters

selectorFilterableTaxRatePropsRequired
configFindConfig<TaxRate>Required

Default: {}

Returns

PromisePromise<TaxRate[]>Required

listAndCount

Parameters

selectorFilterableTaxRatePropsRequired
configFindConfig<TaxRate>Required

Default: {}

Returns

PromisePromise<[TaxRate[], number]>Required

retrieve

Parameters

taxRateIdstringRequired
configFindConfig<TaxRate>Required

Default: {}

Returns

PromisePromise<TaxRate>Required

create

Parameters

dataCreateTaxRateInputRequired

Returns

PromisePromise<TaxRate>Required

update

Parameters

idstringRequired
dataUpdateTaxRateInputRequired

Returns

PromisePromise<TaxRate>Required

delete

Parameters

idstring | string[]Required

Returns

PromisePromise<void>Required

removeFromProduct

Parameters

idstringRequired
productIdsstring | string[]Required

Returns

PromisePromise<void>Required

removeFromProductType

Parameters

idstringRequired
typeIdsstring | string[]Required

Returns

PromisePromise<void>Required

removeFromShippingOption

Parameters

idstringRequired
optionIdsstring | string[]Required

Returns

PromisePromise<void>Required

addToProduct

Parameters

idstringRequired
productIdsstring | string[]Required
replacebooleanRequired

Default: false

Returns

PromisePromise<ProductTaxRate | ProductTaxRate[]>Required

addToProductType

Parameters

idstringRequired
productTypeIdsstring | string[]Required
replacebooleanRequired

Default: false

Returns

PromisePromise<ProductTypeTaxRate[]>Required

addToShippingOption

Parameters

idstringRequired
optionIdsstring | string[]Required
replacebooleanRequired

Default: false

Returns

PromisePromise<ShippingTaxRate[]>Required

listByProduct

Parameters

productIdstringRequired
configTaxRateListByConfigRequired

Returns

PromisePromise<TaxRate[]>Required

listByShippingOption

Parameters

shippingOptionIdstringRequired

Returns

PromisePromise<TaxRate[]>Required
Was this section helpful?