using ERPCore.Domain.Enums;
using ERPCore.Dtos.Common;
using ERPCore.Dtos.Stock;

namespace ERPCore.Services.Interfaces;

/// <summary>Inter-warehouse transfer business logic (docs/11 §5.4; FR-STK-05/06).</summary>
public interface ITransferService
{
    Task<PagedResponse<TransferSummaryDto>> ListAsync(
        PageQuery query, TransferStatus? status, int? srcWarehouseId, int? destWarehouseId, CancellationToken ct = default);

    Task<TransferDto?> GetAsync(int transferId, CancellationToken ct = default);
    Task<TransferDto> CreateAsync(CreateTransferRequest request, CancellationToken ct = default);

    /// <summary>Dispatch: consume source FIFO layers into in-transit (row-locked).</summary>
    Task<DispatchResultDto> DispatchAsync(int transferId, CancellationToken ct = default);

    /// <summary>Receive: create the destination layer at the inherited (cost-preserving) cost.</summary>
    Task<ReceiveResultDto> ReceiveAsync(int transferId, ReceiveTransferRequest request, CancellationToken ct = default);
}
