use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BudgetDetail {
#[serde(rename = "id")]
pub id: uuid::Uuid,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "last_modified_on", skip_serializing_if = "Option::is_none")]
pub last_modified_on: Option<String>,
#[serde(rename = "first_month", skip_serializing_if = "Option::is_none")]
pub first_month: Option<String>,
#[serde(rename = "last_month", skip_serializing_if = "Option::is_none")]
pub last_month: Option<String>,
#[serde(rename = "date_format", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub date_format: Option<Option<Box<models::DateFormat>>>,
#[serde(rename = "currency_format", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub currency_format: Option<Option<Box<models::CurrencyFormat>>>,
#[serde(rename = "accounts", skip_serializing_if = "Option::is_none")]
pub accounts: Option<Vec<models::Account>>,
#[serde(rename = "payees", skip_serializing_if = "Option::is_none")]
pub payees: Option<Vec<models::Payee>>,
#[serde(rename = "payee_locations", skip_serializing_if = "Option::is_none")]
pub payee_locations: Option<Vec<models::PayeeLocation>>,
#[serde(rename = "category_groups", skip_serializing_if = "Option::is_none")]
pub category_groups: Option<Vec<models::CategoryGroup>>,
#[serde(rename = "categories", skip_serializing_if = "Option::is_none")]
pub categories: Option<Vec<models::Category>>,
#[serde(rename = "months", skip_serializing_if = "Option::is_none")]
pub months: Option<Vec<models::MonthDetail>>,
#[serde(rename = "transactions", skip_serializing_if = "Option::is_none")]
pub transactions: Option<Vec<models::TransactionSummary>>,
#[serde(rename = "subtransactions", skip_serializing_if = "Option::is_none")]
pub subtransactions: Option<Vec<models::SubTransaction>>,
#[serde(rename = "scheduled_transactions", skip_serializing_if = "Option::is_none")]
pub scheduled_transactions: Option<Vec<models::ScheduledTransactionSummary>>,
#[serde(rename = "scheduled_subtransactions", skip_serializing_if = "Option::is_none")]
pub scheduled_subtransactions: Option<Vec<models::ScheduledSubTransaction>>,
}
impl BudgetDetail {
pub fn new(id: uuid::Uuid, name: String) -> BudgetDetail {
BudgetDetail {
id,
name,
last_modified_on: None,
first_month: None,
last_month: None,
date_format: None,
currency_format: None,
accounts: None,
payees: None,
payee_locations: None,
category_groups: None,
categories: None,
months: None,
transactions: None,
subtransactions: None,
scheduled_transactions: None,
scheduled_subtransactions: None,
}
}
}