# ============================================================
# ADDITIVE: Project Timesheets & Overtime (Admin / HR)  ->  /api/timesheet/...
# Mounted from hrnexus/urls.py:  path('api/', include('Timesheet.urls'))
# ============================================================
from django.urls import path
from rest_framework.routers import SimpleRouter

from . import views_core, views_entries, views_overtime, views_projects

router = SimpleRouter()
router.register(r"timesheet/entries", views_entries.EntryViewSet, basename="timesheet-entries")
router.register(r"timesheet/projects", views_projects.ProjectViewSet, basename="timesheet-projects")
router.register(r"timesheet/allocations", views_projects.AllocationViewSet, basename="timesheet-allocations")
router.register(r"timesheet/overtime-claims", views_overtime.ClaimViewSet, basename="timesheet-overtime-claims")

urlpatterns = [
    path("timesheet/summary/", views_core.SummaryView.as_view(), name="timesheet_summary"),
    path("timesheet/meta/", views_core.MetaView.as_view(), name="timesheet_meta"),
    path("timesheet/settings/", views_core.SettingsView.as_view(), name="timesheet_settings"),
    path("timesheet/approvals/", views_entries.ApprovalQueueView.as_view(), name="timesheet_approvals"),
    path("timesheet/approvals/approve-all-pending/", views_entries.ApproveAllPendingView.as_view(), name="timesheet_approve_all"),
    path("timesheet/approvals/<int:pk>/approve/", views_entries.ApproveView.as_view(), name="timesheet_approve"),
    path("timesheet/approvals/<int:pk>/reject/", views_entries.RejectView.as_view(), name="timesheet_reject"),
] + router.urls
