All case studies
Case studyOriginal ConceptDemo Ready

Meridian: Inventory & Purchasing Operations

An inventory and purchasing system built on an append-only movement ledger: stock is never stored as a number, it is the sum of its movements. Receipts, transfers, reorder suggestions and valuation all derive from the same record.

This is a working demonstration, not a client engagement. The brand and data are fictional.

Meridian stock overview with on-hand, on-order and reorder columns

Background

Meridian is an invented distributor. The system covers the part of operations where mistakes are expensive: knowing what you have, what is coming, and what to order.

The challenge

Inventory systems that store a quantity field drift. A failed write, a double-click or a race and the number no longer matches reality, with no record of how it got there.

Objectives

  • Make stock impossible to drift by never storing it as a number.
  • Keep purchase orders, receipts and reorder advice consistent with the same record.
  • Refuse the operations that corrupt an inventory system rather than recording them.

My role

Sole designer and developer

  • Designed the ledger as the single source of truth: balances are computed, never written
  • Built the posting gate that refuses movements which would drive stock negative or carry the wrong sign
  • Implemented transfers as matched movement pairs, so a transfer can never create or destroy stock
  • Built purchase orders with status derivation, over-receipt refusal and partial receipts
  • Implemented reorder suggestions that account for stock already on order
  • Wrote 31 unit tests and 27 browser checks

Technical approach

An append-only ledger. Every change is a movement with a reason, a reference and a timestamp; on-hand is the sum. Nothing can silently change a balance, and every balance can be explained by replaying its movements.

What is implemented

  • Append-only movement ledger with reason, reference and timestamp on every entry
  • On-hand, on-order and running balances computed from the ledger
  • Transfers posted as matched pairs, so stock cannot be created or destroyed
  • Purchase orders with partial receipts, status derivation and over-receipt refusal
  • Reorder suggestions that account for stock already on order
  • Stock valuation and a movement history view per SKU

Process

  1. Built the ledger primitives (post, transfer, balances, running balance, valuation) with the posting gate refusing invalid movements.
  2. Built purchasing on top: orders, partial receipts, status derivation and over-receipt refusal.
  3. Added reorder suggestions, then found the inconsistency described below.
  4. Wrote the browser suite over the real interface.

Engineering and creative decisions

  • The ledger is the only source of truth

    Balance is the sum of movements, never a stored field. Every figure can be explained by replaying its movements, and a failed write cannot leave a quantity that no longer matches reality.

  • The posting gate refuses invalid movements

    A movement that would drive stock negative, or that carries the wrong sign for its type, is rejected at the boundary rather than written and corrected later.

  • Reorder advice and the stock table share a calculation

    They did not at first: the headline said 'below reorder: 0' while the table flagged an item, because one counted stock on order and the other did not. Both now use the same figure and a test asserts they agree.

What was delivered

A system where the stock figure, the movement history, the purchase orders and the reorder advice are all views of one ledger, so they agree by construction.

Results

  • 31 unit tests and 27 browser checks pass.
  • Testing caught a contradiction the interface was showing: the headline said "below reorder: 0" while the table flagged an item. The reorder calculation counted stock on order and the table did not. Both now use the same figure, and a test asserts they agree.
  • My own seed-size expectation was wrong: the fixture holds 1,265 movements, not the 1,500+ I had assumed. The test was corrected to the real number.

These are tested capabilities of the demonstration, not commercial outcomes.

Technology stack

  • TypeScript
  • React 19
  • esbuild
  • Node.js test runner
  • Playwright

Get in touch

Have a similar project in mind?

Whether you're launching a brand, developing a digital product, or automating business workflows, let's discuss how to bring your idea to life.