use serde::Deserialize;

#[derive(Debug, Clone, Deserialize)]
pub struct TransactionList {
    pub transactions: Vec<Transaction>,
    pub total: u64,
}

#[derive(Debug, Clone, Deserialize)]
pub struct Transaction {
    /// `None` for pending transactions
    pub id: Option<String>,
    #[serde(rename = "accountId")]
    pub account_id: u64,
    pub amount: f64,
    pub currency: String,
    /// Date string in `YYYY-MM-DD` format
    pub date: String,
    pub merchant: Option<String>,
    pub description: Option<String>,
    #[serde(rename = "isPending")]
    pub is_pending: bool,
}
