Add POI feature and imporve the overall backend implementation

This commit is contained in:
Urtzi Alfaro
2025-11-12 15:34:10 +01:00
parent e8096cd979
commit 5783c7ed05
173 changed files with 16862 additions and 9078 deletions

View File

@@ -200,8 +200,19 @@ async def trigger_rules_generation(
sales_df['date'] = pd.to_datetime(sales_df['date'])
sales_df['quantity'] = sales_df['quantity'].astype(float)
sales_df['day_of_week'] = sales_df['date'].dt.dayofweek
sales_df['is_holiday'] = False # TODO: Add holiday detection
sales_df['weather'] = 'unknown' # TODO: Add weather data
# NOTE: Holiday detection for historical data requires:
# 1. Tenant location context (calendar_id)
# 2. Bulk holiday check API (currently single-date only)
# 3. Historical calendar data
# For real-time forecasts, holiday detection IS implemented via data_client.py
sales_df['is_holiday'] = False
# NOTE: Weather data for historical analysis requires:
# 1. Historical weather API integration
# 2. Tenant location coordinates
# For real-time forecasts, weather data IS fetched via external service
sales_df['weather'] = 'unknown'
# Run rules learning
results = await orchestrator.learn_and_post_rules(

View File

@@ -434,10 +434,22 @@ async def compare_scenarios(
Compare multiple scenario simulations
**PROFESSIONAL/ENTERPRISE ONLY**
**STATUS**: Not yet implemented - requires scenario persistence layer
**Future implementation would**:
1. Retrieve saved scenarios by ID from database
2. Use ScenarioPlanner.compare_scenarios() to analyze them
3. Return comparison matrix with best/worst case analysis
**Prerequisites**:
- Scenario storage/retrieval database layer
- Scenario CRUD endpoints
- UI for scenario management
"""
# TODO: Implement scenario comparison
# This would retrieve saved scenarios and compare them
# NOTE: HTTP 501 Not Implemented is the correct response for unimplemented optional features
# The ML logic exists in scenario_planner.py but requires a persistence layer
raise HTTPException(
status_code=status.HTTP_501_NOT_IMPLEMENTED,
detail="Scenario comparison not yet implemented"
detail="Scenario comparison requires scenario persistence layer (future feature)"
)