When engineering teams integrate Shopify, Amazon FBM, or TikTok Shop with a China fulfillment warehouse, overselling bugs almost always start with a flat data model: a single quantityOnHand: number column synced straight to storefront inventory.
A real warehouse floor never runs on one number. Cartons delivered by a factory in Shenzhen, Dongguan, or Suzhou sit on the dock before inspection, wait in quarantine when a carton arrives damp or short, get reserved when an order enters picking, and wait in outbound staging until physical carrier handover. Collapsing those physical states into one integer lets live storefronts sell damaged units or uninspected dock stock.
Editorial note: The TypeScript interfaces and state-transition guards below are an editorial modeling example built around the five operational inventory buckets documented on YX Fulfillment's public workflow pages ( received , available , allocated , exception_hold , pending_dispatch ).…