107 lines
2.7 KiB
C#
107 lines
2.7 KiB
C#
|
|
namespace Application.Dto.Transaction;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 交易响应
|
||
|
|
/// </summary>
|
||
|
|
public record TransactionResponse
|
||
|
|
{
|
||
|
|
public long Id { get; init; }
|
||
|
|
public DateTime OccurredAt { get; init; }
|
||
|
|
public string Reason { get; init; } = string.Empty;
|
||
|
|
public decimal Amount { get; init; }
|
||
|
|
public decimal Balance { get; init; }
|
||
|
|
public TransactionType Type { get; init; }
|
||
|
|
public string Classify { get; init; } = string.Empty;
|
||
|
|
public string? UnconfirmedClassify { get; init; }
|
||
|
|
public TransactionType? UnconfirmedType { get; init; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 创建交易请求
|
||
|
|
/// </summary>
|
||
|
|
public record CreateTransactionRequest
|
||
|
|
{
|
||
|
|
public string OccurredAt { get; init; } = string.Empty;
|
||
|
|
public string? Reason { get; init; }
|
||
|
|
public decimal Amount { get; init; }
|
||
|
|
public TransactionType Type { get; init; }
|
||
|
|
public string? Classify { get; init; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 更新交易请求
|
||
|
|
/// </summary>
|
||
|
|
public record UpdateTransactionRequest
|
||
|
|
{
|
||
|
|
public long Id { get; init; }
|
||
|
|
public string? Reason { get; init; }
|
||
|
|
public decimal Amount { get; init; }
|
||
|
|
public decimal Balance { get; init; }
|
||
|
|
public TransactionType Type { get; init; }
|
||
|
|
public string? Classify { get; init; }
|
||
|
|
public string? OccurredAt { get; init; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 交易查询请求
|
||
|
|
/// </summary>
|
||
|
|
public record TransactionQueryRequest
|
||
|
|
{
|
||
|
|
public int PageIndex { get; init; } = 1;
|
||
|
|
public int PageSize { get; init; } = 20;
|
||
|
|
public string? SearchKeyword { get; init; }
|
||
|
|
public string? Classify { get; init; }
|
||
|
|
public int? Type { get; init; }
|
||
|
|
public int? Year { get; init; }
|
||
|
|
public int? Month { get; init; }
|
||
|
|
public DateTime? StartDate { get; init; }
|
||
|
|
public DateTime? EndDate { get; init; }
|
||
|
|
public string? Reason { get; init; }
|
||
|
|
public bool SortByAmount { get; init; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 分页结果
|
||
|
|
/// </summary>
|
||
|
|
public record PagedResult<T>
|
||
|
|
{
|
||
|
|
public T[] Data { get; init; } = [];
|
||
|
|
public int Total { get; init; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 批量更新分类项
|
||
|
|
/// </summary>
|
||
|
|
public record BatchUpdateClassifyItem
|
||
|
|
{
|
||
|
|
public long Id { get; init; }
|
||
|
|
public string? Classify { get; init; }
|
||
|
|
public TransactionType? Type { get; init; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 按摘要批量更新请求
|
||
|
|
/// </summary>
|
||
|
|
public record BatchUpdateByReasonRequest
|
||
|
|
{
|
||
|
|
public string Reason { get; init; } = string.Empty;
|
||
|
|
public TransactionType Type { get; init; }
|
||
|
|
public string Classify { get; init; } = string.Empty;
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 一句话录账解析请求
|
||
|
|
/// </summary>
|
||
|
|
public record ParseOneLineRequest
|
||
|
|
{
|
||
|
|
public string Text { get; init; } = string.Empty;
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 确认所有未确认记录请求
|
||
|
|
/// </summary>
|
||
|
|
public record ConfirmAllUnconfirmedRequest
|
||
|
|
{
|
||
|
|
public long[] Ids { get; init; } = [];
|
||
|
|
}
|