Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ytabeloved/ordervista/llms.txt
Use this file to discover all available pages before exploring further.
The Ordervista menu catalog is organized as a two-level hierarchy: categories group related items (e.g., Burgers, Drinks, Desserts), and products belong to exactly one category. Both categories and products carry an activo boolean flag that controls whether they appear on the public-facing menu. Admins manage the full catalog through dedicated API endpoints, while any authenticated user can retrieve the live menu to browse or place an order.
Categories
Categories are stored in the CATEGORIAS table and provide the organizational backbone for the menu. CRUD operations are available at /api/categories and are restricted to the Admin role.
CATEGORIAS table
| Column | Type | Description |
|---|
id_categoria | INT | Primary key |
nombre | VARCHAR(100) | Category name (unique) |
descripcion | VARCHAR(255) | Optional description |
activo | BOOLEAN | true = visible on menu; false = hidden |
Category endpoints
| Method | Path | Description |
|---|
GET | /api/categories | List all categories |
GET | /api/categories/:id | Get a single category |
POST | /api/categories | Create a category (Admin only) |
PUT | /api/categories/:id | Update a category (Admin only) |
DELETE | /api/categories/:id | Delete a category (Admin only) |
The activo flag is the primary switch for enabling or disabling a category. Setting it to false effectively hides the entire category — and every product within it — from the public menu, even if the individual products are still marked active. Use PUT /api/categories/:id with { "activo": false } to deactivate a category without deleting it.
Products
Individual menu items are stored in the PRODUCTOS table. Each product belongs to one category and carries its own activo flag and stock count. CRUD operations are available at /api/products and are restricted to the Admin role.
PRODUCTOS table
| Column | Type | Description |
|---|
id_producto | INT | Primary key |
nombre | VARCHAR(150) | Product name |
descripcion | TEXT | Optional description |
precio | DECIMAL(10,2) | Unit price |
stock | INT | Available units |
imagen | VARCHAR(255) | URL to product image |
id_categoria | INT | FK → CATEGORIAS |
activo | BOOLEAN | Visibility flag |
Product endpoints
| Method | Path | Description |
|---|
GET | /api/products | List all products |
GET | /api/products/:id | Get a single product |
POST | /api/products | Create a product (Admin only) |
PUT | /api/products/:id | Update a product (Admin only) |
DELETE | /api/products/:id | Delete a product (Admin only) |
Required fields when creating a product: nombre, precio, id_categoria.
Creating a product
{
"nombre": "Hamburguesa Clásica",
"descripcion": "Carne 200g, lechuga, tomate",
"precio": 8500,
"stock": 50,
"imagen": "https://example.com/hamburguesa.jpg",
"id_categoria": 1
}
Success response: 201 Created
{
"mensaje": "Producto creado correctamente",
"id_producto": 9
}
Product images are stored as URL strings in the imagen column — Ordervista does not handle file uploads. Host your images on a CDN or object storage service (e.g., Cloudinary, AWS S3) and supply the public URL when creating or updating a product.
Endpoint: GET /api/menu
Auth: Required (any authenticated user — no role restriction beyond a valid JWT)
The menu endpoint is the primary data source for the customer cart and the operator new-order screen. It applies three visibility filters before returning data:
- Category must be active —
activo = true on the CATEGORIAS record.
- Product must be active —
activo = true on the PRODUCTOS record.
- Product must have stock —
stock > 0.
Only items that pass all three checks are returned. The response is a single JSON object with two keys: categories (only active categories) and products (only products that pass all three filters).
Response shape:
{
"categories": [
{
"id_categoria": 1,
"nombre": "Hamburguesas",
"descripcion": "Nuestras hamburguesas artesanales",
"activo": true
}
],
"products": [
{
"id_producto": 9,
"nombre": "Hamburguesa Clásica",
"descripcion": "Carne 200g, lechuga, tomate",
"precio": "8500.00",
"stock": 50,
"imagen": "https://example.com/hamburguesa.jpg",
"id_categoria": 1,
"activo": true
}
]
}
Product Availability Rules
The activo flag on both tables works in combination with live stock levels to control what customers can order:
| Condition | Visible on menu? |
|---|
Category activo = true, product activo = true, stock > 0 | ✅ Yes |
Category activo = true, product activo = true, stock = 0 | ❌ No (out of stock) |
Category activo = true, product activo = false | ❌ No |
Category activo = false, product activo = true | ❌ No (category overrides) |
Stock is automatically decremented by the createOrder model function each time an order is placed. Admins can replenish stock by updating a product via PUT /api/products/:id with a new stock value.