from django.urls import path
from accounts.views import (
    CSRFTokenView, RegisterView, LoginView, LogoutView,
    VerifyEmailView, ResendVerificationView, PasswordResetRequestView,
    PasswordResetConfirmView, MeView, ChangeUsernameView, ChangeEmailView,
    DeleteAccountView, SessionsView, RevokeOtherSessionsView, ChangePasswordView,
    BlockedDomainsView, BlockedDomainDetailView, MeWarningView, SuggestedUsersView,
    PublicUserProfileView
)

urlpatterns = [
    # Auth
    path('auth/csrf/', CSRFTokenView.as_view(), name='auth_csrf'),
    path('auth/register/', RegisterView.as_view(), name='auth_register'),
    path('auth/login/', LoginView.as_view(), name='auth_login'),
    path('auth/logout/', LogoutView.as_view(), name='auth_logout'),
    path('auth/verify-email/', VerifyEmailView.as_view(), name='auth_verify_email'),
    path('auth/resend-verification/', ResendVerificationView.as_view(), name='auth_resend_verification'),
    path('auth/password-reset/', PasswordResetRequestView.as_view(), name='auth_password_reset'),
    path('auth/password-reset/confirm/', PasswordResetConfirmView.as_view(), name='auth_password_reset_confirm'),

    # Me & Username
    path('me/', MeView.as_view(), name='me'),
    path('me/username/', ChangeUsernameView.as_view(), name='change_username'),
    path('me/email/', ChangeEmailView.as_view(), name='change_email'),
    path('me/delete/', DeleteAccountView.as_view(), name='delete_account'),
    path('me/sessions/', SessionsView.as_view(), name='sessions'),
    path('me/sessions/revoke-others/', RevokeOtherSessionsView.as_view(), name='revoke_other_sessions'),
    path('me/password/', ChangePasswordView.as_view(), name='change_password'),
    path('me/warning/', MeWarningView.as_view(), name='me_warning'),
    path('me/suggestions/', SuggestedUsersView.as_view(), name='suggested_users'),

    # Public Profile View
    path('users/<str:username>/profile/', PublicUserProfileView.as_view(), name='public_user_profile'),

    # Blocked domains (staff policy)
    path('staff/policies/domains/', BlockedDomainsView.as_view(), name='staff_blocked_domains'),
    path('staff/policies/domains/<int:pk>/', BlockedDomainDetailView.as_view(), name='staff_blocked_domain_detail'),
]
