Add movement retrieval and update functionality to stock

This commit is contained in:
2026-09-08 13:16:04 +05:30
parent f5872cedaf
commit 7e362be304
5 changed files with 146 additions and 21 deletions
@@ -50,6 +50,12 @@ public class StockRepository(AppDBContext db) : IStockRepository
public async Task AddMovementAsync(StockMovement movement) =>
await db.StockMovements.AddAsync(movement);
public Task<StockMovement?> GetMovementByIdAsync(Guid id) =>
db.StockMovements.Include(m => m.Item).FirstOrDefaultAsync(m => m.Id == id);
public void UpdateMovement(StockMovement movement) =>
db.StockMovements.Update(movement);
public Task<List<StockMovement>> GetMovementsAsync(Guid? locationId, Guid? itemId, MovementType? type, DateTime? from, DateTime? to, int page, int pageSize)
{
var query = db.StockMovements.Include(m => m.Item).AsQueryable();