Back to all work

Case study

Building a Recommended Order Quantity Engine for Perishable Inventory

Forecast was only one input. The system turned freshness, timing, and warehouse constraints into a usable purchase recommendation for perishables.

Output

Recommended order quantity with decision explanation and inventory outlook.

Forecast alone was not enough to recommend order quantity.

Problem

Fresh inventory ordering could not rely on demand forecast alone. A usable recommendation had to account for current inventory, open purchase orders, vendor lead time, minimum order quantities, and the number of days a product could still be sold after inbounding.

The hard part was not prediction by itself. It was making ordering decisions that balanced stockout risk against freshness perception, waste exposure, and warehouse feasibility.

Approach

I built a rule-based ordering engine that translated forecast and inventory signals into a constrained purchase recommendation. The logic also produced a decision explanation and an inventory outlook so the recommendation could be reviewed operationally rather than treated as a black box.

The result was not a single formula. It was a staged decision system that encoded how perishables should be ordered under real warehouse and vendor constraints.

The engine had to balance freshness, feasibility, and warehouse handling at the same time.

Inventory and demand

The recommendation started from current inventory position, demand forecast, and open purchase orders rather than from forecast alone.

Lead time and codelife

Order timing had to reflect vendor lead time and usable codelife. For perishables, pulling inventory too early can create a different failure mode even if it lowers nominal stockout risk.

MOQ and pallet handling

Minimum order and pallet-unit constraints were not only commercial rules. They also mattered for warehouse efficiency, because pallet-aligned ordering reduced unnecessary depalletizing work when inventory moved from cross-dock to outbound operations.

Orderable calendar

The logic also had to respect weekends, holidays, and non-deliverable dates, so the recommendation reflected when orders could actually be placed and received.

The system used staged logic to turn inputs and constraints into a usable order quantity.

Decision flow from forecast, inventory position, open purchase orders, lead time, and usable sell window through order spreading, MOQ and pallet fit, and orderable calendar checks to recommended order quantity, decision explanation, and inventory outlook.

The recommendation was built in stages so the system could explain how timing, freshness, and handling constraints changed the final quantity.

Target coverage first

The engine first established a target coverage level using forecast, lead time, and a freshness-aware buffer. That created a starting point for how much inventory should be on hand.

Baseline quantity

From that target, the system estimated a baseline purchase quantity after accounting for current inventory and open purchase orders. This gave a first recommendation before warehouse and scheduling constraints were applied.

Order spreading control

A purchase-order cap was used to spread orders across time. The purpose was to avoid pulling inventory in too early just to chase a small reduction in stockout risk.

Freshness and demand volatility

That mattered even for items with longer codelife. Excess early inventory could still reduce freshness perception for customers or become vulnerable to demand shifts caused by competitor pricing.

MOQ, pallet, and exception handling

The system then adjusted the recommendation to MOQ and pallet units, and applied explicit exception handling when operational risk remained too high under the normal rule path.

The useful output was a quantity plus an explanation.

The recommendation was meant to support a planner review, not replace it with a single opaque number.

Recommended quantity

The core output was a suggested purchase quantity that already reflected timing, freshness, and handling constraints.

Decision explanation

The system also produced a short explanation of why the recommendation looked the way it did, which made review and discussion easier for planning and operations teams.

Inventory outlook

A simple inventory outlook helped reviewers judge whether the recommendation looked reasonable once current stock and incoming purchase orders were taken into account.

Perishable ordering needed constraint architecture, not just better prediction.

What mattered

The important design problem was not forecast generation alone. It was deciding how forecast should be constrained by freshness, timing, warehouse handling, and purchasing rules.

Why the system was useful

The engine made ordering decisions more consistent by balancing stockout risk against waste risk, freshness perception, and operating efficiency in one reusable logic.

Continue with connected pages

Case studies and methods that connect to the same operational questions.

Case study

Graph-Based Warehouse Optimization and Simulation

Built a warehouse optimization workflow that combined graph construction and simulation to test inventory placement and picker travel distance before a full optimizer existed.

Status: usable first system for directional analysis

Method

Seasonality Index for Inventory Planning

An inventory planning method that estimates SKU-level seasonality, groups products into seasonal buckets, and connects those signals back to category planning.

Format: Method note built around product-level seasonality and seasonal buckets.

Back to all work