from django.urls import path
from . import views

app_name = 'dashboard'

urlpatterns = [
    # Auth
    path('login/',  views.dashboard_login,  name='login'),
    path('logout/', views.dashboard_logout, name='logout'),

    # Home
    path('', views.dashboard_home, name='home'),

    # Products
    path('products/',                    views.product_list,   name='product_list'),
    path('products/add/',                views.product_add,    name='product_add'),
    path('products/<int:pk>/edit/',      views.product_edit,   name='product_edit'),
    path('products/<int:pk>/delete/',    views.product_delete, name='product_delete'),
    path('products/<int:pk>/toggle/',    views.product_toggle, name='product_toggle'),

    # Categories
    path('categories/',                  views.category_list,   name='category_list'),
    path('categories/add/',              views.category_add,    name='category_add'),
    path('categories/<int:pk>/edit/',    views.category_edit,   name='category_edit'),
    path('categories/<int:pk>/delete/',  views.category_delete, name='category_delete'),

    # Orders
    path('orders/',             views.order_list,   name='order_list'),
    path('orders/<int:pk>/',    views.order_detail, name='order_detail'),

    # Customers
    path('customers/',          views.customer_list,   name='customer_list'),
    path('customers/<int:pk>/', views.customer_detail, name='customer_detail'),

    # Coupons
    path('coupons/',                 views.coupon_list,   name='coupon_list'),
    path('coupons/add/',             views.coupon_add,    name='coupon_add'),
    path('coupons/<int:pk>/edit/',   views.coupon_edit,   name='coupon_edit'),
    path('coupons/<int:pk>/delete/', views.coupon_delete, name='coupon_delete'),

    # Reviews
    path('reviews/',                    views.review_list,   name='review_list'),
    path('reviews/<int:pk>/toggle/',    views.review_toggle, name='review_toggle'),
    path('reviews/<int:pk>/delete/',    views.review_delete, name='review_delete'),

    # Analytics
    path('analytics/', views.analytics, name='analytics'),

    # Staff Management (Superadmin)
    path('staff/',                    views.staff_list,   name='staff_list'),
    path('staff/create/',             views.staff_create, name='staff_create'),
    path('staff/<int:pk>/edit/',      views.staff_edit,   name='staff_edit'),
    path('staff/<int:pk>/delete/',    views.staff_delete, name='staff_delete'),
    path('staff/<int:pk>/toggle/',    views.staff_toggle, name='staff_toggle'),

    # Activity Log
    path('activity/', views.activity_log, name='activity_log'),
    path('site_settings/', views.site_settings, name='site_settings'),

    # Settings
    path('settings/', views.my_settings, name='settings'),
]
