Why we built it this way
Food e-commerce has a silent enemy: inconsistency. Stock sold twice, prices changing between cart and payment, half-approved receipts. That's why the core decision was making the server the single authority: prices, stock, coupons and order states are computed and validated in the database, inside atomic transactions. The browser only displays — it never decides what anything costs.
Stock reservation works like a box office: when an order is confirmed, stock is held for a configurable time depending on the payment method; if payment never arrives, a cron releases it automatically. The Mercado Pago webhook verifies the cryptographic signature of every notification, fetches the real payment from the API and is idempotent: a payment is never credited twice nor lost, even if it arrives late on an expired order.
The other pillar is the multi-city model with tiers: the same store handles pickup in Colón and zone-based shipping in Rosario with independent inventories, and each customer sees the prices of their tier (retail or wholesale) with minimum quantities configurable per product and per order.
Also includes
- Discount coupons with anti-enumeration validation
- "Notify me when it's back" with automatic restock emails
- Guest checkout for pickup; saved addresses for shipping
- Immutable orders: prices, names and address frozen at purchase
- User manager with tiers and wholesale account requests
- Order status emails + pre-filled WhatsApp buttons
- Row Level Security across the database as a second line of defense
- Integration test suite against the real database (95+ tests)




