3deca29f05
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
138 lines
4.4 KiB
C#
138 lines
4.4 KiB
C#
namespace MoneyMap.Models.Api;
|
|
|
|
/// <summary>
|
|
/// Complete financial audit response for AI analysis.
|
|
/// </summary>
|
|
public class FinancialAuditResponse
|
|
{
|
|
public DateTime GeneratedAt { get; set; }
|
|
public DateTime PeriodStart { get; set; }
|
|
public DateTime PeriodEnd { get; set; }
|
|
|
|
public AuditSummary Summary { get; set; } = new();
|
|
public List<BudgetStatusDto> Budgets { get; set; } = new();
|
|
public List<CategorySpendingDto> SpendingByCategory { get; set; } = new();
|
|
public List<MerchantSpendingDto> TopMerchants { get; set; } = new();
|
|
public List<MonthlyTrendDto> MonthlyTrends { get; set; } = new();
|
|
public List<AccountSummaryDto> Accounts { get; set; } = new();
|
|
public List<AuditFlagDto> Flags { get; set; } = new();
|
|
public List<TransactionDto>? Transactions { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// High-level financial statistics for the audit period.
|
|
/// </summary>
|
|
public class AuditSummary
|
|
{
|
|
public int TotalTransactions { get; set; }
|
|
public decimal TotalIncome { get; set; }
|
|
public decimal TotalExpenses { get; set; }
|
|
public decimal NetCashFlow { get; set; }
|
|
public decimal AverageDailySpend { get; set; }
|
|
public int DaysInPeriod { get; set; }
|
|
public int UncategorizedTransactions { get; set; }
|
|
public decimal UncategorizedAmount { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Budget status with period information.
|
|
/// </summary>
|
|
public class BudgetStatusDto
|
|
{
|
|
public int BudgetId { get; set; }
|
|
public string Category { get; set; } = "";
|
|
public string Period { get; set; } = "";
|
|
public decimal Limit { get; set; }
|
|
public decimal Spent { get; set; }
|
|
public decimal Remaining { get; set; }
|
|
public decimal PercentUsed { get; set; }
|
|
public bool IsOverBudget { get; set; }
|
|
public string PeriodRange { get; set; } = "";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Spending breakdown by category with optional budget correlation.
|
|
/// </summary>
|
|
public class CategorySpendingDto
|
|
{
|
|
public string Category { get; set; } = "";
|
|
public decimal TotalSpent { get; set; }
|
|
public int TransactionCount { get; set; }
|
|
public decimal PercentOfTotal { get; set; }
|
|
public decimal AverageTransaction { get; set; }
|
|
public decimal? BudgetLimit { get; set; }
|
|
public decimal? BudgetRemaining { get; set; }
|
|
public bool? IsOverBudget { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Spending patterns by merchant.
|
|
/// </summary>
|
|
public class MerchantSpendingDto
|
|
{
|
|
public string MerchantName { get; set; } = "";
|
|
public string? Category { get; set; }
|
|
public decimal TotalSpent { get; set; }
|
|
public int TransactionCount { get; set; }
|
|
public decimal AverageTransaction { get; set; }
|
|
public DateTime FirstTransaction { get; set; }
|
|
public DateTime LastTransaction { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Monthly income/expense/net trends.
|
|
/// </summary>
|
|
public class MonthlyTrendDto
|
|
{
|
|
public string Month { get; set; } = "";
|
|
public int Year { get; set; }
|
|
public decimal Income { get; set; }
|
|
public decimal Expenses { get; set; }
|
|
public decimal NetCashFlow { get; set; }
|
|
public int TransactionCount { get; set; }
|
|
public Dictionary<string, decimal> TopCategories { get; set; } = new();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Per-account transaction summary.
|
|
/// </summary>
|
|
public class AccountSummaryDto
|
|
{
|
|
public int AccountId { get; set; }
|
|
public string AccountName { get; set; } = "";
|
|
public string Institution { get; set; } = "";
|
|
public string AccountType { get; set; } = "";
|
|
public int TransactionCount { get; set; }
|
|
public decimal TotalDebits { get; set; }
|
|
public decimal TotalCredits { get; set; }
|
|
public decimal NetFlow { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// AI-friendly flag highlighting potential issues or observations.
|
|
/// </summary>
|
|
public class AuditFlagDto
|
|
{
|
|
public string Type { get; set; } = "";
|
|
public string Severity { get; set; } = "";
|
|
public string Message { get; set; } = "";
|
|
public object? Details { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Simplified transaction for export.
|
|
/// </summary>
|
|
public class TransactionDto
|
|
{
|
|
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? MerchantName { get; set; }
|
|
public string AccountName { get; set; } = "";
|
|
public string? CardLabel { get; set; }
|
|
public bool IsTransfer { get; set; }
|
|
}
|