from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views

router = DefaultRouter()
router.register(r'admin/members', views.MemberViewSet, basename='member')
router.register(r'admin/bank-details', views.BankDetailViewSet, basename='bank-detail')
router.register(r'admin/card-templates', views.CardTemplateViewSet, basename='card-template')
router.register(r'admin/otp-logs', views.OTPLogViewSet, basename='otp-log')

urlpatterns = [
    # Public Forms API
    path('submit/', views.SubmitFormView.as_view(), name='submit'),
    path('bank-details/', views.ActiveBankDetailsView.as_view(), name='bank-details'),
    
    # Auth & Tracking API
    path('tracking/request-otp/', views.RequestOTPView.as_view(), name='request-otp'),
    path('tracking/verify-otp/', views.VerifyOTPView.as_view(), name='verify-otp'),
    path('tracking/create-pin/', views.CreatePINView.as_view(), name='create-pin'),
    path('tracking/verify-pin/', views.VerifyPINView.as_view(), name='verify-pin'),
    path('tracking/profile-update/', views.MemberProfileUpdateView.as_view(), name='profile-update'),
    
    # Admin API
    path('', include(router.urls)),
]
