from django.urls import path
from rest_framework_simplejwt.views import TokenRefreshView
from .views import (
    CustomTokenObtainPairView,
    InviteUserView,
    InviteMentorView,
    RegisterView,
    ActivateAccountView,
    ForgotPasswordView,
    ResetPasswordView,
    UserProfileView,
    GlobalStatsView,
    AdminUserListView,
    AdminMentorListView,
    AdminUserDetailView,
    UserDetail360View,
    MentorStatsView,
    MentorStudentListView,
    MentorStudentDetail360View,
)

urlpatterns = [
    # Auth
    path('login/', CustomTokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),

    # Gestion
    path('invite/', InviteUserView.as_view(), name='invite_user'),
    path('invite-mentor/', InviteMentorView.as_view(), name='invite_mentor'),
    path('register/', RegisterView.as_view(), name='register'),
    path('activate/', ActivateAccountView.as_view(), name='activate_account'),
    path('forgot-password/', ForgotPasswordView.as_view(), name='forgot_password'),
    path('reset-password/', ResetPasswordView.as_view(), name='reset_password'),
    path('profile/', UserProfileView.as_view(), name='user_profile'),

    # --- ROUTES ADMIN ---
    path('admin/global-stats/', GlobalStatsView.as_view(), name='global-stats'),
    path('users/', AdminUserListView.as_view(), name='admin-user-list'),
    path('mentors/', AdminMentorListView.as_view(), name='admin-mentor-list'),
    path('users/<int:pk>/', AdminUserDetailView.as_view(), name='admin-user-detail'),

    path('admin/user-detail/<int:pk>/', UserDetail360View.as_view(), name='admin-user-detail-360'),

    # --- ROUTES MENTOR ---
    path('mentor/stats/', MentorStatsView.as_view(), name='mentor-stats'),
    path('mentor/students/', MentorStudentListView.as_view(), name='mentor-student-list'),
    path('mentor/students/<int:pk>/', MentorStudentDetail360View.as_view(), name='mentor-student-detail-360'),
]