Feature #5400
openAPI for Consuming Stock (Sales / Allocation)
Start date:
11/29/2025
Due date:
11/29/2025 (about 2 months 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
Updated by Yalavarthi Thriveni about 2 months ago
- Target version deleted (
Sprint 1)
Updated by Yalavarthi Thriveni 24 days ago
- Target version set to Backlog
- Parent task deleted (
#5398)