using ERPCore.Dtos.Common;
using ERPCore.Dtos.Sales;

namespace ERPCore.Services.Interfaces;

/// <summary>Sales-return business logic — customer returns, mirroring purchase-return logic reversed.</summary>
public interface ISalesReturnService
{
    Task<PagedResponse<SalesReturnSummaryDto>> ListAsync(
        PageQuery query, int? customerId, int? warehouseId, CancellationToken ct = default);

    Task<SalesReturnDto?> GetAsync(int returnId, CancellationToken ct = default);

    Task<SalesReturnDto> CreateAsync(CreateSalesReturnRequest request, CancellationToken ct = default);

    /// <summary>Remaining returnable qty per line of one sales invoice (invoiced qty minus already-returned).</summary>
    Task<IReadOnlyList<SalesInvoiceLineRemainingDto>> GetRemainingByInvoiceAsync(int salesInvoiceId, CancellationToken ct = default);
}
