crmbackend/crm/urls.py
vickytechkey 05e1a1a149
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 38s
initial commit
2026-08-15 19:22:16 +05:30

38 lines
2.5 KiB
Python

from django.urls import path
from crm.views import auth_views, seller_views, customer_views, product_views, wallet_views
urlpatterns = [
# Auth
path('auth/login/', auth_views.CRMTokenObtainPairView.as_view(), name='token_obtain_pair'),
path('auth/me/', auth_views.get_current_admin, name='current_admin'),
# Sellers
path('sellers/', seller_views.list_sellers, name='list_sellers'),
path('sellers/<int:pk>/', seller_views.get_seller_detail, name='get_seller_detail'),
path('sellers/<int:pk>/documents/', seller_views.get_seller_documents, name='get_seller_documents'),
path('sellers/<int:pk>/approve/', seller_views.approve_seller, name='approve_seller'),
path('sellers/<int:pk>/reject/', seller_views.reject_seller, name='reject_seller'),
path('sellers/<int:pk>/suspend/', seller_views.suspend_seller, name='suspend_seller'),
path('sellers/<int:pk>/reinstate/', seller_views.reinstate_seller, name='reinstate_seller'),
path('sellers/<int:pk>/reset-password/', seller_views.reset_seller_password, name='reset_seller_password'),
# Customers
path('customers/', customer_views.list_customers, name='list_customers'),
path('customers/<int:pk>/', customer_views.get_customer_detail, name='get_customer_detail'),
path('customers/<int:pk>/suspend/', customer_views.suspend_customer, name='suspend_customer'),
path('customers/<int:pk>/ban/', customer_views.ban_customer, name='ban_customer'),
path('customers/<int:pk>/orders/<int:order_id>/payment/', customer_views.get_payment_status, name='get_payment_status'),
path('customers/<int:pk>/orders/<int:order_id>/refund/', customer_views.issue_refund, name='issue_refund'),
path('customers/<int:pk>/orders/<int:order_id>/return-pickup/', customer_views.create_return_pickup, name='create_return_pickup'),
# Products
path('products/', product_views.list_products, name='list_products'),
path('products/<int:pk>/approve/', product_views.approve_product, name='approve_product'),
path('products/<int:pk>/hold/', product_views.hold_product, name='hold_product'),
path('products/<int:pk>/', product_views.delete_product, name='delete_product'),
# Wallet / Withdrawals
path('wallets/withdrawals/', wallet_views.list_withdrawals, name='list_withdrawals'),
path('wallets/withdrawals/<int:pk>/approve/', wallet_views.approve_withdrawal, name='approve_withdrawal'),
path('wallets/withdrawals/<int:pk>/reject/', wallet_views.reject_withdrawal, name='reject_withdrawal'),
]