using ERPCore.Dtos.Grn;

namespace ERPCore.Services.Interfaces;

/// <summary>Goods-receipt business logic (docs/11 §4; FR-GRN-01..08).</summary>
public interface IGrnService
{
    Task<GrnDto?> GetAsync(int grnId, CancellationToken ct = default);
    Task<GrnDto> CreateAsync(CreateGrnRequest request, CancellationToken ct = default);

    /// <summary>Confirm: create FIFO layers + inbound ledger + update PO receipts, atomically.</summary>
    Task<GrnConfirmResultDto> ConfirmAsync(int grnId, string? idempotencyKey, CancellationToken ct = default);

    Task<ReleaseLineResultDto> ReleaseLineAsync(int grnId, int grnLineId, string action, CancellationToken ct = default);
}
