Skip to main content
Skip to main content

TaxRateService

Constructors

constructor

**new TaxRateService**(«destructured»)

Parameters

__namedParametersObjectRequired

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

Methods

addToProduct

**addToProduct**(id, productIds, replace?): Promise&#60;[ProductTaxRate](/references/services/classes/ProductTaxRate) \| [ProductTaxRate](/references/services/classes/ProductTaxRate)[]&#62;

Parameters

idstringRequired
productIdsstring | string[]Required
replacebooleanRequired

Default: false

Returns

Promise<ProductTaxRate | ProductTaxRate[]>

PromisePromise<ProductTaxRate | ProductTaxRate[]>Required

addToProductType

**addToProductType**(id, productTypeIds, replace?): Promise&#60;[ProductTypeTaxRate](/references/services/classes/ProductTypeTaxRate)[]&#62;

Parameters

idstringRequired
productTypeIdsstring | string[]Required
replacebooleanRequired

Default: false

Returns

Promise<ProductTypeTaxRate[]>

PromisePromise<ProductTypeTaxRate[]>Required

addToShippingOption

**addToShippingOption**(id, optionIds, replace?): Promise&#60;[ShippingTaxRate](/references/services/classes/ShippingTaxRate)[]&#62;

Parameters

idstringRequired
optionIdsstring | string[]Required
replacebooleanRequired

Default: false

Returns

Promise<ShippingTaxRate[]>

PromisePromise<ShippingTaxRate[]>Required

atomicPhase_

Protected **atomicPhase_**<TypeParameter TResult, TypeParameter TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise&#60;TResult&#62;

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

create

**create**(data): Promise&#60;[TaxRate](/references/services/classes/TaxRate)&#62;

Parameters

dataCreateTaxRateInputRequired

Returns

Promise<TaxRate>

PromisePromise<TaxRate>Required

delete

**delete**(id): Promise&#60;void&#62;

Parameters

idstring | string[]Required

Returns

Promise<void>

PromisePromise<void>Required

list

**list**(selector, config?): Promise&#60;[TaxRate](/references/services/classes/TaxRate)[]&#62;

Parameters

selectorFilterableTaxRatePropsRequired
configFindConfig<TaxRate>Required

Default: {}

Returns

Promise<TaxRate[]>

PromisePromise<TaxRate[]>Required

listAndCount

**listAndCount**(selector, config?): Promise&#60;[[TaxRate](/references/services/classes/TaxRate)[], number]&#62;

Parameters

selectorFilterableTaxRatePropsRequired
configFindConfig<TaxRate>Required

Default: {}

Returns

Promise<[TaxRate[], number]>

PromisePromise<[TaxRate[], number]>Required

listByProduct

**listByProduct**(productId, config): Promise&#60;[TaxRate](/references/services/classes/TaxRate)[]&#62;

Parameters

productIdstringRequired
configTaxRateListByConfigRequired

Returns

Promise<TaxRate[]>

PromisePromise<TaxRate[]>Required

listByShippingOption

**listByShippingOption**(shippingOptionId): Promise&#60;[TaxRate](/references/services/classes/TaxRate)[]&#62;

Parameters

shippingOptionIdstringRequired

Returns

Promise<TaxRate[]>

PromisePromise<TaxRate[]>Required

removeFromProduct

**removeFromProduct**(id, productIds): Promise&#60;void&#62;

Parameters

idstringRequired
productIdsstring | string[]Required

Returns

Promise<void>

PromisePromise<void>Required

removeFromProductType

**removeFromProductType**(id, typeIds): Promise&#60;void&#62;

Parameters

idstringRequired
typeIdsstring | string[]Required

Returns

Promise<void>

PromisePromise<void>Required

removeFromShippingOption

**removeFromShippingOption**(id, optionIds): Promise&#60;void&#62;

Parameters

idstringRequired
optionIdsstring | string[]Required

Returns

Promise<void>

PromisePromise<void>Required

retrieve

**retrieve**(taxRateId, config?): Promise&#60;[TaxRate](/references/services/classes/TaxRate)&#62;

Parameters

taxRateIdstringRequired
configFindConfig<TaxRate>Required

Default: {}

Returns

Promise<TaxRate>

PromisePromise<TaxRate>Required

shouldRetryTransaction_

Protected **shouldRetryTransaction_**(err): boolean

Parameters

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

Returns

boolean

booleanboolean

update

**update**(id, data): Promise&#60;[TaxRate](/references/services/classes/TaxRate)&#62;

Parameters

idstringRequired
dataUpdateTaxRateInputRequired

Returns

Promise<TaxRate>

PromisePromise<TaxRate>Required

withTransaction

**withTransaction**(transactionManager?): [TaxRateService](/references/services/classes/TaxRateService)

Parameters

transactionManagerEntityManager

Returns

TaxRateService

TaxRateServiceTaxRateServiceRequired
Was this section helpful?