Skip to content

gonzozavala/caserito-orders-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caserito Orders Service

REST API responsible for managing orders in CaseritoApp.

Features

  • 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.

Technologies

  • Node.js + Express
  • JWT Authentication
  • File-based persistence (ready for PostgreSQL --> TBD)

Endpoints

Public

  • POST /orders → Create order + receive JWT token

Protected (require Authorization: Bearer <token>)

  • GET /orders/my-orders — Customer's own orders
  • GET /orders/:id — Get specific order (ownership validated)
  • GET /orders — All orders (Kitchen view)
  • GET /orders/me — Current authenticated user info
  • PATCH /orders/:id/status — Update order status
  • PATCH /orders/:id/cancel — Cancel order

Schemas

Detailed schemas for Order, User, and OrderItem are available in src/schemas/.

Development

npm install
npm run dev

Environment Variables

See .env file (contains JWT_SECRET, MENU_SERVICE_URL_, etc.)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors