The system was built in six phases, each useful on its own. First, cleaning up product keys: with no trustworthy SKU there is nothing to reconcile. Then a read-only central inventory that spent weeks just watching and comparing, with no authority to change anything.
The third phase brought the ledger: an append-only record of sales movements. A wrong movement is not edited, it is corrected by adding another, and stock is always the sum of history. Backfilling 90 days of history takes about two minutes, and querying that same window runs in 3.5 ms with no new indexes.
With trustworthy history in place the relationship could be inverted: the fourth phase writes back to the channel through a reconciler that verifies each write, and the fifth makes the web shop drop its own stock and serve the hub's availability instead. The last two open the way to a second channel and to the analytics layer.
It all runs on Node 22 with TypeScript over PostgreSQL, with schema validation at the boundaries, structured event logging, and CSV and PDF reports for people who work from a desk, not from a terminal.