# staff/urls.py
from django.urls import path
from django.contrib.auth import views as auth_views  # ADD THIS IMPORT
from . import views
app_name = 'staff'
urlpatterns = [
    path('login/', views.CustomStaffLoginView.as_view(), name='login'),
    path('logout/', auth_views.LogoutView.as_view(), name='logout'),
    # Main views
    path('', views.StaffListView.as_view(), name='staff_list'),
    path('dashboard/', views.StaffDashboardView.as_view(), name='staff_dashboard'),
    path('teacher-dashboard/', views.TeacherDashboardView.as_view(), name='teacher_dashboard'),
    # CRUD operations
    path('add/', views.StaffCreateView.as_view(), name='staff_add'),
    path('<int:pk>/', views.StaffDetailView.as_view(), name='staff_detail'),
    path('<int:pk>/edit/', views.StaffUpdateView.as_view(), name='staff_edit'),
    path('<int:pk>/delete/', views.StaffDeleteView.as_view(), name='staff_delete'),
    # Import/Export
    path('export/', views.export_staff_csv, name='staff_export'),
    path('import/', views.staff_import, name='staff_import'),
    path('import/sample/', views.download_sample_csv, name='download_sample_csv'),
    # API endpoints
    path('api/stats/', views.get_staff_stats, name='staff_stats'),    
    # Leave management
    path('leave/', views.StaffLeaveListView.as_view(), name='leave_list'),
    path('leave/add/', views.StaffLeaveCreateView.as_view(), name='leave_add'),
    path('leave/<int:pk>/', views.StaffLeaveDetailView.as_view(), name='leave_detail'),
    path('leave/<int:pk>/edit/', views.StaffLeaveUpdateView.as_view(), name='leave_edit'),    
    # Staff Attendance
    path('attendance/', views.StaffAttendanceListView.as_view(), name='attendance_list'),
    path('attendance/mark/', views.mark_staff_attendance, name='mark_attendance'),
    path('attendance/<int:pk>/', views.StaffAttendanceDetailView.as_view(), name='attendance_detail'),
]