Class StockController
java.lang.Object
com.deusto.coffeestack.controller.StockController
REST controller for stock consultation.
Endpoints:
GET /api/stock/insumos– stock summary for all insumosGET /api/stock/insumos/{id}– stock detail (with lote breakdown) for one insumo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns stock summary (total quantity + shortage flag + lote detail) for every insumo.getCobertura(int ventana) Returns estimated coverage days per insumo, sorted from most critical to safest.getStockByInsumo(Long id) Returns stock detail for a single insumo.
-
Constructor Details
-
StockController
-
-
Method Details
-
getAllStock
Returns stock summary (total quantity + shortage flag + lote detail) for every insumo. -
getStockByInsumo
Returns stock detail for a single insumo. Returns 404 if the insumo does not exist. -
getCobertura
@GetMapping("/cobertura") @PreAuthorize("hasAnyRole(\'PROPIETARIO\',\'ROOT\')") public List<CoberturaInsumoResponse> getCobertura(@RequestParam(defaultValue="30") int ventana) Returns estimated coverage days per insumo, sorted from most critical to safest.Coverage days = total stock / average daily consumption over the given window. Restricted to PROPIETARIO and ROOT roles.
-