Integrate audit checklist responses into service tasks

This commit is contained in:
A R R R Associates
2026-07-19 21:59:24 +05:30
parent 05b736b6c9
commit df52845194
10 changed files with 383 additions and 10 deletions
+22
View File
@@ -19,6 +19,7 @@ from app.modules.services.execution import (
add_task_comment,
apply_bulk_task_update,
apply_task_review,
apply_task_checklist_response,
apply_task_update,
dashboard_stats,
generate_tasks_for_subscription,
@@ -322,6 +323,7 @@ def task_bulk_update_submit(
return _redirect_denied()
target_date = parse_date_value(bulk_internal_target_date) if update_internal_target_date is not None else None
apply_bulk_task_update(
db,
tasks,
status=bulk_status.strip() or None,
assigned_to_user_id=assigned_to_user_id,
@@ -455,6 +457,11 @@ def task_edit_submit(
assigned_to_user_id: str = Form(""),
internal_target_date: str = Form(""),
remarks: str = Form(""),
checklist_response: str = Form(""),
checklist_text_response: str = Form(""),
checklist_number_response: str = Form(""),
checklist_date_response: str = Form(""),
checklist_remarks: str = Form(""),
is_active: str | None = Form(None),
csrf_token: str = Form(...),
):
@@ -504,6 +511,21 @@ def task_edit_submit(
resolved_internal_target_date = task.internal_target_date
resolved_is_active = task.is_active
try:
apply_task_checklist_response(
db,
task,
checklist_response=checklist_response,
checklist_text_response=checklist_text_response,
checklist_number_response=checklist_number_response,
checklist_date_response=checklist_date_response,
checklist_remarks=checklist_remarks,
requested_status=status,
)
except ValueError:
db.rollback()
return RedirectResponse(url=f"/services/work-tracker/tasks/{task_id}/edit?checklist_error=1", status_code=303)
apply_task_update(
task,
status=status,