using MediatR;
using TakeoutSaaS.Application.App.Deliveries.Dto;
using TakeoutSaaS.Domain.Deliveries.Enums;

namespace TakeoutSaaS.Application.App.Deliveries.Commands;

/// <summary>
/// 创建配送单命令。
/// </summary>
public sealed class CreateDeliveryOrderCommand : IRequest<DeliveryOrderDto>
{
    /// <summary>
    /// 订单 ID。
    /// </summary>
    public long OrderId { get; set; }

    /// <summary>
    /// 服务商。
    /// </summary>
    public DeliveryProvider Provider { get; set; } = DeliveryProvider.InHouse;

    /// <summary>
    /// 第三方单号。
    /// </summary>
    public string? ProviderOrderId { get; set; }

    /// <summary>
    /// 状态。
    /// </summary>
    public DeliveryStatus Status { get; set; } = DeliveryStatus.Pending;

    /// <summary>
    /// 配送费。
    /// </summary>
    public decimal? DeliveryFee { get; set; }

    /// <summary>
    /// 骑手姓名。
    /// </summary>
    public string? CourierName { get; set; }

    /// <summary>
    /// 骑手电话。
    /// </summary>
    public string? CourierPhone { get; set; }

    /// <summary>
    /// 下发时间。
    /// </summary>
    public DateTime? DispatchedAt { get; set; }

    /// <summary>
    /// 取餐时间。
    /// </summary>
    public DateTime? PickedUpAt { get; set; }

    /// <summary>
    /// 完成时间。
    /// </summary>
    public DateTime? DeliveredAt { get; set; }

    /// <summary>
    /// 异常原因。
    /// </summary>
    public string? FailureReason { get; set; }
}
