style: 命令不可变化与规范补充

This commit is contained in:
2025-12-02 12:09:46 +08:00
parent 3e01943727
commit 541b75ecd8
13 changed files with 217 additions and 186 deletions

View File

@@ -7,55 +7,55 @@ namespace TakeoutSaaS.Application.App.Payments.Commands;
/// <summary>
/// 更新支付记录命令。
/// </summary>
public sealed class UpdatePaymentCommand : IRequest<PaymentDto?>
public sealed record UpdatePaymentCommand : IRequest<PaymentDto?>
{
/// <summary>
/// 支付记录 ID。
/// </summary>
public long PaymentId { get; set; }
public long PaymentId { get; init; }
/// <summary>
/// 订单 ID。
/// </summary>
public long OrderId { get; set; }
public long OrderId { get; init; }
/// <summary>
/// 支付方式。
/// </summary>
public PaymentMethod Method { get; set; } = PaymentMethod.Unknown;
public PaymentMethod Method { get; init; } = PaymentMethod.Unknown;
/// <summary>
/// 支付状态。
/// </summary>
public PaymentStatus Status { get; set; } = PaymentStatus.Unpaid;
public PaymentStatus Status { get; init; } = PaymentStatus.Unpaid;
/// <summary>
/// 金额。
/// </summary>
public decimal Amount { get; set; }
public decimal Amount { get; init; }
/// <summary>
/// 平台交易号。
/// </summary>
public string? TradeNo { get; set; }
public string? TradeNo { get; init; }
/// <summary>
/// 渠道单号。
/// </summary>
public string? ChannelTransactionId { get; set; }
public string? ChannelTransactionId { get; init; }
/// <summary>
/// 支付时间。
/// </summary>
public DateTime? PaidAt { get; set; }
public DateTime? PaidAt { get; init; }
/// <summary>
/// 备注。
/// </summary>
public string? Remark { get; set; }
public string? Remark { get; init; }
/// <summary>
/// 原始回调。
/// </summary>
public string? Payload { get; set; }
public string? Payload { get; init; }
}