from django.urls import path
from . import views

app_name = 'sales'

urlpatterns = [
    path('', views.sale_list, name='sale_list'),
    path('create/', views.sale_create, name='sale_create'),
    path('<int:pk>/', views.sale_detail, name='sale_detail'),
    path('<int:pk>/cancel/', views.sale_cancel, name='sale_cancel'),
    path('<int:pk>/delete/', views.sale_delete, name='sale_delete'),
    path('<int:pk>/receipt/', views.sale_receipt_pdf, name='sale_receipt'),

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

    # Sales Returns
    path('returns/', views.sales_return_list, name='sales_return_list'),
    path('returns/create/', views.sales_return_create, name='sales_return_create'),
    path('returns/<int:pk>/', views.sales_return_detail, name='sales_return_detail'),
    path('returns/<int:pk>/process/', views.sales_return_process, name='sales_return_process'),

    # Invoices
    path('invoices/', views.invoice_list, name='invoice_list'),
    path('invoices/create/', views.invoice_create, name='invoice_create'),
    path('invoices/<int:pk>/', views.invoice_detail, name='invoice_detail'),
    path('invoices/<int:pk>/payment/', views.invoice_payment, name='invoice_payment'),
    path('invoices/<int:pk>/cancel/', views.invoice_cancel, name='invoice_cancel'),
    path('invoices/<int:pk>/pdf/', views.invoice_pdf, name='invoice_pdf'),

    #csv
    path('export/sales/', views.export_sales_csv, name='export_sales'),
    path('export/sale-items/', views.export_sale_items_csv, name='export_sale_items'),
    path('export/invoices/', views.export_invoices_csv, name='export_invoices'),
]
