from django.urls import path
from .views import   CustomerDeviceDetailsView, ToggleCustomerLockView, UpdateCustomerView, CustomerDetailsView, AddCustomerView, ViewCustomerView
from .views import DeleteCustomerView
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.decorators import login_required

urlpatterns = [
    path('add-customer', login_required(csrf_protect(AddCustomerView.as_view())), name='add-customer'),
    path('view-customer/<int:id>', login_required(ViewCustomerView.as_view()), name='view-customer'),
    path('update-customer/<int:id>', login_required(UpdateCustomerView.as_view()), name='update-customer'),
    path('update-customer', login_required(csrf_protect(UpdateCustomerView.as_view())), name='update-customer'),
    path('customer-details', login_required(CustomerDetailsView.as_view()), name='customer-details'),
    path('delete-customer', login_required(csrf_protect(DeleteCustomerView.as_view())), name='delete-customer'),
    path("customer-devices-details/", CustomerDeviceDetailsView.as_view(), name="customer-device-details"),
    path('toggle-customer-lock/<int:customer_id>/', ToggleCustomerLockView.as_view(), name='toggle-customer-lock'),

]