using Distribution.Models; namespace Distribution.Features.Stock; public interface IStockRepository { // Balance Task GetBalanceAsync(Guid itemId, Guid locationId); Task GetBalanceAsync(Guid itemId, Guid locationId, Guid? itemBatchId, Guid? itemSerialNumberId); Task> GetBalancesByLocationAsync(Guid locationId, LocationType locationType); Task> GetBalancesAsync(Guid? locationId, LocationType? locationType, Guid? itemId, int page, int pageSize); Task GetBalancesCountAsync(Guid? locationId, LocationType? locationType, Guid? itemId); Task> GetBalancesByItemAsync(Guid itemId); Task> GetLowStockAsync(Guid? locationId); Task AddBalanceAsync(StockBalance balance); void UpdateBalance(StockBalance balance); // Movements Task AddMovementAsync(StockMovement movement); Task GetMovementByIdAsync(Guid id); void UpdateMovement(StockMovement movement); Task> GetMovementsAsync(Guid? locationId, Guid? itemId, MovementType? type, DateTime? from, DateTime? to, int page, int pageSize); Task GetMovementsCountAsync(Guid? locationId, Guid? itemId, MovementType? type, DateTime? from, DateTime? to); // Batches — a null batchNumber always creates a fresh expiry-only lot (no dedup possible on null). Task FindBatchAsync(Guid itemId, string batchNumber); Task AddItemBatchAsync(ItemBatch batch); // Serial numbers Task SerialNumberExistsAsync(Guid itemId, string serialNumber); /// One past the highest numeric suffix among the item's existing serials that start with (1 if none). Task GetNextSerialSequenceAsync(Guid itemId, string prefix); Task AddItemSerialNumberAsync(ItemSerialNumber serial); }