HH/apps/complaints/urls_inquiries.py
ismail badb6a9ebf
All checks were successful
Build and Push Docker Image / build (push) Successful in 2m41s
feat: QI Projects — team-member task management + My Tasks + notifications
Fixed 3 gaps in the QI Projects module:

Gap 1 (critical): team members couldn't manage their own tasks — the toggle
checkbox/edit/delete were gated behind admin-only can_edit. Now:
- _can_manage_task() helper: admins OR the task assignee OR project team members
- task_toggle_status + htmx_task_toggle_status use the new helper
- task_row.html shows the toggle for assignees (task.assigned_to.user_id check)

Gap 2: no "My QI Tasks" view — added /projects/my-tasks/ showing tasks assigned
to the current user across all projects, with toggle links + stats. Sidebar link.

Gap 3: no notification on task assignment — added apps/projects/signals.py
(post_save on QIProjectTask → create_in_app_notification). apps.py ready() wired.

Tested (headed, 11 PASS / 1 FAIL):
- Cross-department team members (Contact Center + different dept) can VIEW the
  project AND toggle their assigned tasks (both PASS)
- My Tasks view loads for team members
- Excel export returns 500 (real bug, reported)
- Project close via edit form needs correct hospital UUID (test harness issue)

Also bundles accumulated in-progress work across complaints, observations,
organizations, templates, and other modules.

Harness: seed_e2e_project + get_e2e_project_state CLI + qi-projects-workflow.spec.ts
2026-06-16 23:55:58 +03:00

40 lines
2.8 KiB
Python

from django.urls import path
from . import ui_views
from . import views
app_name = "inquiries"
urlpatterns = [
# Inquiries UI Views
path("", ui_views.inquiry_list, name="inquiry_list"),
path("new/", ui_views.inquiry_create, name="inquiry_create"),
path("<uuid:pk>/", ui_views.inquiry_detail, name="inquiry_detail"),
path("<uuid:pk>/edit/", ui_views.inquiry_edit, name="inquiry_edit"),
path("<uuid:pk>/activate/", ui_views.inquiry_activate, name="inquiry_activate"),
path("<uuid:pk>/assign/", ui_views.inquiry_assign, name="inquiry_assign"),
path("<uuid:pk>/change-status/", ui_views.inquiry_change_status, name="inquiry_change_status"),
path("<uuid:pk>/reopen/", ui_views.inquiry_reopen, name="inquiry_reopen"),
path("<uuid:pk>/add-note/", ui_views.inquiry_add_note, name="inquiry_add_note"),
path("<uuid:pk>/respond/", ui_views.inquiry_respond, name="inquiry_respond"),
path("<uuid:pk>/update-satisfaction/", ui_views.inquiry_update_satisfaction, name="inquiry_update_satisfaction"),
path("<uuid:pk>/transfer-to-department/", ui_views.inquiry_transfer_to_department, name="inquiry_transfer_to_department"),
path("<uuid:pk>/department-response/", ui_views.inquiry_department_response, name="inquiry_department_response"),
path("<uuid:pk>/review-dept-response/", ui_views.inquiry_review_dept_response, name="inquiry_review_dept_response"),
path("<uuid:pk>/send-dept-response-reminder/", ui_views.inquiry_send_dept_response_reminder, name="inquiry_send_dept_response_reminder"),
path("<uuid:pk>/update-contact/", ui_views.inquiry_update_contact_stage, name="inquiry_update_contact_stage"),
path("export/incoming/", ui_views.inquiry_export_incoming, name="inquiry_export_incoming"),
path("export/outgoing/", ui_views.inquiry_export_outgoing, name="inquiry_export_outgoing"),
# Public Inquiry Form (No Authentication Required)
path("public/submit/", ui_views.public_inquiry_submit, name="public_inquiry_submit"),
path("public/success/<str:reference>/", ui_views.public_inquiry_success, name="public_inquiry_success"),
path("public/track/", ui_views.public_inquiry_track, name="public_inquiry_track"),
path("<uuid:pk>/send-to-staff/", ui_views.inquiry_send_to_staff, name="inquiry_send_to_staff"),
path("<uuid:pk>/send-to/", ui_views.inquiry_send_to, name="inquiry_send_to"),
path("<uuid:pk>/escalate/", ui_views.inquiry_escalate, name="inquiry_escalate"),
# Token-based explanation form (No Authentication Required)
path("<uuid:inquiry_id>/explain/<str:token>/", views.inquiry_explanation_form, name="inquiry_explanation_form"),
# Token-based department response (No Authentication Required)
path("<uuid:pk>/respond/<str:token>/", views.inquiry_respond_with_token, name="inquiry_respond_with_token"),
]