# finance/urls.py
from django.urls import path
from . import views

app_name = 'finance'

urlpatterns = [
    # Invoices
    path('invoices/', views.InvoiceListView.as_view(), name='invoice_list'),
    path('invoices/<int:pk>/', views.InvoiceDetailView.as_view(), name='invoice_detail'),
    path('invoices/create/', views.InvoiceCreateView.as_view(), name='invoice_create'),
    path('invoices/<int:pk>/edit/', views.InvoiceUpdateView.as_view(), name='invoice_edit'),
    path('invoices/<int:pk>/delete/', views.InvoiceDeleteView.as_view(), name='invoice_delete'),
    path('invoices/export/', views.export_invoices_csv, name='export_invoices'),    
    # Payments
    path('payments/', views.PaymentListView.as_view(), name='payment_list'),
    path('payments/add/', views.PaymentCreateView.as_view(), name='payment_add'),
    path('payments/<int:pk>/', views.PaymentDetailView.as_view(), name='payment_detail'),
    path('payments/export/', views.export_payments_csv, name='export_payments'),    
    # Fee Structure
    path('fees/', views.FeeStructureListView.as_view(), name='fee_list'),
    path('fees/<int:pk>/', views.FeeStructureDetailView.as_view(), name='fee_detail'),    
    # Reports
    path('reports/', views.FinancialReportsView.as_view(), name='financial_reports'),
    path('reports/generate/', views.generate_financial_report, name='generate_report'),    
    # Bursar Dashboard
    path('bursar/', views.BursarDashboardView.as_view(), name='bursar_dashboard'),    
    # API
    path('api/stats/', views.get_finance_stats, name='finance_stats'),
]