Feature #5400
openFeature #5398: Implement Vendor-wise Stock Batches for Product Inventory
API for Consuming Stock (Sales / Allocation)
Start date:
11/29/2025
Due date:
11/29/2025 (9 days late)
% Done:
0%
Estimated time:
Description
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
Subtasks
Related issues