using GB5Shared.DTO.Framework.Login;
using MMDAL.DTO.StockValuation;
using System.Data.Common;
namespace MMBLL.FifoLayerCost;
public interface IFifoLayerCostBLL
{
///
/// Creates a new cost layer when stock is received for a non-lot FIFO/LIFO item.
/// One layer per TSTOCKLEDGER receipt row.
///
Task CreateLayerAsync(
int itemId, int skuId, int storeId, int ouid,
decimal quantity, decimal unitCost,
int objectTypeId, int objectId, long stockLedgerId,
DateOnly layerDate,
LoginDTO login, DbTransaction tx, CancellationToken ct);
///
/// Allocates cost layers for an issue and returns the blended cost.
/// Decrements TCOSTLAYER.RemainingQuantity and writes TCOSTLAYERDETAIL audit rows.
/// The returned BlendedUnitCost is written to TSTOCKLEDGER.PostedCost by the caller.
///
Task AllocateLayersAsync(
int itemId, int skuId, int storeId, int ouid,
decimal issueQty, bool isLifo,
long issueStockLedgerId,
LoginDTO login, DbTransaction tx, CancellationToken ct);
///
/// Returns open cost layers for the cost workings / audit report.
///
Task GetOpenCostLayersAsync(
int itemId, int skuId, int storeId, int ouid,
LoginDTO login, CancellationToken ct);
}