using GB5Shared.DTO.Framework.Login; using MMDAL.DTO.StockValuation; using System.Data.Common; namespace MMBLL.StockPosition; public interface IStockPositionBLL { Task GetStockPositionAsync( int itemId, int skuId, int storeId, int ouid, LoginDTO login, CancellationToken ct); /// /// Ensures a zero-balance TSTOCKPOSITION row exists before the first transaction is posted. /// Must be called within the caller's open DB transaction. /// Task EnsurePositionExistsAsync( int itemId, int skuId, int storeId, int ouid, LoginDTO login, DbTransaction tx, CancellationToken ct); /// /// Applies quantity deltas to TSTOCKPOSITION after a stock ledger row is posted. /// postSign: +1 for receipts (StockPostType=0), -1 for issues (StockPostType=1). /// Task UpdatePositionQuantitiesAsync( int itemId, int skuId, int storeId, int ouid, decimal goodQuantity, decimal shadowGoodQuantity, decimal rejectedQuantity, decimal reworkQuantity, decimal otherQuantity, decimal wipQuantity, decimal unlinkedWipGoodQty, decimal unlinkedWipReworkQty, int postSign, LoginDTO login, DbTransaction tx, CancellationToken ct); /// /// Directly overrides AverageCost and AverageValue for a Cost Revaluation document. /// Only valid for WtAvg items; FIFO/LIFO callers must be rejected before reaching here. /// Task UpdateDirectAverageCostAsync( int itemId, int skuId, int storeId, int ouid, decimal newAverageCost, decimal newAverageValue, LoginDTO login, DbTransaction tx, CancellationToken ct); }