using MediatR;
using TakeoutSaaS.Application.App.Deliveries.Dto;
using TakeoutSaaS.Domain.Deliveries.Enums;
using TakeoutSaaS.Shared.Abstractions.Results;

namespace TakeoutSaaS.Application.App.Deliveries.Queries;

/// <summary>
/// 配送单列表查询。
/// </summary>
public sealed class SearchDeliveryOrdersQuery : IRequest<PagedResult<DeliveryOrderDto>>
{
    /// <summary>
    /// 订单 ID（可选）。
    /// </summary>
    public long? OrderId { get; init; }

    /// <summary>
    /// 配送状态。
    /// </summary>
    public DeliveryStatus? Status { get; init; }

    /// <summary>
    /// 页码。
    /// </summary>
    public int Page { get; init; } = 1;

    /// <summary>
    /// 每页条数。
    /// </summary>
    public int PageSize { get; init; } = 20;

    /// <summary>
    /// 排序字段（createdAt/status/provider）。
    /// </summary>
    public string? SortBy { get; init; }

    /// <summary>
    /// 是否倒序。
    /// </summary>
    public bool SortDescending { get; init; } = true;
}
