Skip to main content

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

ColumnTypeDescription
id_categoriaINTPrimary key
nombreVARCHAR(100)Category name (unique)
descripcionVARCHAR(255)Optional description
activoBOOLEANtrue = visible on menu; false = hidden

Category endpoints

MethodPathDescription
GET/api/categoriesList all categories
GET/api/categories/:idGet a single category
POST/api/categoriesCreate a category (Admin only)
PUT/api/categories/:idUpdate a category (Admin only)
DELETE/api/categories/:idDelete 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

ColumnTypeDescription
id_productoINTPrimary key
nombreVARCHAR(150)Product name
descripcionTEXTOptional description
precioDECIMAL(10,2)Unit price
stockINTAvailable units
imagenVARCHAR(255)URL to product image
id_categoriaINTFK → CATEGORIAS
activoBOOLEANVisibility flag

Product endpoints

MethodPathDescription
GET/api/productsList all products
GET/api/products/:idGet a single product
POST/api/productsCreate a product (Admin only)
PUT/api/products/:idUpdate a product (Admin only)
DELETE/api/products/:idDelete 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.

Public Menu

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:
  1. Category must be activeactivo = true on the CATEGORIAS record.
  2. Product must be activeactivo = true on the PRODUCTOS record.
  3. Product must have stockstock > 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:
ConditionVisible 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.

Build docs developers (and LLMs) love