The Ordervista Admin Dashboard provides a real-time operational overview of restaurant performance. A single API call toDocumentation 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.
GET /api/reports/dashboard resolves seven data sets in parallel — from headline sales figures and trend charts to the most recent orders — giving administrators a complete picture without multiple round-trips. All revenue-related metrics automatically exclude cancelled orders (id_estado = 5) to keep figures accurate. The dashboard is accessible at the /reportes frontend route and is restricted to the Admin role.
Dashboard Metrics
Endpoint:GET /api/reports/dashboardAuth: Required — Admin role only (
authorizeRoles(1))Query params:
startDate and endDate (optional, format YYYY-MM-DD)
The endpoint executes seven queries in parallel via Promise.all and returns all results in a single JSON envelope:
| Key | Source function | Description |
|---|---|---|
summary | getDashboardSummary | Headline KPIs filtered by date range |
metrics | getAdminMetrics | Absolute counts not tied to the date filter |
salesByDay | getSalesByDay | Daily revenue and order count for charting |
topProducts | getTopProducts | Top 8 products by units sold |
ordersByStatus | getOrdersByStatus | Order count grouped by status |
salesByCategory | getSalesByCategory | Revenue and units sold per category |
recentOrders | getRecentOrders | Latest 8 orders regardless of date filter |
Available Metrics
Thesummary object contains the four headline KPIs shown at the top of the dashboard. All figures exclude cancelled orders and respect the active date filter:
ventas_estimadas— total estimated revenue (SUM(total)) in the periodtotal_pedidos— total number of non-cancelled orders placedticket_promedio— average order value (AVG(total))clientes_atendidos— count of distinct customers who placed orders
metrics object provides absolute operational counts that are always current and are not affected by the date filter:
orders_today— non-cancelled orders placed todaytotal_customers— total registered customer accounts (id_rol = 3)active_products— products withactivo = TRUEactive_orders— orders currently in status Pendiente, En preparación, or Listo (id_estado 1–3)
Charts
The dashboard exposes three data sets designed for visual rendering: Daily sales bar chart —salesByDayEach entry contains
fecha (date), total_pedidos (order count), and ventas (revenue). Ordered chronologically, this powers the daily sales trend bar chart on the dashboard.
Top products table — topProductsReturns up to 8 products ranked by
cantidad_vendida (units sold), each with id_producto, nombre, categoria, cantidad_vendida, and total_vendido. Displayed as a ranked table to surface best-sellers.
Sales by category — salesByCategoryEach entry contains
id_categoria, categoria, total_vendido, and cantidad_vendida. Designed to power a pie or donut chart showing the revenue contribution of each menu category.
Date Filtering
All date-sensitive queries (summary, salesByDay, topProducts, ordersByStatus, salesByCategory) accept optional startDate and endDate query parameters. When omitted, the queries return data across all time.
Sample API Response
Access Control
The reports endpoint is restricted toid_rol = 1 (Admin) via the authorizeRoles(1) middleware. Operators and Customers will receive a 403 Forbidden response if they attempt to call this endpoint.
Recent Orders
TherecentOrders dataset always returns the 8 most recently created orders regardless of any date filter applied to the rest of the dashboard. Each entry includes the customer name and email, order status label (estado), order type, total value, and item count, making it suitable for a quick operational glance at current activity without leaving the dashboard view.