"""
RCA (Root Cause Analysis) URL configuration
"""
from django.urls import path

from . import views

app_name = 'rca'

urlpatterns = [
    # RCA CRUD
    path('', views.RCAListView.as_view(), name='rca_list'),
    path('create/', views.RCACreateView.as_view(), name='rca_create'),
    path('<uuid:pk>/', views.RCADetailView.as_view(), name='rca_detail'),
    path('<uuid:pk>/update/', views.RCAUpdateView.as_view(), name='rca_update'),
    path('<uuid:pk>/delete/', views.RCADeleteView.as_view(), name='rca_delete'),

    # RCA Status Management
    path('<uuid:pk>/status/', views.RCAStatusChangeView.as_view(), name='rca_status_change'),
    path('<uuid:pk>/approve/', views.RCAApprovalView.as_view(), name='rca_approve'),
    path('<uuid:pk>/close/', views.RCAClosureView.as_view(), name='rca_close'),

    # Root Causes
    path('<uuid:pk>/root-causes/add/', views.RCARootCauseCreateView.as_view(), name='rca_root_cause_add'),
    path('<uuid:pk>/root-causes/<uuid:root_cause_pk>/delete/', views.RCARootCauseDeleteView.as_view(), name='rca_root_cause_delete'),

    # Corrective Actions
    path('<uuid:pk>/actions/add/', views.RCACorrectiveActionCreateView.as_view(), name='rca_action_add'),
    path('<uuid:pk>/actions/<uuid:action_pk>/delete/', views.RCACorrectiveActionDeleteView.as_view(), name='rca_action_delete'),

    # Attachments
    path('<uuid:pk>/attachments/add/', views.RCAAttachmentCreateView.as_view(), name='rca_attachment_add'),

    # Notes
    path('<uuid:pk>/notes/add/', views.RCANoteCreateView.as_view(), name='rca_note_add'),
]