plaid/model/
user_data_overview.rs

1use serde::{Serialize, Deserialize};
2///metadata for the set of insights provided in `TransactionsUserInsightsGetResponse`
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct UserDataOverview {
5    ///The range of days of transactions available.
6    pub days_available: i64,
7    ///The date of the newest transaction processed to generate insights.
8    #[serde(default, skip_serializing_if = "Option::is_none")]
9    pub newest_transaction_date: Option<chrono::NaiveDate>,
10    ///The date of the oldest transaction processed to generate insights.
11    #[serde(default, skip_serializing_if = "Option::is_none")]
12    pub oldest_transaction_date: Option<chrono::NaiveDate>,
13    ///Sum of inflow amounts.
14    pub total_inflows: f64,
15    ///Sum of outflow amounts.
16    pub total_outflows: f64,
17    ///The total number of transactions.
18    pub transaction_count: i64,
19}
20impl std::fmt::Display for UserDataOverview {
21    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
22        write!(f, "{}", serde_json::to_string(self).unwrap())
23    }
24}