from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    RegisterView, VerifyEmailView, LoginView, MeView,
    RegistrationDomainRuleViewSet, RegistrationRestrictionSettingView,
    PendingUsersView, ApproveUserView, AdminUserViewSet,
    GenerateClaimLinkView, ClaimInfoView,
    SMTPSettingView, TestSMTPEmailView, UserListView
)

router = DefaultRouter()
router.register('domain-rules', RegistrationDomainRuleViewSet, basename='domain-rule')
router.register('manage-users', AdminUserViewSet, basename='admin-user')

urlpatterns = [
    path('register/', RegisterView.as_view(), name='register'),
    path('verify-email/', VerifyEmailView.as_view(), name='verify-email'),
    path('login/', LoginView.as_view(), name='login'),
    path('me/', MeView.as_view(), name='me'),
    path('all/', UserListView.as_view(), name='all-users'),
    path('restriction-setting/', RegistrationRestrictionSettingView.as_view(), name='restriction-setting'),
    path('smtp-setting/', SMTPSettingView.as_view(), name='smtp-setting'),
    path('smtp-setting/test/', TestSMTPEmailView.as_view(), name='smtp-setting-test'),
    path('pending/', PendingUsersView.as_view(), name='pending-users'),
    path('<int:user_id>/approve/', ApproveUserView.as_view(), name='approve-user'),
    path('signups/<int:signup_id>/generate-claim-link/', GenerateClaimLinkView.as_view(), name='generate-claim-link'),
    path('claim-info/<uuid:token_uuid>/', ClaimInfoView.as_view(), name='claim-info'),
    path('', include(router.urls)),
]
