Design a Dark Store Inventory Management System

Problem

Design the OOP model for a dark store inventory system used in Zepto's 10-minute delivery model.

Requirements

  • receiveStock(productId, qty, storeId) — inbound from supplier
  • reserveItem(orderId, productId, qty, storeId) — reserves stock on order
  • confirmPick(orderId) / returnToShelf(orderId) — fulfil or release reservation
  • getLowStockProducts(storeId, threshold) — trigger reorder
  • transferStock(fromStore, toStore, productId, qty)

Key classes

DarkStore, Product, StockLedger, Reservation, InventoryEvent

Critical design decisions

  • Event-sourced ledger for auditability
  • Reservation expiry to prevent indefinite holds
  • Optimistic concurrency for parallel pickers in the same store

Extension

Add expiry tracking for perishables (FEFO — first expired, first out).

added …
LeaderboardSalaryAccount