pub struct TaxSettings {Show 16 fields
pub id: Uuid,
pub enabled: bool,
pub calculation_method: TaxCalculationMethod,
pub compound_method: TaxCompoundMethod,
pub tax_shipping: bool,
pub tax_handling: bool,
pub tax_gift_wrap: bool,
pub origin_address: Option<TaxAddress>,
pub default_product_category: ProductTaxCategory,
pub rounding_mode: String,
pub decimal_places: i32,
pub validate_addresses: bool,
pub tax_provider: Option<String>,
pub provider_credentials: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Store-level tax configuration
Fields§
§id: Uuid§enabled: boolWhether tax calculation is enabled
calculation_method: TaxCalculationMethodDefault calculation method
compound_method: TaxCompoundMethodDefault compound method
tax_shipping: boolWhether to tax shipping
tax_handling: boolWhether to tax handling fees
tax_gift_wrap: boolWhether to tax gift wrapping
origin_address: Option<TaxAddress>Origin address for origin-based tax states
default_product_category: ProductTaxCategoryDefault product tax category
rounding_mode: StringRounding mode applied to computed tax amounts. One of half_up
(default), half_even/bankers, half_down, up, down/truncate,
ceil, or floor. See Self::rounding_strategy.
decimal_places: i32Decimal places for tax amounts
validate_addresses: boolWhether to validate addresses
tax_provider: Option<String>External tax service provider (avalara, taxjar, vertex, none)
provider_credentials: Option<String>Provider API credentials (encrypted)
created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl TaxSettings
impl TaxSettings
Sourcepub fn rounding_strategy(&self) -> RoundingStrategy
pub fn rounding_strategy(&self) -> RoundingStrategy
Resolve the configured rounding_mode string to a
concrete RoundingStrategy for rounding computed tax amounts.
Recognized modes (case- and surrounding-whitespace-insensitive):
half_up (round half away from zero — the default and conventional
retail tax rounding), half_even/bankers (round half to even),
half_down, up, down/truncate, ceil, and floor. Any
unrecognized or empty value falls back to half_up.
Trait Implementations§
Source§impl Clone for TaxSettings
impl Clone for TaxSettings
Source§fn clone(&self) -> TaxSettings
fn clone(&self) -> TaxSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more