Project

General

Profile

Feature #5400

Updated by Yalavarthi Thriveni 11 days ago

Description: 
 When a sale/order is created, quantity should be allocated from the correct batch using FIFO. 

 API Work: 

 Endpoint: POST /api/products/:id/stock/consume 

 FIFO allocation logic 

 Reduce batch.qtyRemaining 

 Create StockMovement record 

 Acceptance Criteria 

  Outgoing qty deducted from oldest batch 

  Returns allocation breakdown: 
 Product.totalQty decremented correctly

Back