REST API responsible for managing orders in CaseritoApp.
- Order creation with automatic user registration by phone number.
- Real-time integration with Menu Service for item & price validation.
- JWT Authentication (token returned after successful order creation).
- Customer and Kitchen separated views with ownership validation.
- Full order lifecycle with status history (audit trail).
- File-based persistence (data survives server restarts).
- Clean, modular architecture.
- Node.js + Express
- JWT Authentication
- File-based persistence (ready for PostgreSQL --> TBD)
POST /orders→ Create order + receive JWT token
GET /orders/my-orders— Customer's own ordersGET /orders/:id— Get specific order (ownership validated)GET /orders— All orders (Kitchen view)GET /orders/me— Current authenticated user infoPATCH /orders/:id/status— Update order statusPATCH /orders/:id/cancel— Cancel order
Detailed schemas for Order, User, and OrderItem are available in src/schemas/.
npm install
npm run devSee .env file (contains JWT_SECRET, MENU_SERVICE_URL_, etc.)