TaxRate
TaxRate
A TaxRate defines the rate of tax to apply to a ProductVariant based on three factors:
- the ProductVariant's TaxCategory
- the applicable Zone ("applicable" being defined by the configured TaxZoneStrategy)
- the CustomerGroup of the current Customer
Signature
class TaxRate extends VendureEntity implements HasCustomFields {
    constructor(input?: DeepPartial<TaxRate>)
    @Column() name: string;
    @Column() enabled: boolean;
    @Column({ type: 'decimal', precision: 5, scale: 2, transformer: new DecimalTransformer() }) value: number;
    @Index()
    @ManyToOne(type => TaxCategory, taxCategory => taxCategory.taxRates)
    category: TaxCategory;
    @EntityId({ nullable: true })
    categoryId: ID;
    @Index()
    @ManyToOne(type => Zone, zone => zone.taxRates)
    zone: Zone;
    @EntityId({ nullable: true })
    zoneId: ID;
    @Index()
    @ManyToOne(type => CustomerGroup, customerGroup => customerGroup.taxRates, { nullable: true })
    customerGroup?: CustomerGroup;
    @Column(type => CustomTaxRateFields)
    customFields: CustomTaxRateFields;
    taxComponentOf(grossPrice: number) => number;
    netPriceOf(grossPrice: number) => number;
    taxPayableOn(netPrice: number) => number;
    grossPriceOf(netPrice: number) => number;
    apply(price: number) => TaxLine;
    test(zone: Zone | ID, taxCategory: TaxCategory | ID) => boolean;
}
- 
Extends: VendureEntity
- 
Implements: HasCustomFields
constructor
method
(input?: DeepPartial<TaxRate>) => TaxRatename
property
stringenabled
property
booleanvalue
property
numbercategory
property
categoryId
property
zone
property
zoneId
property
customerGroup
property
customFields
property
CustomTaxRateFieldstaxComponentOf
method
(grossPrice: number) => numbernetPriceOf
method
(grossPrice: number) => numbertaxPayableOn
method
(netPrice: number) => numbergrossPriceOf
method
(netPrice: number) => numberapply
method
(price: number) => TaxLinetest
method
(zone: Zone | ID, taxCategory: TaxCategory | ID) => boolean