1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// ============ E-Commerce stats for a campaign. ==============
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ECommerceReportType {
    /// The total orders for a campaign.
    #[serde(default)]
    pub total_orders: u64,
    /// The total spent for a campaign. Calculated as the sum of
    /// all order totals with no deductions.
    #[serde(default)]
    pub total_spent: f32,
    /// The total revenue for a campaign. Calculated as the sum of
    /// all order totals minus shipping and tax totals.
    #[serde(default)]
    pub total_revenue: f32,
    /// No Description
    #[serde(default)]
    pub currency_code: String,
}

impl Default for ECommerceReportType {
    fn default() -> Self {
        Self {
            total_orders: 0,
            total_spent: 0.0,
            total_revenue: 0.0,
            currency_code: String::new(),
        }
    }
}