"""
Observations URL configuration.

Public routes (no login required):
- /observations/new/ - Submit new observation
- /observations/submitted/<tracking_code>/ - Success page
- /observations/track/ - Track observation by code

Internal routes (login required):
- /observations/ - List observations
- /observations/<id>/ - Observation detail
- /observations/<id>/triage/ - Triage observation
- /observations/<id>/status/ - Change status
- /observations/<id>/note/ - Add note
- /observations/<id>/convert-to-action/ - Convert to PX Action
- /observations/categories/ - Category management
"""
from django.urls import path

from . import views

app_name = 'observations'

urlpatterns = [
    # ==========================================================================
    # PUBLIC ROUTES (No Login Required)
    # ==========================================================================
    
    # Submit new observation
    path('new/', views.observation_create_public, name='observation_create_public'),
    
    # Success page after submission
    path('submitted/<str:tracking_code>/', views.observation_submitted, name='observation_submitted'),
    
    # Track observation by code
    path('track/', views.observation_track, name='observation_track'),
    
    # ==========================================================================
    # INTERNAL ROUTES (Login Required)
    # ==========================================================================
    
    # List observations
    path('', views.observation_list, name='observation_list'),
    
    # Observation detail
    path('<uuid:pk>/', views.observation_detail, name='observation_detail'),
    
    # Triage observation
    path('<uuid:pk>/triage/', views.observation_triage, name='observation_triage'),
    
    # Change status
    path('<uuid:pk>/status/', views.observation_change_status, name='observation_change_status'),
    
    # Add note
    path('<uuid:pk>/note/', views.observation_add_note, name='observation_add_note'),
    
    # Convert to PX Action
    path('<uuid:pk>/convert-to-action/', views.observation_convert_to_action, name='observation_convert_to_action'),
    
    # ==========================================================================
    # CATEGORY MANAGEMENT
    # ==========================================================================
    
    # List categories
    path('categories/', views.category_list, name='category_list'),
    
    # Create category
    path('categories/create/', views.category_create, name='category_create'),
    
    # Edit category
    path('categories/<uuid:pk>/edit/', views.category_edit, name='category_edit'),
    
    # Delete category
    path('categories/<uuid:pk>/delete/', views.category_delete, name='category_delete'),
    
    # ==========================================================================
    # AJAX/API HELPERS
    # ==========================================================================
    
    # Get users by department
    path('api/users-by-department/', views.get_users_by_department, name='get_users_by_department'),
]
