using ERPCore.Dtos.Common;
using ERPCore.Dtos.Stock;

namespace ERPCore.Services.Interfaces;

/// <summary>Read-side stock enquiry, ledger and valuation (docs/11 §5.1–5.3).</summary>
public interface IStockService
{
    Task<StockOnHandDto> GetOnHandAsync(int itemId, int warehouseId, CancellationToken ct = default);

    /// <summary>On-hand for every (item, warehouse) pair holding stock — backs the enquiry list.</summary>
    Task<PagedResponse<StockOnHandDto>> GetOnHandListAsync(
        int? itemId, int? warehouseId, PageQuery query, CancellationToken ct = default);

    Task<PagedResponse<StockLedgerRowDto>> GetLedgerAsync(
        int? itemId, int? warehouseId, DateOnly? from, DateOnly? to,
        string? sourceDocType, int? sourceDocId, PageQuery query, CancellationToken ct = default);

    Task<StockValuationDto> GetValuationAsync(int itemId, int warehouseId, CancellationToken ct = default);
}
