// EN: Order repository interface.
// VI: Interface repository Order.

using OrderService.Domain.SeedWork;

namespace OrderService.Domain.AggregatesModel.OrderAggregate;

/// <summary>
/// EN: Repository interface for Order aggregate.
/// VI: Interface repository cho Order aggregate.
/// </summary>
public interface IOrderRepository : IRepository<Order>
{
    /// <summary>
    /// EN: Add a new order.
    /// VI: Thêm đơn hàng mới.
    /// </summary>
    Order Add(Order order);

    /// <summary>
    /// EN: Update existing order.
    /// VI: Cập nhật đơn hàng hiện có.
    /// </summary>
    void Update(Order order);

    /// <summary>
    /// EN: Get order by ID.
    /// VI: Lấy đơn hàng theo ID.
    /// </summary>
    Task<Order?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get orders by shop ID.
    /// VI: Lấy danh sách đơn hàng theo shop ID.
    /// </summary>
    Task<IEnumerable<Order>> GetByShopIdAsync(Guid shopId, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get orders by customer ID.
    /// VI: Lấy danh sách đơn hàng theo customer ID.
    /// </summary>
    Task<IEnumerable<Order>> GetByCustomerIdAsync(Guid customerId, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get return orders for an original order.
    /// VI: Lấy các đơn trả hàng cho đơn hàng gốc.
    /// </summary>
    Task<IEnumerable<Order>> GetReturnsByOriginalOrderIdAsync(Guid originalOrderId, CancellationToken cancellationToken = default);
}
