from django.urls import path
from . import ui_views, kpi_views, ask_views

app_name = 'analytics'

urlpatterns = [
    # UI Views
    path('dashboard/', ui_views.analytics_dashboard, name='dashboard'),
    path('kpis/', ui_views.kpi_list, name='kpi_list'),
    path('ask-your-data/', ask_views.ask_your_data, name='ask_your_data'),

    # Command Center - Unified Dashboard
    path('command-center/', ui_views.command_center, name='command_center'),
    path('api/command-center/', ui_views.command_center_api, name='command_center_api'),
    path('api/command-center/export/<str:export_format>/', ui_views.export_command_center, name='command_center_export'),

    # AI Analytics API
    path('api/ai-analytics/refresh/', ui_views.refresh_ai_analytics, name='refresh_ai_analytics'),
    path('api/dashboard/refresh-cache/', ui_views.refresh_dashboard_cache, name='refresh_dashboard_cache'),
    path('api/ask-data/query/', ask_views.ask_data_query, name='ask_data_query'),

    # KPI Reports
    path('kpi-reports/', kpi_views.kpi_report_list, name='kpi_report_list'),
    path('kpi-reports/generate/', kpi_views.kpi_report_generate, name='kpi_report_generate'),
    path('kpi-reports/generate/submit/', kpi_views.kpi_report_generate_submit, name='kpi_report_generate_submit'),
    path('kpi-reports/<uuid:report_id>/', kpi_views.kpi_report_detail, name='kpi_report_detail'),
    path('kpi-reports/<uuid:report_id>/pdf/', kpi_views.kpi_report_pdf, name='kpi_report_pdf'),
    path('kpi-reports/<uuid:report_id>/regenerate/', kpi_views.kpi_report_regenerate, name='kpi_report_regenerate'),
    path('api/kpi-reports/<uuid:report_id>/data/', kpi_views.kpi_report_api_data, name='kpi_report_api_data'),
    path('api/kpi-reports/<uuid:report_id>/ai-analysis/', kpi_views.kpi_report_ai_analysis, name='kpi_report_ai_analysis'),
    path('api/kpi-reports/<uuid:report_id>/ai-analysis/save/', kpi_views.kpi_report_save_analysis, name='kpi_report_save_analysis'),
]
