Skip to main content

TaxRateService

TaxRateService

Contains methods relating to TaxRate entities.

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

constructor

method
(connection: TransactionalConnection, eventBus: EventBus, listQueryBuilder: ListQueryBuilder, configService: ConfigService, customFieldRelationService: CustomFieldRelationService) => TaxRateService

findAll

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

findOne

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

create

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

update

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

delete

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

getApplicableTaxRate

method
(ctx: RequestContext, zone: Zone, taxCategory: TaxCategory) => Promise<TaxRate>

Returns the applicable TaxRate based on the specified Zone and TaxCategory. Used when calculating Order prices.