All posts

Operations

The stock ledger is append-only, and that is the feature

Editing a quantity is the fastest way to lose an argument six weeks later. Corrections as movements cost a little more to build and pay for themselves the first time someone asks why.

BluYards EngineeringProduct team2 min read

There is a version of this product where a manager opens the inventory grid, types 47 over the 52 that was there, and moves on. It is faster to build and faster to use, and it is a trap.

Six weeks later the variance report says a SKU lost 300 units across the network and nobody can say where. The cell that changed is gone. There is no reason attached to it, no person, no time, and no way to tell a correction apart from a theft apart from a receipt that was never recorded.

One service, one table, no edits

Every path that changes stock — the outlet portal, the REST API, a CSV import, replenishment, transfers, counts, HQ adjustments, the demo simulator — calls the same movement service. It appends to the ledger. It never updates a movement, and it never deletes one.

  1. Validate the shape of every line before touching anything.
  2. Lock the affected stock-level rows in a stable order, so concurrent batches cannot deadlock.
  3. Compute signed deltas and running balances in memory.
  4. Append the movements, then update the cached levels in one statement.
  5. Evaluate alerts, publish the realtime event, and enqueue notifications — all inside the transaction.

The current on-hand figure is a cache of that ledger, not the truth. The demo seed verifies the two agree, and any correction you make is a new row with a reason on it.

What a correction looks like

SituationWhat gets posted
Shelf shows 47, system says 52COUNT_CORRECTION setting on hand to 47, with the reason
Three bottles brokenDAMAGE of 3, which leaves stock and hits the write-off account
Inward document raised in errorADJUSTMENT reversing each line, and the voucher withdrawn
Stock found after a countADJUSTMENT of +n, with a reason someone can read

You cannot audit a spreadsheet cell. You can audit a movement.

The cost is a few extra rows per correction and a UI that asks for a reason. The return is that every number on every screen can be traced to a document, a person and a time — which is the only answer that ends the conversation.

See BluYards against your own data

Bring a product list and a week of sales. We will load it and show you which shelves would have been empty.