The Sales Reports API lets you create and manage sales reports for each Don Mamino bakery location. Each report captures the total sales figure for a given period and is automatically timestamped when created. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/luisllatas-dev/Proyecto_Pasteleria_DonMamino/llms.txt
Use this file to discover all available pages before exploring further.
fecha_reporte field is set by the database at insert time and does not need to be provided in request bodies. All five endpoints require a valid JWT Bearer token.
GET /api/reportes-ventas
Returns a list of all sales reports across all bakery locations. Auth required: YesResponse fields
Unique identifier for the sales report.
Timestamp of when the report was created. Set automatically by the database (
DATETIME DEFAULT CURRENT_TIMESTAMP). Format: YYYY-MM-DD HH:MM:SS.Total sales amount for the reported period, as a decimal value (e.g.,
1500.75).ID of the bakery location this report belongs to. References the
Sedes table.Example response
GET /api/reportes-ventas/:id
Returns a single sales report by its unique ID. Auth required: YesPath parameters
The
id_reporte of the report to retrieve.Response fields
Unique identifier for the sales report.
Timestamp of when the report was created. Format:
YYYY-MM-DD HH:MM:SS.Total sales amount for the reported period.
ID of the bakery location this report belongs to.
Example response
Error responses
| Status | Description |
|---|---|
404 | No report found with the given ID. Response body: { "message": "Reporte no encontrado" } |
500 | Internal server error. |
POST /api/reportes-ventas
Creates a new sales report for a bakery location. Thefecha_reporte timestamp is set automatically by the database.
Auth required: Yes
Request body
Total sales amount for the period being reported. Accepts up to two decimal places (e.g.,
1500.75).ID of the bakery location this report covers. Must reference an existing record in the
Sedes table.Response fields
The auto-generated
id_reporte of the newly created report.Confirmation message:
"Reporte creado exitosamente".You do not need to provide
fecha_reporte in the request body. The database sets it automatically to the current timestamp at the moment of insertion.Example response
PUT /api/reportes-ventas/:id
Updates thetotal_ventas and id_sede fields of an existing sales report. Both body fields must be provided.
Auth required: Yes
Path parameters
The
id_reporte of the report to update.Request body
Updated total sales amount.
Updated bakery location ID for this report.
Response fields
Confirmation message:
"Reporte actualizado exitosamente".Example response
Error responses
| Status | Description |
|---|---|
404 | No report found with the given ID. Response body: { "message": "Reporte no encontrado" } |
500 | Internal server error. |
DELETE /api/reportes-ventas/:id
Permanently deletes a sales report. Auth required: YesPath parameters
The
id_reporte of the report to delete.Response fields
Confirmation message:
"Reporte eliminado exitosamente".Example response
Error responses
| Status | Description |
|---|---|
404 | No report found with the given ID. Response body: { "message": "Reporte no encontrado" } |
500 | Internal server error. |