# urls.py
from django.urls import path, include
# from .views import (
#     BusinessRegistrationView,
#     ClientRegistrationView,
#     SystemUserRegistrationView,
#     BusinessLoginView,
#     ClientLoginView,
#     SystemLoginView,
#     BusinessEmailCheckViewSet,
#     ClientEmailCheckViewSet,
#     SystemEmailCheckViewSet,
#     BusinessInfoView,
#     BusinessForgotPasswordView, ClientForgotPasswordView, SystemForgotPasswordView
# )

# from dj_rest_auth.registration.views import RegisterView
# from .serializers import CustomRegisterSerializer

from rest_framework import routers
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

# You can define your API view, or use the router for DRF views
# For example:
# router = routers.DefaultRouter()
# router.register(r'users', UserViewSet)

schema_view = get_schema_view(
   openapi.Info(
      title="My API",
      default_version='v1',
      description="Test description",
      terms_of_service="https://www.google.com/policies/terms/",
      contact=openapi.Contact(email="contact@myapi.local"),
      license=openapi.License(name="MIT License"),
   ),
   public=True,
)


from django.urls import path
from .views import CustomTokenObtainPairView
from rest_framework_simplejwt.views import TokenRefreshView, TokenVerifyView

urlpatterns = [
    # Endpoint to log in and obtain a new token pair (access and refresh tokens)
    path('login/', CustomTokenObtainPairView.as_view(), name='token_obtain_pair'),
    # Endpoint to refresh the access token
    path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
    # Endpoint to verify a token's validity
    path('token/verify/', TokenVerifyView.as_view(), name='token_verify'),
]

from .views import IdentityView
urlpatterns += [
    path('accounts/', include('allauth.urls')),
     path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
    path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),

    path('api/auth/', include('dj_rest_auth.urls')),  # Login, Logout, Password Reset
    path('api/auth/registration/', include('dj_rest_auth.registration.urls')),  # Registration
    path('api/identity/', IdentityView.as_view(), name='identity'),
    # path('auth/registration/', RegisterView.as_view(serializer_class=CustomRegisterSerializer), name='custom_registration'),

]

# urlpatterns = [
#     path('register/business/', BusinessRegistrationView.as_view(), name='business_register'),
#     path('register/client/', ClientRegistrationView.as_view(), name='client_register'),
#     path('register/system/', SystemUserRegistrationView.as_view(), name='system_register'),
# ]

# urlpatterns += [
#     path('login/business/', BusinessLoginView.as_view(), name='business_login'),
#     path('login/client/', ClientLoginView.as_view(), name='client_login'),
#     path('login/system/', SystemLoginView.as_view(), name='system_login'),
#     path('accounts/', include('allauth.urls')),
# ]


# urlpatterns += [
#     path('check-email/business/', 
#          BusinessEmailCheckViewSet.as_view({'post': 'create'}), 
#          name='check_email_business'),
#     path('check-email/client/', 
#          ClientEmailCheckViewSet.as_view({'post': 'create'}), 
#          name='check_email_client'),
#     path('check-email/system/', 
#          SystemEmailCheckViewSet.as_view({'post': 'create'}), 
#          name='check_email_system'),
#     path('business/info/', BusinessInfoView.as_view(), name='business_info'),
# ]

# from dj_rest_auth.views import PasswordResetConfirmView
# from .views import CustomVerifyEmailView

# urlpatterns += [
#     path('password/forgot/business/', BusinessForgotPasswordView.as_view(), name='business_forgot_password'),
#     path('password/forgot/client/', ClientForgotPasswordView.as_view(), name='client_forgot_password'),
#     path('password/forgot/system/', SystemForgotPasswordView.as_view(), name='system_forgot_password'),
#     # path('auth/password/reset/confirm/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
#     path('password/reset/confirm/<uidb64>/<token>/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
#     path('verify-email/', CustomVerifyEmailView.as_view(), name='custom_verify_email'), 
# ]


# from .views import GetUserByUidView

# urlpatterns += [
#     # URL for retrieving user details by UID
#     path('get-user-by-uid/', GetUserByUidView.as_view(), name='get_user_by_uid'),
# ]


# from .views import CustomTokenRefreshView

# urlpatterns += [
#     # Other paths...
#     path('token/refresh/', CustomTokenRefreshView.as_view(), name='token_refresh'),
# ]

# ## Dev urls
# from rest_framework.routers import DefaultRouter  # Import the router

# router = DefaultRouter()

# # Register the BusinessViewSet with the router
# from .views import *
# router.register(r'businesses', BusinessViewSet)
# router.register(r'businesssettings', BusinessSettingsViewSet, basename="businesssettings")
# router.register(r'countries', CountryInfoViewSet, basename='country-info')

# from .views import BusinessViewSet
# urlpatterns += [
#     # Other paths...
#     path('dev/', include(router.urls)),
# ]