namespace Application.Dto;
///
/// 预算响应
///
public record BudgetResponse
{
public long Id { get; init; }
public string Name { get; init; } = string.Empty;
public BudgetPeriodType Type { get; init; }
public decimal Limit { get; init; }
public decimal Current { get; init; }
public BudgetCategory Category { get; init; }
public string[] SelectedCategories { get; init; } = [];
public DateTime StartDate { get; init; }
public bool NoLimit { get; init; }
public bool IsMandatoryExpense { get; init; }
public decimal UsagePercentage { get; init; }
///
/// 存款明细数据(仅存款预算返回)
///
public SavingsDetailDto? Details { get; init; }
}
///
/// 存款明细数据 DTO
///
public record SavingsDetailDto
{
public List IncomeItems { get; init; } = new();
public List ExpenseItems { get; init; } = new();
public SavingsCalculationSummaryDto Summary { get; init; } = new();
}
///
/// 预算明细项 DTO
///
public record BudgetDetailItemDto
{
public long Id { get; init; }
public string Name { get; init; } = string.Empty;
public BudgetPeriodType Type { get; init; }
public decimal BudgetLimit { get; init; }
public decimal ActualAmount { get; init; }
public decimal EffectiveAmount { get; init; }
public string CalculationNote { get; init; } = string.Empty;
public bool IsOverBudget { get; init; }
public bool IsArchived { get; init; }
public int[]? ArchivedMonths { get; init; }
}
///
/// 存款计算汇总 DTO
///
public record SavingsCalculationSummaryDto
{
public decimal TotalIncomeBudget { get; init; }
public decimal TotalExpenseBudget { get; init; }
public decimal PlannedSavings { get; init; }
public string CalculationFormula { get; init; } = string.Empty;
}
///
/// 创建预算请求
///
public record CreateBudgetRequest
{
public string Name { get; init; } = string.Empty;
public BudgetPeriodType Type { get; init; } = BudgetPeriodType.Month;
public decimal Limit { get; init; }
public BudgetCategory Category { get; init; }
public string[] SelectedCategories { get; init; } = [];
public DateTime? StartDate { get; init; }
public bool NoLimit { get; init; }
public bool IsMandatoryExpense { get; init; }
}
///
/// 更新预算请求
///
public record UpdateBudgetRequest
{
public long Id { get; init; }
public string Name { get; init; } = string.Empty;
public BudgetPeriodType Type { get; init; } = BudgetPeriodType.Month;
public decimal Limit { get; init; }
public BudgetCategory Category { get; init; }
public string[] SelectedCategories { get; init; } = [];
public DateTime? StartDate { get; init; }
public bool NoLimit { get; init; }
public bool IsMandatoryExpense { get; init; }
}
///
/// 分类统计响应
///
public record BudgetCategoryStatsResponse
{
public BudgetStatsDetail Month { get; init; } = new();
public BudgetStatsDetail Year { get; init; } = new();
}
///
/// 统计详情
///
public record BudgetStatsDetail
{
public decimal Limit { get; init; }
public decimal Current { get; init; }
public decimal Remaining { get; init; }
public decimal UsagePercentage { get; init; }
public List Trend { get; init; } = [];
public string Description { get; init; } = string.Empty;
}
///
/// 未覆盖分类响应
///
public record UncoveredCategoryResponse
{
public string Category { get; init; } = string.Empty;
public decimal Amount { get; init; }
public int Count { get; init; }
}
///
/// 更新归档总结请求
///
public record UpdateArchiveSummaryRequest
{
public DateTime ReferenceDate { get; init; }
public string? Summary { get; init; }
}
///
/// 存款明细数据
///
public record SavingsDetail
{
public List IncomeItems { get; init; } = new();
public List ExpenseItems { get; init; } = new();
public SavingsCalculationSummary Summary { get; init; } = new();
}
///
/// 预算明细项
///
public record BudgetDetailItem
{
public long Id { get; init; }
public string Name { get; init; } = string.Empty;
public BudgetPeriodType Type { get; init; }
public decimal BudgetLimit { get; init; }
public decimal ActualAmount { get; init; }
public decimal EffectiveAmount { get; init; }
public string CalculationNote { get; init; } = string.Empty;
public bool IsOverBudget { get; init; }
public bool IsArchived { get; init; }
public int[]? ArchivedMonths { get; init; }
}
///
/// 存款计算汇总
///
public record SavingsCalculationSummary
{
public decimal TotalIncomeBudget { get; init; }
public decimal TotalExpenseBudget { get; init; }
public decimal PlannedSavings { get; init; }
public string CalculationFormula { get; init; } = string.Empty;
}