Package com.deusto.coffeestack.service
Class StockServiceImpl
java.lang.Object
com.deusto.coffeestack.service.StockServiceImpl
- All Implemented Interfaces:
StockService
-
Constructor Summary
ConstructorsConstructorDescriptionStockServiceImpl(InsumoRepository insumoRepository, LoteRepository loteRepository, EstimacionConsumoService estimacionConsumoService) -
Method Summary
Modifier and TypeMethodDescriptiongetCoberturaTodosInsumos(int ventanaDias) Returns the estimated coverage days for every registered insumo.getStockDetalladoPorInsumo(Long insumoId) Returns the detailed stock for a single insumo, including its batch breakdown.Returns the stock summary for every registered insumo.
-
Constructor Details
-
StockServiceImpl
public StockServiceImpl(InsumoRepository insumoRepository, LoteRepository loteRepository, EstimacionConsumoService estimacionConsumoService)
-
-
Method Details
-
getStockDetalladoPorInsumo
Description copied from interface:StockServiceReturns the detailed stock for a single insumo, including its batch breakdown.- Specified by:
getStockDetalladoPorInsumoin interfaceStockService- Parameters:
insumoId- the ID of the insumo- Returns:
- stock detail with lote breakdown and shortage risk flag
-
getStockTodosInsumos
Description copied from interface:StockServiceReturns the stock summary for every registered insumo.- Specified by:
getStockTodosInsumosin interfaceStockService
-
getCoberturaTodosInsumos
@Transactional(readOnly=true) public List<CoberturaInsumoResponse> getCoberturaTodosInsumos(int ventanaDias) Description copied from interface:StockServiceReturns the estimated coverage days for every registered insumo.Coverage days = total stock / average daily consumption computed over the given
ventanaDiaswindow. If consumption is zero the result isDouble.POSITIVE_INFINITYand the risk level is set toOK.- Specified by:
getCoberturaTodosInsumosin interfaceStockService- Parameters:
ventanaDias- sampling window in days (must be >= 1)
-