from django.urls import path
from pxy_dashboard.apps.views import (
    # Existing
    apps_calendar_view,
    apps_chat_view,
    apps_email_inbox_view,
    apps_email_read,
    apps_tasks,
    apps_tasks_details,
    apps_kanban_board,
    apps_file_manager,

    # New – Waste Collection (Pre-Operation)
    #apps_zone_definition,
    zone_definition_view,
    #apps_route_optimization,
    route_optimization_view,
    #apps_dispatch_plan,
    dispatch_plan_view,

    # New – Operation
    apps_urban_digital_twin,
    apps_whatsapp_bot,
    apps_telegram_bot,
    apps_facebook_pages_bot,
    apps_feedback_loop,

    # New – Post-Operation
    apps_route_analytics,
    apps_feedback_review,
    apps_twin_refinement,

    # New – System Control
    apps_sync_monitor,
    apps_logs_webhooks,
    apps_logs_parsing,
    apps_logs_limits,
    apps_config_api,
    apps_config_map,
    apps_config_collection,

    apps_sites_runs,          # ← add
    apps_sites_viewer,        # ← add    
    apps_sami_explorer,   # ← add
)

app_name = "apps"

urlpatterns = [
    # Existing
    path("calendar", apps_calendar_view, name="calendar"),
    path("chat", apps_chat_view, name="chat"),
    path("email-inbox", apps_email_inbox_view, name="email-inbox"),
    path("email-read", apps_email_read, name="email-read"),
    path("tasks", apps_tasks, name="tasks"),
    path("tasks-details", apps_tasks_details, name="tasks-details"),
    path("kanban-board", apps_kanban_board, name="kanban"),
    path("file-manager", apps_file_manager, name="file-manager"),

    # Pre-Operation
    #path("zone-definition", apps_zone_definition, name="zone-definition"),
    path("zone-definition", zone_definition_view, name="zone-definition"),
    #path("route-optimization", apps_route_optimization, name="route-optimization"),
    path("route-optimization", route_optimization_view, name="route-optimization"),
    path("dispatch-plan", dispatch_plan_view, name="dispatch-plan"),

    # Operation
    path("urban-digital-twin", apps_urban_digital_twin, name="urban-digital-twin"),
    path("bot-whatsapp", apps_whatsapp_bot, name="bot-whatsapp"),
    path("bot-telegram", apps_telegram_bot, name="bot-telegram"),
    path("bot-facebook", apps_facebook_pages_bot, name="bot-facebook"),
    path("feedback-loop", apps_feedback_loop, name="feedback-loop"),

    # Post-Operation
    path("route-analytics", apps_route_analytics, name="route-analytics"),
    path("feedback-review", apps_feedback_review, name="feedback-review"),
    path("twin-refinement", apps_twin_refinement, name="twin-refinement"),

    # System Control
    path("sync-monitor", apps_sync_monitor, name="sync-monitor"),
    path("logs-webhooks", apps_logs_webhooks, name="logs-webhooks"),
    path("logs-parsing", apps_logs_parsing, name="logs-parsing"),
    path("logs-limits", apps_logs_limits, name="logs-limits"),
    path("config-api", apps_config_api, name="config-api"),
    path("config-map", apps_config_map, name="config-map"),
    path("config-collection", apps_config_collection, name="config-collection"),

        # Sites analytics (new)
    path("sites/runs",   apps_sites_runs,   name="sites-runs"),
    path("sites/viewer", apps_sites_viewer, name="sites-viewer"),

    path("sami/explorer", apps_sami_explorer, name="sami-explorer"),  # ← add
]
