TaxRateService

TaxRateService

Contains methods relating to TaxRate entities.

Signature

class TaxRateService {
  constructor(connection: TransactionalConnection, eventBus: EventBus, listQueryBuilder: ListQueryBuilder, cacheService: RequestContextCacheService)
  findAll(ctx: RequestContext, options?: ListQueryOptions<TaxRate>) => Promise<PaginatedList<TaxRate>>;
  findOne(ctx: RequestContext, taxRateId: ID) => Promise<TaxRate | undefined>;
  async create(ctx: RequestContext, input: CreateTaxRateInput) => Promise<TaxRate>;
  async update(ctx: RequestContext, input: UpdateTaxRateInput) => Promise<TaxRate>;
  async delete(ctx: RequestContext, id: ID) => Promise<DeletionResponse>;
  async getApplicableTaxRate(ctx: RequestContext, zone: Zone, taxCategory: TaxCategory) => Promise<TaxRate>;
}

Members

constructor

method
type:
(connection: TransactionalConnection, eventBus: EventBus, listQueryBuilder: ListQueryBuilder, cacheService: RequestContextCacheService) => TaxRateService

findAll

method
type:
(ctx: RequestContext, options?: ListQueryOptions<TaxRate>) => Promise<PaginatedList<TaxRate>>

findOne

method
type:
(ctx: RequestContext, taxRateId: ID) => Promise<TaxRate | undefined>

create

async method
type:
(ctx: RequestContext, input: CreateTaxRateInput) => Promise<TaxRate>

update

async method
type:
(ctx: RequestContext, input: UpdateTaxRateInput) => Promise<TaxRate>

delete

async method
type:
(ctx: RequestContext, id: ID) => Promise<DeletionResponse>

getApplicableTaxRate

async method
type:
(ctx: RequestContext, zone: Zone, taxCategory: TaxCategory) => Promise<TaxRate>
Returns the applicable TaxRate based on the specified Zone and TaxCategory. Used when calculating Order prices.