Skip to main content

quickbooks_types/models/
tax_rate.rs

1use chrono::NaiveDateTime;
2use serde::{Deserialize, Serialize};
3use serde_with::skip_serializing_none;
4
5use crate::common::{MetaData, NtRef};
6
7#[skip_serializing_none]
8#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, Default)]
9#[serde(rename_all = "PascalCase", default)]
10#[cfg_attr(
11    feature = "builder",
12    derive(Builder),
13    builder(default, build_fn(error = "QBTypeError"), setter(into, strip_option))
14)]
15pub struct TaxRate {
16    /// The unique ID of the entity
17    pub id: Option<String>,
18    /// The unique sync token of the entity, used for concurrency control
19    pub sync_token: Option<String>,
20    /// Name of the tax rate
21    pub name: Option<String>,
22    /// Rate percentage of the tax rate
23    pub rate_value: Option<f64>,
24    /// Indicates if the tax rate is active
25    pub active: Option<bool>,
26    /// Description of the tax rate
27    pub description: Option<String>,
28    /// Reference to the tax agency associated with the tax rate
29    pub agency_ref: Option<NtRef>,
30    /// Metadata about the entity
31    pub meta_data: Option<MetaData>,
32    /// TaxRate DisplayType enum which acts as display config.
33    pub display_type: Option<String>,
34    /// Reference to the tax return line associated with the tax rate
35    pub tax_return_line_ref: Option<NtRef>,
36    /// Effective tax rate details
37    pub effective_tax_rate: Option<EffectiveTaxRate>,
38    /// Special tax type information
39    pub special_tax_type: Option<String>,
40}
41
42#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
43#[serde(rename_all = "PascalCase")]
44pub struct EffectiveTaxRate {
45    pub rate_value: f64,
46    pub end_date: NaiveDateTime,
47    pub effective_date: NaiveDateTime,
48}