Validate at the API boundary
The API checks permissions, regional prices, pack quantities, and campaign state before accepting a write.
ENGINEERING CASE STUDY · FRAMAR
A React, Node.js, and PostgreSQL pre-sale platform connecting distributor orders, regional pricing, campaign planning, and order history.
Pre-sale ordering brings together distributors, salespeople, and operations. Prices vary by region, quantities follow pack rules, and staff need to collaborate on campaign planning without losing another person’s edits.
I developed an application that puts those rules into the interface, API, and database, with separate access for buyers and internal teams.
The API checks permissions, regional prices, pack quantities, and campaign state before accepting a write.
Draft updates carry a version. The API rejects a save when the stored version has changed, allowing the user to refresh and resolve the conflict.
Submitted orders store their accepted line prices. Later catalog changes leave those historical prices intact.
Server-side permissions limit buyers to their own account’s records and give internal teams access appropriate to their role.
Orderdesk is an independent open-source React, TypeScript, Node.js, and PostgreSQL application with fictional products and accounts. It implements regional ordering, server-side validation, price history, and conflict recovery. It contains no employer code or data.
Explore Orderdesk ↗