use serde::{Serialize, Deserialize};
use super::{
ForecastedMonthlyIncome, HistoricalAnnualIncome, IncomeSourcesCounts,
MonitoringIncomeSource, TotalMonthlyIncomeInsights,
};
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct MonitoringIncomeInsights {
pub forecasted_monthly_income: ForecastedMonthlyIncome,
pub historical_annual_income: HistoricalAnnualIncome,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub income_sources: Vec<MonitoringIncomeSource>,
pub income_sources_counts: IncomeSourcesCounts,
pub total_monthly_income: TotalMonthlyIncomeInsights,
}
impl std::fmt::Display for MonitoringIncomeInsights {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}