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,65 +7,65 @@ namespace TakeoutSaaS.Application.App.Deliveries.Commands;
/// <summary>
/// 更新配送单命令。
/// </summary>
public sealed class UpdateDeliveryOrderCommand : IRequest<DeliveryOrderDto?>
public sealed record UpdateDeliveryOrderCommand : IRequest<DeliveryOrderDto?>
{
/// <summary>
/// 配送单 ID。
/// </summary>
public long DeliveryOrderId { get; set; }
public long DeliveryOrderId { get; init; }
/// <summary>
/// 订单 ID。
/// </summary>
public long OrderId { get; set; }
public long OrderId { get; init; }
/// <summary>
/// 服务商。
/// </summary>
public DeliveryProvider Provider { get; set; } = DeliveryProvider.InHouse;
public DeliveryProvider Provider { get; init; } = DeliveryProvider.InHouse;
/// <summary>
/// 第三方单号。
/// </summary>
public string? ProviderOrderId { get; set; }
public string? ProviderOrderId { get; init; }
/// <summary>
/// 状态。
/// </summary>
public DeliveryStatus Status { get; set; } = DeliveryStatus.Pending;
public DeliveryStatus Status { get; init; } = DeliveryStatus.Pending;
/// <summary>
/// 配送费。
/// </summary>
public decimal? DeliveryFee { get; set; }
public decimal? DeliveryFee { get; init; }
/// <summary>
/// 骑手姓名。
/// </summary>
public string? CourierName { get; set; }
public string? CourierName { get; init; }
/// <summary>
/// 骑手电话。
/// </summary>
public string? CourierPhone { get; set; }
public string? CourierPhone { get; init; }
/// <summary>
/// 下发时间。
/// </summary>
public DateTime? DispatchedAt { get; set; }
public DateTime? DispatchedAt { get; init; }
/// <summary>
/// 取餐时间。
/// </summary>
public DateTime? PickedUpAt { get; set; }
public DateTime? PickedUpAt { get; init; }
/// <summary>
/// 完成时间。
/// </summary>
public DateTime? DeliveredAt { get; set; }
public DateTime? DeliveredAt { get; init; }
/// <summary>
/// 异常原因。
/// </summary>
public string? FailureReason { get; set; }
public string? FailureReason { get; init; }
}