Project

General

Profile

Support #10999

Updated by Yalavarthi Thriveni about 14 hours ago

Order Placement & Initial Warehouse Map 
 Partial / Defective: Only checks StockBatch.sort({ receivedAt: 1 }). No check on expiration date or customer delivery distance. 

  Inventory must be reserved across regional fulfillment centers (US West/East, India North/South) based on customer proximity and postal routing. Allocation within each warehouse must strictly follow FEFO (First-Expired, First-Out), excluding batches where expirationDate <= now + buffer. If stock is distributed across hubs, the allocation engine must produce optimal fulfillment splits 


 consumeStockBatchService sorts strictly by receivedAt: 1 (FIFO). It completely ignores expirationDate, violating FEFO requirements for perishable nursery goods. 
 Expired batches are not filtered out (expirationDate: { $gt: new Date() } is missing), allowing expired lots to be allocated to customer orders. 
 consumeStockBatchService does not take locationId or warehouseId as a query parameter; it queries global batches indiscriminately, breaking regional warehouse containment. 
 No proximity routing algorithm exists to compute nearest warehouse by customer ZIP code (US) or PIN code (India).

Back