diff --git a/csharp/App/Backend/DataTypes/ChecklistStepDefinitions.cs b/csharp/App/Backend/DataTypes/ChecklistStepDefinitions.cs index 71cb985bb..9ba58bb8a 100644 --- a/csharp/App/Backend/DataTypes/ChecklistStepDefinitions.cs +++ b/csharp/App/Backend/DataTypes/ChecklistStepDefinitions.cs @@ -13,7 +13,8 @@ public static class ChecklistStepDefinitions new( 3, "Installation created on Monitor under correct product and folder", """ [ - {"text":"checklistStep3Sub1","checked":false} + {"text":"checklistStep3Sub1","checked":false}, + {"text":"checklistStep3Sub2","checked":false} ] """), new( 4, "Gateway SD card configured, VPN and gateway name registered", NoSubtasks), @@ -64,8 +65,5 @@ public static class ChecklistStepDefinitions new(11, "Software verified on site", NoSubtasks), new(12, "Installation online on Monitor", NoSubtasks), new(13, "Customer informed about Monitor account and reports", NoSubtasks), - new(14, "User account created with correct folders and access", NoSubtasks), - new(15, "Customer follow-up completed, feedback collected", NoSubtasks), - new(16, "Further issues tracked via Ticket system", NoSubtasks), }; } diff --git a/csharp/App/Backend/Database/Db.cs b/csharp/App/Backend/Database/Db.cs index 21f06bedb..ba414a01d 100644 --- a/csharp/App/Backend/Database/Db.cs +++ b/csharp/App/Backend/Database/Db.cs @@ -168,6 +168,14 @@ public static partial class Db // raw-string JSON form preserving each row's existing checked state. BackfillStep10Sub3(); + // One-time backfill: the former step 14 (user account created) became a subtask of step 3. + // Append it to existing step-3 rows, preserving each row's existing checked state. + BackfillStep3Sub2(); + + // One-time cleanup: steps 14 (now a subtask of step 3), 15 and 16 were removed from the + // onboarding checklist. Drop any rows seeded before removal. + Connection.Execute("DELETE FROM ChecklistItem WHERE StepNumber IN (14, 15, 16)"); + // One-time cleanup: step 9 (Abschluss) was removed from the on-site checklist — // the e-signature block now handles sign-off. Drop any rows seeded before removal. Connection.Execute("DELETE FROM OnSiteChecklistItem WHERE StepNumber = 9"); @@ -200,6 +208,31 @@ public static partial class Db } } + // Must run AFTER the step-3 Sub1 SQL backfill above: that step populates rows whose Subtasks + // were NULL/empty, after which they become eligible for the Sub2 append below. + private static void BackfillStep3Sub2() + { + var rows = Connection.Query( + "SELECT * FROM ChecklistItem WHERE StepNumber = 3 AND Subtasks IS NOT NULL AND Subtasks != ''"); + foreach (var row in rows) + { + if (row.Subtasks is null) continue; + if (row.Subtasks.Contains("checklistStep3Sub2")) continue; + + // Insert sub2 before the closing bracket. Works regardless of indentation/whitespace + // since we only look for the last `]`. + var lastBracket = row.Subtasks.LastIndexOf(']'); + if (lastBracket < 0) continue; + + var head = row.Subtasks.Substring(0, lastBracket).TrimEnd(); + // head ends with `}` of the last existing subtask. + var newJson = head + ",{\"text\":\"checklistStep3Sub2\",\"checked\":false}]"; + Connection.Execute( + "UPDATE ChecklistItem SET Subtasks = ? WHERE Id = ?", + newJson, row.Id); + } + } + private static SQLiteConnection InitConnection() { var latestDb = new DirectoryInfo("DbBackups") diff --git a/typescript/frontend-marios2/src/content/dashboards/Checklist/SetupProgress.tsx b/typescript/frontend-marios2/src/content/dashboards/Checklist/SetupProgress.tsx index f53cc00eb..5b9799964 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Checklist/SetupProgress.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Checklist/SetupProgress.tsx @@ -11,7 +11,7 @@ function phaseId(done: number, total: number): string { if (total === 0) return 'checklistPhaseEmpty'; if (done >= total) return 'checklistPhaseComplete'; if (done <= 5) return 'checklistPhasePreparation'; - if (done <= 12) return 'checklistPhaseOnSite'; + if (done <= 11) return 'checklistPhaseOnSite'; return 'checklistPhaseHandover'; } diff --git a/typescript/frontend-marios2/src/content/dashboards/Installations/FlatInstallationView.tsx b/typescript/frontend-marios2/src/content/dashboards/Installations/FlatInstallationView.tsx index 6a8df01ad..61a8fb80d 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Installations/FlatInstallationView.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Installations/FlatInstallationView.tsx @@ -550,7 +550,7 @@ const FlatInstallationView = (props: FlatInstallationViewProps) => { return ( ); })()} diff --git a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/FlatInstallationView.tsx b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/FlatInstallationView.tsx index ecdb8beee..8c1322721 100644 --- a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/FlatInstallationView.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/FlatInstallationView.tsx @@ -329,7 +329,7 @@ const FlatInstallationView = (props: FlatInstallationViewProps) => { return ( ); })()} diff --git a/typescript/frontend-marios2/src/lang/de.json b/typescript/frontend-marios2/src/lang/de.json index b0f6557b8..45ebe5c3b 100644 --- a/typescript/frontend-marios2/src/lang/de.json +++ b/typescript/frontend-marios2/src/lang/de.json @@ -777,10 +777,8 @@ "checklistStep11": "Software vor Ort verifiziert", "checklistStep12": "Installation online auf Monitor", "checklistStep13": "Kunde über Monitor-Konto und Reports informiert", - "checklistStep14": "Benutzerkonto mit richtigen Ordnern und Zugriffen erstellt", - "checklistStep15": "Kundennachverfolgung abgeschlossen, Feedback eingeholt", - "checklistStep16": "Weitere Anliegen werden über das Ticket-System verfolgt", "checklistStep3Sub1": "Installations-Seriennummer", + "checklistStep3Sub2": "Benutzerkonto mit richtigen Ordnern und Zugriffen erstellt", "checklistStep5Sub1": "Kundeninformationen (E-Mail, Adresse)", "checklistStep5Sub2": "Installationsinformationen (externes EMS, Stromanbieter, Datenerfassung)", "checklistStep5Sub3": "Batterie-Seriennummer", diff --git a/typescript/frontend-marios2/src/lang/en.json b/typescript/frontend-marios2/src/lang/en.json index 59de5d1a9..699fabd95 100644 --- a/typescript/frontend-marios2/src/lang/en.json +++ b/typescript/frontend-marios2/src/lang/en.json @@ -525,10 +525,8 @@ "checklistStep11": "Software verified on site", "checklistStep12": "Installation online on Monitor", "checklistStep13": "Customer informed about Monitor account and reports", - "checklistStep14": "User account created with correct folders and access", - "checklistStep15": "Customer follow-up completed, feedback collected", - "checklistStep16": "Further issues tracked via Ticket system", "checklistStep3Sub1": "Installation serial number", + "checklistStep3Sub2": "User account created with correct folders and access", "checklistStep5Sub1": "Customer information (email, address)", "checklistStep5Sub2": "Installation information (external EMS, grid provider, data collection)", "checklistStep5Sub3": "Battery serial number", diff --git a/typescript/frontend-marios2/src/lang/fr.json b/typescript/frontend-marios2/src/lang/fr.json index 739956dee..b07fbef50 100644 --- a/typescript/frontend-marios2/src/lang/fr.json +++ b/typescript/frontend-marios2/src/lang/fr.json @@ -777,10 +777,8 @@ "checklistStep11": "Logiciel vérifié sur site", "checklistStep12": "Installation en ligne sur Monitor", "checklistStep13": "Client informé du compte Monitor et des rapports", - "checklistStep14": "Compte utilisateur créé avec les dossiers et accès corrects", - "checklistStep15": "Suivi client effectué, retour recueilli", - "checklistStep16": "Problèmes ultérieurs suivis via le système de tickets", "checklistStep3Sub1": "Numéro de série de l'installation", + "checklistStep3Sub2": "Compte utilisateur créé avec les dossiers et accès corrects", "checklistStep5Sub1": "Informations client (e-mail, adresse)", "checklistStep5Sub2": "Informations d'installation (EMS externe, fournisseur réseau, collecte de données)", "checklistStep5Sub3": "Numéro de série de la batterie", diff --git a/typescript/frontend-marios2/src/lang/it.json b/typescript/frontend-marios2/src/lang/it.json index 451b831a3..2966bcf5d 100644 --- a/typescript/frontend-marios2/src/lang/it.json +++ b/typescript/frontend-marios2/src/lang/it.json @@ -777,10 +777,8 @@ "checklistStep11": "Software verificato in sito", "checklistStep12": "Installazione online su Monitor", "checklistStep13": "Cliente informato su account Monitor e report", - "checklistStep14": "Account utente creato con cartelle e accessi corretti", - "checklistStep15": "Follow-up cliente completato, feedback raccolto", - "checklistStep16": "Ulteriori problemi tracciati tramite il sistema di ticket", "checklistStep3Sub1": "Numero di serie dell'installazione", + "checklistStep3Sub2": "Account utente creato con cartelle e accessi corretti", "checklistStep5Sub1": "Informazioni cliente (e-mail, indirizzo)", "checklistStep5Sub2": "Informazioni installazione (EMS esterno, fornitore di rete, raccolta dati)", "checklistStep5Sub3": "Numero di serie batteria",