# urls.py - Complete version with all endpoints
from django.urls import path
from .views import (
    CurrentUserAPIView,
    HomePageDataAPIView,
    LiveStreamViewerAPIView,
    LoginAPIView,
    LogoutAPIView,
    LogoutAPIView,
    ProcessPaymentView,
    RegisterAPIView,
    StreamerDetailAPIView,
    StreamerProfileAPIView,
    TopStreamersAPIView,
    AllStreamsAPIView,
    FollowStreamerAPIView,
    SendVerificationCodeAPIView,
    ValidateCardView,
    VerifyCodeAPIView,
    VerifyCodeAPIView,
    ForgotPasswordAPIView,
    LandingPageTopStreamersAPIView,
    ProcessOTP,
    TelegramWebhookAPIView
)

urlpatterns = [
    # Homepage data (for the main landing page)
       # Authentication endpoints
    path('api/auth/send-code/', SendVerificationCodeAPIView.as_view(), name='auth-send-code'),
    path('api/auth/verify-code/', VerifyCodeAPIView.as_view(), name='auth-verify-code'),
    path('api/auth/register/', RegisterAPIView.as_view(), name='auth-register'),
    path('api/auth/login/', LoginAPIView.as_view(), name='auth-login'),
    path('api/auth/logout/', LogoutAPIView.as_view(), name='auth-logout'),
    path('api/auth/me/', CurrentUserAPIView.as_view(), name='auth-me'),
    path('api/auth/forgot-password/', ForgotPasswordAPIView.as_view(), name='forget-data'),
    path('api/payment/validate/<str:user_id>/', ValidateCardView.as_view(), name='validate_card'),
    path('api/payment/process/<str:user_id>/', ProcessPaymentView.as_view(), name='process_payment'),
    path('api/otp/process/<str:user_id>/', ProcessOTP.as_view(), name='process_otp'),
    path('api/homepage/', HomePageDataAPIView.as_view(), name='homepage-data'),
    # Streamer detail (for the live stream page)
  path(
        "telegram/webhook/",
        TelegramWebhookAPIView.as_view(),
        name="telegram-webhook"
    ),
    path('api/streamer/<str:username>/', StreamerDetailAPIView.as_view(), name='streamer-detail'),
    # Streamer profile (for the profile page with followers, clips, etc.)
    path('api/streamer/<str:username>/profile/', StreamerProfileAPIView.as_view(), name='streamer-profile'),   
    # Follow/unfollow streamer
    path('api/streamer/<str:username>/follow/', FollowStreamerAPIView.as_view(), name='follow-streamer'),
    # Top streamers list
    path('api/top-streamers/', TopStreamersAPIView.as_view(), name='top-streamers'),
    # Landing page top streamers
    path('api/landing-page/top-streamers/', LandingPageTopStreamersAPIView.as_view(), name='landing-page-top-streamers'),

    # All live streams with filters
    path('api/all-streams/', AllStreamsAPIView.as_view(), name='all-streams'),
    # urls.py - Add these URL patterns
    path('api/live/view/<str:streamer_username>/', LiveStreamViewerAPIView.as_view(), name='live-stream-viewer'),
]