Class StockServiceImpl

java.lang.Object
com.deusto.coffeestack.service.StockServiceImpl
All Implemented Interfaces:
StockService

@Service public class StockServiceImpl extends Object implements StockService
  • Constructor Details

  • Method Details

    • getStockDetalladoPorInsumo

      @Transactional(readOnly=true) public StockInsumoResponse getStockDetalladoPorInsumo(Long insumoId)
      Description copied from interface: StockService
      Returns the detailed stock for a single insumo, including its batch breakdown.
      Specified by:
      getStockDetalladoPorInsumo in interface StockService
      Parameters:
      insumoId - the ID of the insumo
      Returns:
      stock detail with lote breakdown and shortage risk flag
    • getStockTodosInsumos

      @Transactional(readOnly=true) public List<StockInsumoResponse> getStockTodosInsumos()
      Description copied from interface: StockService
      Returns the stock summary for every registered insumo.
      Specified by:
      getStockTodosInsumos in interface StockService
    • getCoberturaTodosInsumos

      @Transactional(readOnly=true) public List<CoberturaInsumoResponse> getCoberturaTodosInsumos(int ventanaDias)
      Description copied from interface: StockService
      Returns the estimated coverage days for every registered insumo.

      Coverage days = total stock / average daily consumption computed over the given ventanaDias window. If consumption is zero the result is Double.POSITIVE_INFINITY and the risk level is set to OK.

      Specified by:
      getCoberturaTodosInsumos in interface StockService
      Parameters:
      ventanaDias - sampling window in days (must be >= 1)