The problem a physical logbook cannot solve
At Sentric, when a camera left for installation, the technician made a note in a logbook. When it came back, another note. When it went in for repair, another note — if they remembered. The predictable result: cameras with no known whereabouts, technicians calling each other to find out “where is camera X”, assets sitting idle because nobody knew whether the equipment was available or in the field.
The fundamental problem was not lack of discipline — it was the absence of a system that made recording movements inevitable and immediate.
The most important design decision: append-only
Most inventory systems work with a central record that is destructively updated: “camera X is now at client Y.” That resolves the current query, but destroys the history. If a camera goes missing, you have no way to know who last had it.
The Sentric Inventory works differently: every movement is an immutable event. When a camera leaves for installation, a SAIDA_CAMPO event is created. When it returns, a RETORNO_BASE event. The current state of the camera is calculated from the event sequence — not stored directly. This means a complete audit trail with zero additional effort: it is a structural consequence of the design, not a separate feature.
DataMatrix in the field
The physical label is what anchors digital identity to the physical object. We chose DataMatrix over QR Code for three reasons:
- Density: stores more data in the same physical space
- Robustness: reliable reading even with up to 30% of the label damaged
- Oblique reading: works at angles that would cause a QR Code to fail
The code printed on the label includes a Luhn check digit — the same algorithm used in credit cards — to detect typing errors before they reach the database.
packages/domain — the stateless heart
The decision to completely isolate the domain in a package with no I/O dependency has an immediate practical effect: the camera state machine can be tested with fast-check generating thousands of random event sequences, verifying invariants such as “a camera can never be in two places simultaneously” or “you cannot check out a camera that is not at the base.”
These tests need no database, no mocks, no server. They are pure functions — and fast-check finds edge cases that no hand-written test would ever uncover.