refactor: extract Models and Data into MoneyMap.Core shared library
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
namespace MoneyMap.Models.Dashboard
|
||||
{
|
||||
/// <summary>
|
||||
/// Statistics displayed on the dashboard.
|
||||
/// </summary>
|
||||
public record DashboardStats(
|
||||
int TotalTransactions = 0,
|
||||
int Credits = 0,
|
||||
int Debits = 0,
|
||||
int Uncategorized = 0,
|
||||
int Receipts = 0,
|
||||
int Cards = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Row representing spending in a category.
|
||||
/// </summary>
|
||||
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; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Row representing a recent transaction.
|
||||
/// </summary>
|
||||
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; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Spending trends over time.
|
||||
/// </summary>
|
||||
public class SpendTrends
|
||||
{
|
||||
public List<string> Labels { get; set; } = new();
|
||||
public List<decimal> DebitsAbs { get; set; } = new();
|
||||
public List<decimal> Credits { get; set; } = new();
|
||||
public List<decimal> Net { get; set; } = new();
|
||||
public List<decimal> RunningBalance { get; set; } = new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Complete dashboard data package.
|
||||
/// </summary>
|
||||
public class DashboardData
|
||||
{
|
||||
public required DashboardStats Stats { get; init; }
|
||||
public required List<TopCategoryRow> TopCategories { get; init; }
|
||||
public required List<RecentTransactionRow> RecentTransactions { get; init; }
|
||||
public required SpendTrends Trends { get; init; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user