Skip to main content
Skip to main content

TaxRateService

internal.internal.TaxRateService

Properties

__configModule__Record<string, unknown>
__container__anyRequired
__moduleDeclaration__Record<string, unknown>
manager_EntityManagerRequired
productService_ProductServiceRequired
productTypeService_ProductTypeServiceRequired
shippingOptionService_ShippingOptionServiceRequired
taxRateRepository_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 }Required
transactionManager_undefined | EntityManagerRequired

Accessors

activeManager_

Protected get activeManager_(): EntityManager

Returns

EntityManager

EntityManagerEntityManagerRequired

Inherited from

TransactionBaseService.activeManager_

Methods

addToProduct

addToProduct(id, productIds, replace?): Promise<ProductTaxRate | ProductTaxRate[]>

Parameters

idstringRequired
productIdsstring | string[]Required
replaceboolean

Returns

Promise<ProductTaxRate | ProductTaxRate[]>

PromisePromise<ProductTaxRate | ProductTaxRate[]>Required

addToProductType

addToProductType(id, productTypeIds, replace?): Promise<ProductTypeTaxRate[]>

Parameters

idstringRequired
productTypeIdsstring | string[]Required
replaceboolean

Returns

Promise<ProductTypeTaxRate[]>

PromisePromise<ProductTypeTaxRate[]>Required

addToShippingOption

addToShippingOption(id, optionIds, replace?): Promise<ShippingTaxRate[]>

Parameters

idstringRequired
optionIdsstring | string[]Required
replaceboolean

Returns

Promise<ShippingTaxRate[]>

PromisePromise<ShippingTaxRate[]>Required

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.

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

Promise<TResult>

PromisePromise<TResult>Required
the result of the transactional work

Inherited from

TransactionBaseService.atomicPhase_


create

create(data): Promise<TaxRate>

Parameters

dataCreateTaxRateInputRequired

Returns

Promise<TaxRate>

PromisePromise<TaxRate>Required

delete

delete(id): Promise<void>

Parameters

idstring | string[]Required

Returns

Promise<void>

PromisePromise<void>Required

list

list(selector, config?): Promise<TaxRate[]>

Parameters

Returns

Promise<TaxRate[]>

PromisePromise<TaxRate[]>Required

listAndCount

listAndCount(selector, config?): Promise<[TaxRate[], number]>

Parameters

Returns

Promise<[TaxRate[], number]>

PromisePromise<[TaxRate[], number]>Required

listByProduct

listByProduct(productId, config): Promise<TaxRate[]>

Parameters

productIdstringRequired
configTaxRateListByConfigRequired

Returns

Promise<TaxRate[]>

PromisePromise<TaxRate[]>Required

listByShippingOption

listByShippingOption(shippingOptionId): Promise<TaxRate[]>

Parameters

shippingOptionIdstringRequired

Returns

Promise<TaxRate[]>

PromisePromise<TaxRate[]>Required

removeFromProduct

removeFromProduct(id, productIds): Promise<void>

Parameters

idstringRequired
productIdsstring | string[]Required

Returns

Promise<void>

PromisePromise<void>Required

removeFromProductType

removeFromProductType(id, typeIds): Promise<void>

Parameters

idstringRequired
typeIdsstring | string[]Required

Returns

Promise<void>

PromisePromise<void>Required

removeFromShippingOption

removeFromShippingOption(id, optionIds): Promise<void>

Parameters

idstringRequired
optionIdsstring | string[]Required

Returns

Promise<void>

PromisePromise<void>Required

retrieve

retrieve(taxRateId, config?): Promise<TaxRate>

Parameters

taxRateIdstringRequired

Returns

Promise<TaxRate>

PromisePromise<TaxRate>Required

shouldRetryTransaction_

Protected shouldRetryTransaction_(err): boolean

Parameters

errRecord<string, unknown> | { code: string }Required

Returns

boolean

booleanboolean

Inherited from

TransactionBaseService.shouldRetryTransaction_


update

update(id, data): Promise<TaxRate>

Parameters

idstringRequired
dataUpdateTaxRateInputRequired

Returns

Promise<TaxRate>

PromisePromise<TaxRate>Required

withTransaction

withTransaction(transactionManager?): TaxRateService

Parameters

transactionManagerEntityManager

Returns

TaxRateService

TaxRateServiceTaxRateServiceRequired

Inherited from

TransactionBaseService.withTransaction

Was this section helpful?