"""
URL configuration for expense_tracker project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.contrib.auth import views as auth_views
from core import views as core_views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('login/', auth_views.LoginView.as_view(template_name='login.html'), name='login'),
    path('logout/', auth_views.LogoutView.as_view(next_page='login'), name='logout'),
    path('', core_views.root_redirect, name='root_redirect'),
    path('dashboard/', core_views.dashboard, name='dashboard'),
    path('income/add/', core_views.add_income, name='add_income'),
    path('expense/add/', core_views.add_expense, name='add_expense'),
    path('income/edit/<int:pk>/', core_views.edit_income, name='edit_income'),
    path('income/delete/<int:pk>/', core_views.delete_income, name='delete_income'),
    path('expense/edit/<int:pk>/', core_views.edit_expense, name='edit_expense'),
    path('expense/delete/<int:pk>/', core_views.delete_expense, name='delete_expense'),
    path('income/export/csv/', core_views.export_income_csv, name='export_income_csv'),
    path('expense/export/csv/', core_views.export_expense_csv, name='export_expense_csv'),
    path('categories/', core_views.categories, name='categories'),
    path('categories/edit/<int:pk>/', core_views.edit_category, name='edit_category'),
    path('categories/delete/<int:pk>/', core_views.delete_category, name='delete_category'),
    path('analytics/', core_views.analytics, name='analytics'),
    path('settings/', core_views.settings, name='settings'),
    path('password_change/', auth_views.PasswordChangeView.as_view(template_name='password_change.html'), name='password_change'),
    path('password_change/done/', auth_views.PasswordChangeDoneView.as_view(template_name='password_change_done.html'), name='password_change_done'),
]
