← All posts

Inventory and materials

Knowing what you have in stock is the easy part. Knowing exactly which stock went into a specific batch, where it came from, and what the difference between what you received and what production consumed actually means: that is a harder problem. This post covers how the inventory model approaches it.

What we built

Two distinct concepts: the inventory type, and the inventory item. An inventory type defines what something is: Olive Oil, White Clay, Lavender Essential Oil. An inventory item is physical stock the business actually holds: a specific drum received against a purchase order, with its own inventory code, landed cost, and lifecycle state.

Inventory items extend into four subtypes based on the role they play: consumables (formulation ingredients, tracked in milligrams), equipment (durable assets with serial numbers and maintenance records), products (finished goods ready to go out), and supplies (operational materials consumed by the process itself: packaging, labels, gloves). Each subtype carries its own quantity in its own native unit.

The connection between a batch and the stock it consumed is captured by ingredient inventory allocations. A batch ingredient requirement can be fulfilled from multiple physical inventory items, and each allocation records exactly which stock contributed and how much came from each.

The problem it solves

The distinction between type and item matters because Plan.Make.Trace needs to trace the specific stock actually used in production, not merely the kind of material. Two drums of olive oil from different purchase orders are the same type but different items. If one came from a different supplier or a different batch, that difference needs to be preserved.

Inventory changes are captured through the business events that actually caused them. Receiving stock, allocating ingredients to a batch, producing finished goods: each of those events creates its own relationships and quantities. The inventory model reflects what happened rather than accumulating manual adjustments on top of a running count.

The challenge

Designing the model around traceability rather than stock adjustments produces something interesting: the gap between what was received and what production consumed is not a discrepancy to be corrected. It is evidence.

If 10 kg of a material was received and production allocations account for 9.7 kg, but the physical stock is exhausted, that difference exposes 300 g that production did not account for. Over time, those differences can reveal patterns of manufacturing loss and become useful waste metrics. Historical loss can feed back into production planning, material requirements, and reorder thresholds. If a process consistently loses a percentage of a material, future planning can account for what is actually required rather than only the theoretical recipe quantity.

That is the broader design intent behind traceability in Plan.Make.Trace. The relationships created through doing the manufacturing work produce operational data as a consequence. The traceability is not only about proving provenance. It is about generating information that improves future decisions.

What makes this different

The traceability chain is explicit in the data model: batch, ingredient, allocation, inventory item, source order line. That chain can eventually be traversed in either direction: from a supplier order through to the finished product it contributed to, or backwards from a finished product to the exact materials and source orders involved.

Stock is never deleted. A unit that is spent or unusable is transitioned through its lifecycle state. That means the historical record stays intact even as stock moves through the manufacturing process.

What this unlocks

A soap maker can receive materials through a purchase order and have those items available to allocate to production batches. The cost carried from the order flows into the stock, so cost of goods can be calculated from the actual materials used rather than from estimated average prices.

The foundation for the full traceability experience is in place. As more of the manufacturing workflow is connected, the relationships between supplier, stock, batch, and finished product accumulate automatically. Waste analysis, production forecasting improvements, and a visual traceability graph are all downstream of this model.

What's next

The next post covers the frontend data layer: how Plan.Make.Trace manages server state on the client and keeps the UI consistent with the backend.

Liked this post? Tap the heart to let us know.

Get early access

Be the first to hear about early access, roadmap updates, and exclusive early adopter pricing.

Join the early access list