DVTaxTable class

An application's own rate table: the offline fallback, and the reference implementation of the rounding rules.

Its rates are the application's, not Dartvel's -- the framework ships no table. Everything a calculation depends on is declared in the file and nothing is defaulted: the date the rates were true, the rounding mode and scope, and per jurisdiction whether a discount reduces the taxable amount.

{
  "asOf": "2026-09-01",
  "rounding": {"mode": "halfUp", "scope": "document"},
  "jurisdictions": {
    "GB": {"discountBasis": "afterDiscount",
           "rates": {"digitalService": "20"}}
  }
}

A rate is a decimal string. A JSON number is refused, because the parser makes a double of 8.875 before this code sees it.

Constructors

DVTaxTable({required DateTime asOf, required DVTaxRoundingMode roundingMode, required DVTaxRoundingScope roundingScope, required Map<String, DVTaxJurisdiction> jurisdictions})
DVTaxTable.fromJson(String json)
Reads a table file.
factory

Properties

asOf → DateTime
When the rates were true, in UTC.
final
hashCode → int
The hash code for this object.
no setterinherited
jurisdictions → Map<String, DVTaxJurisdiction>
final
roundingMode → DVTaxRoundingMode
final
roundingScope → DVTaxRoundingScope
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
price(DVTaxRequest request, {required DVTaxSource source, required DateTime at}) → DVTaxQuote
Prices request from this table.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited