How I built a billing system with a real double-entry ledger in Node + PostgreSQL
Most billing code has the same bug hiding in it: it stores the account balance as a number and mutates it — balance += amount. It works fine, right up until a payment gets entered twice, or you have t
lapistry.hashnode.dev7 min read