Add full sync retirement for missing system default tasks

This commit is contained in:
A R R R Associates
2026-09-19 14:13:16 +05:30
parent 2d6043962b
commit 7bd7f52278
6 changed files with 195 additions and 33 deletions
+6 -2
View File
@@ -12,6 +12,7 @@ from app.modules.services.models import ServiceCatalogue, ServiceDefaultTaskTemp
_HEADERS = [
"system_task_id",
"service_code",
"service_name",
"category_code",
@@ -41,6 +42,7 @@ _HEADERS = [
]
_IMPORT_HEADERS = [
"system_task_id",
"service_code",
"sequence_no",
"task_name",
@@ -168,6 +170,7 @@ def build_default_tasks_export(db: Session, *, catalogue_id: int | None = None)
for task in tasks:
all_tasks_ws.append([
task.id,
service.service_code,
service.service_name,
category_code,
@@ -196,6 +199,7 @@ def build_default_tasks_export(db: Session, *, catalogue_id: int | None = None)
task.description or "",
])
import_ws.append([
task.id,
service.service_code,
task.sequence_no,
task.task_name,
@@ -252,9 +256,9 @@ def build_default_tasks_export(db: Session, *, catalogue_id: int | None = None)
("Default task rows exported", total_tasks),
("Active default task rows", active_tasks),
("Services without default tasks", services_without_tasks),
("Import Ready sheet", "Matches the existing System Default Tasks import column order"),
("Import Ready sheet", "Includes stable system_task_id so renaming/resequencing can update the correct task safely"),
("Historical inactive services", "Not included, so merged or inactive services do not create confusion"),
("Important", "Review edited rows before re-importing. Service codes and task sequence numbers control matching and uniqueness."),
("Important", "Keep system_task_id unchanged for existing tasks. New rows may leave it blank. Full Synchronization can retire existing tasks omitted from the workbook."),
]
info_ws.append(["Item", "Value"])
for item, value in info_rows: