Inventory and operations
Bernalo Hub
Operations system for a scales and weighing business: inventory, sales, warehouse, technical service, invoicing and deliveries.
- Role
- End-to-end design and engineering
- Year
- 2026
- Status
- In production
- Stack
- Next.jsSupabaseTypeScriptshadcn/uiZodVitestVercel
- panel areas
- 18
- database migrations
- 84
- automated test files
- 31
- base roles with their own permissions
- 6
The problem
Selling a scale touches many hands: sales, the warehouse, invoicing, collections, delivery and, later on, technical service. The system had to give all of them a single version of stock and of every order.
What I built
An internal system that unifies stock by variant and physical location, and follows every sale from quote to delivery.
- Products, variants and stock
- Quotes and sales orders
- Purchasing and receiving
- Picking, dispatch and locations
- Deliveries and routes
- Technical service and workshop
- Invoicing, collections and commissions
- Stock counts, returns and alerts
Key decisions
Inventory movements are immutable: a mistake isn't edited, it's offset by a reverse movement. That way the history always explains why stock is what it is.
Stock reservations expire on their own: 30 minutes on the web and 72 hours for sales reps. Available stock always subtracts active reservations, and a single dispatch point deducts inventory, closes reservations and creates backorders.
The rules live in the database: row-level security on every table and order transitions validated by role. An automated test checks that they match the ones in the application.
Outcome
In production. The inventory core works alongside the commercial, financial and service modules on a single source of data.