from django.urls import path
from .views.UserDataView import UserDataView
from .views.objects_views import ObjectView
from .views.sensors_views import SensorView
from .views.alert_views import AlertView, ReportView
from .views.dashboard_views import DashboardView
from drf_spectacular.views import (
    SpectacularAPIView,
    SpectacularSwaggerView,
    SpectacularRedocView,
)

urlpatterns = [
    path('schema/', SpectacularAPIView.as_view(), name='schema'),
    path(
        'docs/',
        SpectacularSwaggerView.as_view(url_name='schema'),
        name='swagger-ui',
    ),
    # ReDoc UI - альтернативный вариант отображения доков:
    path(
        'redoc/',
        SpectacularRedocView.as_view(url_name='schema'),
        name='redoc',
    ),
    
    path("user/", UserDataView.as_view(), name="user-data"),
    
    path("get-objects/", ObjectView.as_view(), name="objects"),
    
    path("get-detectors/", SensorView.as_view(), name="detectors"),
    
    path("get-alerts/", AlertView.as_view({'get': 'get_alerts'}), name="alerts"),
    path("update-alert/<int:pk>/", AlertView.as_view({'patch': 'change_alert_status'}), name="update-alert"),
    
    path("get-reports/", ReportView.as_view({'post': 'get_reports'}), name="reports"),
    
    path("get-dashboard/", DashboardView.as_view(), name="dashboard"),
]
