TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JoseOlivares19/Proyecto-PC3-JavaScript-Avanzado/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/productos endpoint returns every product row persisted in the SmartStock360 MySQL database via Spring Data JPA. Clients receive a JSON array of Producto objects, each carrying all the operational and merchandising attributes that feed the AI demand-prediction model — making this endpoint the natural starting point for any dashboard, report, or prediction workflow.
Endpoint
| Property | Value |
|---|---|
| Method | GET |
| Path | /api/productos |
| Base URL | http://localhost:8080 |
| Full URL | http://localhost:8080/api/productos |
| CORS | All origins (*) |
| Auth | None |
Request Parameters
This endpoint accepts no query parameters, path variables, or request body.Response
Returns an HTTP200 OK with a JSON array. Each element of the array is a Producto object sourced directly from the JPA repository.
Producto Object Fields
Auto-generated primary key assigned by MySQL (
IDENTITY generation strategy). Uniquely identifies each product across all API calls.Human-readable product name (e.g.
"Laptop Dell XPS 13"). Used for display in dashboards and CSV exports.Unit price of the product in local currency. Passed directly to the AI prediction model as a feature.
Number of units currently held in inventory. A value of
0 indicates an out-of-stock condition.Total units sold over the preceding 7-day rolling window. Used as a short-term velocity signal by the prediction model.
Active discount applied to the product, expressed as an integer percentage.
0 means no active promotion.Encoded season or demand-period indicator:
| Value | Meaning |
|---|---|
0 | Normal / off-peak |
1 | Campaña (promotional period) |
2 | Feriado / alta demanda |
Number of calendar days elapsed since the last stock replenishment event. High values can signal a supply-chain risk flag in the AI model.
Customer rating for the product on a scale of
1.0 to 5.0. Influences demand predictions by weighting customer satisfaction signals.Examples
Example Response
@CrossOrigin(origins = "*") is configured on this controller, meaning any origin can call this endpoint from a browser. This is convenient during local development and demo environments, but you should restrict this to trusted domains (e.g. your frontend’s production URL) before deploying to production to prevent unauthorized cross-origin access.