Files
bakery-ia/shared
Urtzi Alfaro 4418ff0876 Add forecasting demand insights trigger + fix RabbitMQ cleanup
Issue 1: Forecasting demand insights not triggered in demo workflow
- Created internal ML endpoint: /forecasting/internal/ml/generate-demand-insights
- Added trigger_demand_insights_internal() to ForecastServiceClient
- Integrated forecasting insights into demo session post-clone workflow
- Now triggers 4 AI insight types: price, safety stock, yield, + demand

Issue 2: RabbitMQ client cleanup error in procurement service
- Fixed: rabbitmq_client.close() → rabbitmq_client.disconnect()
- Added proper cleanup in exception handler
- Error: "'RabbitMQClient' object has no attribute 'close'"

Files modified:
- services/forecasting/app/api/ml_insights.py (new internal_router)
- services/forecasting/app/main.py (register internal router)
- shared/clients/forecast_client.py (new trigger method)
- services/demo_session/app/services/clone_orchestrator.py (+ demand insights)
- services/procurement/app/api/internal_demo.py (fix disconnect)

Expected impact:
- Demo sessions will now generate demand forecasting insights
- No more RabbitMQ cleanup errors in logs
- AI insights count should increase from 1 to 2-3 per session

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-16 11:28:04 +01:00
..
2025-12-13 23:57:54 +01:00
2025-12-14 16:04:16 +01:00
2025-12-13 23:57:54 +01:00
2025-12-13 23:57:54 +01:00
2025-12-15 21:14:22 +01:00
2025-12-13 23:57:54 +01:00
2025-12-13 23:57:54 +01:00
2025-12-14 19:05:37 +01:00
2025-12-13 23:57:54 +01:00
2025-12-13 23:57:54 +01:00
2025-12-13 23:57:54 +01:00
2025-12-13 23:57:54 +01:00
2025-12-13 23:57:54 +01:00
2025-12-13 23:57:54 +01:00
2025-12-15 21:14:22 +01:00
2025-12-13 23:57:54 +01:00
2025-12-13 23:57:54 +01:00
2025-12-13 23:57:54 +01:00