Class ContextoNegocioServiceImpl

java.lang.Object
com.deusto.coffeestack.service.ContextoNegocioServiceImpl
All Implemented Interfaces:
ContextoNegocioService

@Service public class ContextoNegocioServiceImpl extends Object implements ContextoNegocioService
Genera un snapshot Markdown con el estado operativo de la cafetería.

El snapshot está pensado para alimentar el contexto de un LLM, por lo que combina dos tipos de secciones:

  • Generales (inventario actual, cobertura, caducidades próximas): casi siempre tienen datos y le dan al modelo algo concreto sobre lo que razonar, incluso cuando todo está sano.
  • Alertas (reposición urgente, riesgo de faltantes, cobertura crítica): muestran solo lo accionable.
  • Constructor Details

    • ContextoNegocioServiceImpl

      @Autowired public ContextoNegocioServiceImpl(ReposicionService reposicionService, StockService stockService, VentaService ventaService, @Value("${ai.chatbot.snapshot-ttl-seconds:300}") long ttlSeconds)
  • Method Details

    • generarSnapshot

      @Transactional(readOnly=true) public String generarSnapshot()
      Description copied from interface: ContextoNegocioService
      Genera el snapshot Markdown a inyectar en el system prompt del LLM.
      Specified by:
      generarSnapshot in interface ContextoNegocioService
      Returns:
      texto Markdown estructurado con secciones ## por área.