SS Restaurant includes a built-in PDF reporting engine powered by PDFKit. Reports are generated server-side, stored asDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/FloresJesus/SS_RESTAURANT/llms.txt
Use this file to discover all available pages before exploring further.
.pdf files in the Backend/reports/ directory, and made available for download via a dedicated endpoint. Every report is scoped to admin role — the routes are protected and each generation is written to the audit log. The GET /api/reports/tipos endpoint returns the complete list of valid report types so that client applications can build dynamic report menus without hard-coding values.
Available report types
The engine supports exactly 10 report types. Each type has an internalvalue (used in the API) and a human-readable label (returned by /api/reports/tipos and used as the PDF title).
value | label | Primary date parameters |
|---|---|---|
ventas_diarias | Ventas Diarias | fecha |
ventas_periodo | Ventas por Periodo | fecha_inicio, fecha_fin |
productos_mas_vendidos | Productos Más Vendidos | fecha_inicio, fecha_fin |
ventas_por_categoria | Ventas por Categoría | fecha_inicio, fecha_fin |
ocupacion_mesas | Ocupación de Mesas | fecha_inicio, fecha_fin |
rendimiento_meseros | Rendimiento de Meseros | fecha_inicio, fecha_fin |
historial_pedidos | Historial de Pedidos | fecha_inicio, fecha_fin |
historial_pagos | Historial de Pagos | fecha_inicio, fecha_fin |
reservas | Reservas | fecha_inicio, fecha_fin |
cierre_caja | Cierre de Caja | fecha |
All PDF files are written to
Backend/reports/ on the server. The filename pattern is {tipo}_{unix_timestamp}.pdf, for example ventas_diarias_1721433600000.pdf.Generating a report
tipo against the list of 10 known values and returns 400 for any unknown type.
- ventas_diarias
- ventas_periodo
- productos_mas_vendidos
- cierre_caja
Generates a one-day sales summary showing total orders, total revenue, and a breakdown by payment method.If
fecha is omitted, the report defaults to today’s date.id to download the file.
Downloading a report
Content-Disposition header is set to attachment; filename="{tipo}_{id}.pdf".
If the database record exists but the PDF file has been deleted from disk, the endpoint returns 404 Archivo PDF no encontrado.
Listing reports
tipo query parameter to filter by report type. The parametros field is returned as a parsed JSON object.
Deleting a report
Backend/reports/. If the file no longer exists on disk, the deletion proceeds without error (the file is simply skipped).
Querying available types
PDF structure
Every generated PDF follows the same layout regardless of type:- Header — Restaurant name (from the
configuraciontable), address, phone, and NIT centred at the top, followed by the report title and the period covered. - Generated timestamp — Printed below the header in the server’s locale (
es-BO). - Data table — PDFKit renders a bordered table with alternating shaded header row. Long tables automatically paginate, repeating the column headers on each new page.
- Totals footer — A bold
Total Generalline right-aligned below the table (where applicable). - Page number — Printed at the bottom of each page.