from django.urls import path
from .views import (
    home,
    log_attendance,
    work_log_list,
    export_work_log_csv,
    manage_resources,
    toggle_resource_status,
    payroll_dashboard,
    process_payment,
    preview_payslip,
    payslip_detail,
    loan_list,
    add_loan,
    add_adjustment,
    edit_adjustment,
    delete_adjustment,
    create_receipt,
    price_overtime
)

urlpatterns = [
    # === HOME & ATTENDANCE ===
    path("", home, name="home"),
    path("log-attendance/", log_attendance, name="log_attendance"),

    # === WORK LOGS ===
    path("work-logs/", work_log_list, name="work_log_list"),
    path("work-logs/export/", export_work_log_csv, name="export_work_log_csv"),

    # === RESOURCE MANAGEMENT ===
    path("manage-resources/", manage_resources, name="manage_resources"),
    path("manage-resources/toggle/<str:model_type>/<int:pk>/", toggle_resource_status, name="toggle_resource_status"),

    # === PAYROLL ===
    path("payroll/", payroll_dashboard, name="payroll_dashboard"),
    path("payroll/pay/<int:worker_id>/", process_payment, name="process_payment"),
    path("payroll/preview/<int:worker_id>/", preview_payslip, name="preview_payslip"),
    path("payroll/price-overtime/", price_overtime, name="price_overtime"),
    path("payroll/payslip/<int:pk>/", payslip_detail, name="payslip_detail"),

    # === LOANS ===
    path("loans/", loan_list, name="loan_list"),
    path("loans/add/", add_loan, name="add_loan"),

    # === ADJUSTMENTS ===
    path("payroll/adjustment/add/", add_adjustment, name="add_adjustment"),
    path("payroll/adjustment/<int:pk>/edit/", edit_adjustment, name="edit_adjustment"),
    path("payroll/adjustment/<int:pk>/delete/", delete_adjustment, name="delete_adjustment"),

    # === EXPENSES ===
    path("receipts/create/", create_receipt, name="create_receipt"),
]
