using LittleShop.DTOs;
using LittleShop.Enums;

namespace LittleShop.Services;

public interface IOrderService
{
    Task<IEnumerable<OrderDto>> GetAllOrdersAsync();
    Task<IEnumerable<OrderDto>> GetOrdersByIdentityAsync(string identityReference);
    Task<IEnumerable<OrderDto>> GetOrdersByCustomerIdAsync(Guid customerId);
    Task<OrderDto?> GetOrderByIdAsync(Guid id);
    Task<OrderDto> CreateOrderAsync(CreateOrderDto createOrderDto);
    Task<bool> UpdateOrderStatusAsync(Guid id, UpdateOrderStatusDto updateOrderStatusDto);
    Task<bool> CancelOrderAsync(Guid id, string identityReference);

    // Enhanced workflow methods
    Task<bool> AcceptOrderAsync(Guid id, string userName, AcceptOrderDto acceptDto);
    Task<bool> StartPackingAsync(Guid id, string userName, StartPackingDto packingDto);
    Task<bool> DispatchOrderAsync(Guid id, string userName, DispatchOrderDto dispatchDto);
    Task<bool> PutOnHoldAsync(Guid id, string userName, PutOnHoldDto holdDto);
    Task<bool> RemoveFromHoldAsync(Guid id, string userName);
    Task<bool> MarkDeliveredAsync(Guid id, MarkDeliveredDto deliveredDto);

    // Workflow queries
    Task<IEnumerable<OrderDto>> GetOrdersByStatusAsync(OrderStatus status);
    Task<IEnumerable<OrderDto>> GetOrdersRequiringActionAsync(); // PaymentReceived orders needing acceptance
    Task<IEnumerable<OrderDto>> GetOrdersForPackingAsync(); // Accepted orders ready for packing
    Task<IEnumerable<OrderDto>> GetOrdersOnHoldAsync(); // Orders on hold
}