from django.urls import path
from . import views

app_name = 'customers'

urlpatterns = [
    path('', views.customer_list, name='customer-list'),
    path('create/', views.customer_create, name='customer-create'),
    path('import/', views.customer_import, name='customer-import'),
    path('import/download-errors/', views.customer_import_download_errors, name='customer-import-download-errors'),
    path('export/', views.customer_export, name='customer-export'),
    path('<int:pk>/', views.customer_detail, name='customer-detail'),
    path('<int:pk>/delete/', views.customer_delete, name='customer-delete'),
    path('<int:pk>/wallet/deposit/', views.wallet_deposit, name='wallet-deposit'),
    path('<int:pk>/wallet/withdraw/', views.wallet_withdraw, name='wallet-withdraw'),

    # Contact channels
    path('<int:customer_pk>/channels/add/', views.add_contact_channel, name='add-contact-channel'),
    path('channels/<int:pk>/delete/', views.delete_contact_channel, name='delete-contact-channel'),

    # AJAX API endpoints
    path('api/search/', views.api_search_customers, name='api-search-customers'),
    path('api/create/', views.api_create_customer, name='api-create-customer'),
    path('api/system/', views.api_get_system_customer, name='api-get-system-customer'),
    path('<int:pk>/api/update/', views.api_update_customer, name='api-update-customer'),
]