namespace MoneyMap.Models.Dashboard { /// /// Statistics displayed on the dashboard. /// public record DashboardStats( int TotalTransactions = 0, int Credits = 0, int Debits = 0, int Uncategorized = 0, int Receipts = 0, int Cards = 0); /// /// Row representing spending in a category. /// public class TopCategoryRow { public string Category { get; set; } = ""; public decimal TotalSpend { get; set; } public int Count { get; set; } public decimal PercentageOfTotal { get; set; } public decimal AveragePerTransaction { get; set; } } /// /// Row representing a recent transaction. /// public class RecentTransactionRow { public long Id { get; set; } public DateTime Date { get; set; } public string Name { get; set; } = ""; public string Memo { get; set; } = ""; public decimal Amount { get; set; } public string Category { get; set; } = ""; public string CardLabel { get; set; } = ""; public int ReceiptCount { get; set; } } /// /// Spending trends over time. /// public class SpendTrends { public List Labels { get; set; } = new(); public List DebitsAbs { get; set; } = new(); public List Credits { get; set; } = new(); public List Net { get; set; } = new(); public List RunningBalance { get; set; } = new(); } /// /// Complete dashboard data package. /// public class DashboardData { public required DashboardStats Stats { get; init; } public required List TopCategories { get; init; } public required List RecentTransactions { get; init; } public required SpendTrends Trends { get; init; } } }