2026-02-10 17:49:19 +08:00
|
|
|
namespace Application.Dto;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 预算响应
|
|
|
|
|
/// </summary>
|
|
|
|
|
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; }
|
2026-02-20 22:07:09 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 存款明细数据(仅存款预算返回)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public SavingsDetailDto? Details { get; init; }
|
2026-02-10 17:49:19 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-20 22:07:09 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 存款明细数据 DTO
|
|
|
|
|
/// </summary>
|
|
|
|
|
public record SavingsDetailDto
|
|
|
|
|
{
|
|
|
|
|
public List<BudgetDetailItemDto> IncomeItems { get; init; } = new();
|
|
|
|
|
public List<BudgetDetailItemDto> ExpenseItems { get; init; } = new();
|
|
|
|
|
public SavingsCalculationSummaryDto Summary { get; init; } = new();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 预算明细项 DTO
|
|
|
|
|
/// </summary>
|
|
|
|
|
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; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 存款计算汇总 DTO
|
|
|
|
|
/// </summary>
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2026-02-10 17:49:19 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 创建预算请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
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; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 更新预算请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
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; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 分类统计响应
|
|
|
|
|
/// </summary>
|
|
|
|
|
public record BudgetCategoryStatsResponse
|
|
|
|
|
{
|
|
|
|
|
public BudgetStatsDetail Month { get; init; } = new();
|
|
|
|
|
public BudgetStatsDetail Year { get; init; } = new();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 统计详情
|
|
|
|
|
/// </summary>
|
|
|
|
|
public record BudgetStatsDetail
|
|
|
|
|
{
|
|
|
|
|
public decimal Limit { get; init; }
|
|
|
|
|
public decimal Current { get; init; }
|
|
|
|
|
public decimal Remaining { get; init; }
|
|
|
|
|
public decimal UsagePercentage { get; init; }
|
2026-02-15 10:10:28 +08:00
|
|
|
public List<decimal?> Trend { get; init; } = [];
|
|
|
|
|
public string Description { get; init; } = string.Empty;
|
2026-02-10 17:49:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 未覆盖分类响应
|
|
|
|
|
/// </summary>
|
|
|
|
|
public record UncoveredCategoryResponse
|
|
|
|
|
{
|
|
|
|
|
public string Category { get; init; } = string.Empty;
|
|
|
|
|
public decimal Amount { get; init; }
|
|
|
|
|
public int Count { get; init; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 更新归档总结请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
public record UpdateArchiveSummaryRequest
|
|
|
|
|
{
|
|
|
|
|
public DateTime ReferenceDate { get; init; }
|
|
|
|
|
public string? Summary { get; init; }
|
|
|
|
|
}
|
2026-02-20 16:26:04 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 存款明细数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
public record SavingsDetail
|
|
|
|
|
{
|
|
|
|
|
public List<BudgetDetailItem> IncomeItems { get; init; } = new();
|
|
|
|
|
public List<BudgetDetailItem> ExpenseItems { get; init; } = new();
|
|
|
|
|
public SavingsCalculationSummary Summary { get; init; } = new();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 预算明细项
|
|
|
|
|
/// </summary>
|
|
|
|
|
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; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 存款计算汇总
|
|
|
|
|
/// </summary>
|
|
|
|
|
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;
|
|
|
|
|
}
|