[
    {
        "id": "api",
        "component": "component_api",
        "ws_domain": ""
    },
    {
        "id": "div_head",
        "component": "component_div",
        "adjust": {
            "align": "center",
            "top": "",
            "left": "",
            "right": "",
            "bottom": "",
            "width": "default"
        },
        "content": ["include:*application*/superadmin/zlib_mod/front/head/head"]
    },
    {
        "id": "repair_title",
        "component": "component_messagehtml",
        "html": "<h2 style='margin:30px auto 20px auto;max-width:900px;color:#1e3a5f;font-size:24px;font-weight:600;'>🔧 Réparation des statistiques count_echange</h2>",
        "adjust": {
            "align": "center",
            "top": "",
            "left": "",
            "right": "",
            "bottom": "",
            "width": "900px"
        }
    },
    {
        "id": "repair_description",
        "component": "component_messagehtml",
        "html": "<div style='margin:0 auto 20px auto;max-width:900px;background:linear-gradient(135deg,#1e3a5f 0%,#2d5a87 100%);color:white;padding:25px;border-radius:10px;box-shadow:0 4px 15px rgba(0,0,0,0.2);'><h3 style='margin-top:0;color:#7dd3fc;font-size:18px;'>📋 Objectif</h3><p style='line-height:1.6;'>Ce script corrige les données <code style='background:rgba(255,255,255,0.15);padding:2px 8px;border-radius:4px;'>count_echange</code> dans la table <code style='background:rgba(255,255,255,0.15);padding:2px 8px;border-radius:4px;'>stat</code> en excluant les notes privées du comptage.</p><p style='line-height:1.6;'><strong>Problème identifié :</strong> Les anciennes données incluent les notes privées des agents dans le compteur d'échanges, ce qui fausse le calcul du FCR (First Contact Resolution).</p><h3 style='color:#7dd3fc;font-size:16px;'>Actions effectuées :</h3><ul style='margin:10px 0;padding-left:25px;'><li style='margin:8px 0;'>Parcours de tous les tickets</li><li style='margin:8px 0;'>Recalcul du nombre d'échanges publics (en excluant s_titre = 'NOTE PRIVEE')</li><li style='margin:8px 0;'>Création des entrées count_echange manquantes</li><li style='margin:8px 0;'>Mise à jour de la table stat avec les valeurs corrigées</li></ul><p style='background:rgba(255,255,255,0.1);padding:10px;border-radius:6px;margin-top:15px;'><strong>⚠️ Important :</strong> Après la réparation, supprimez les données de stat_consolide et reconsolidez.</p></div>",
        "adjust": {
            "align": "center",
            "top": "",
            "left": "",
            "right": "",
            "bottom": "",
            "width": "900px"
        }
    },
    {
        "id": "repair_password_field",
        "component": "component_form_field_text",
        "label": "Mot de passe de sécurité",
        "placeholder": "Entrez le mot de passe de réparation",
        "value": "",
        "adjust": {
            "align": "center",
            "top": "10px",
            "left": "",
            "right": "",
            "bottom": "10px",
            "width": "900px"
        }
    },
    {
        "id": "repair_options",
        "component": "component_messagehtml",
        "html": "<div style='margin:10px auto 20px auto;max-width:900px;background:#fffbeb;padding:15px 20px;border-radius:8px;border:1px solid #fbbf24;'><label style='display:flex;align-items:center;gap:10px;cursor:pointer;color:#92400e;'><input type='checkbox' id='dry_run_checkbox' checked style='width:18px;height:18px;'> <strong>Mode simulation</strong> - Aucune modification ne sera effectuée</label></div>",
        "adjust": {
            "align": "center",
            "top": "",
            "left": "",
            "right": "",
            "bottom": "",
            "width": "900px"
        }
    },
    {
        "id": "repair_buttons",
        "component": "component_messagehtml",
        "html": "<div style='margin:10px auto 20px auto;max-width:900px;display:flex;gap:15px;'><button type='button' onclick='checkRepairStatus()' style='padding:12px 24px;background:#0ea5e9;color:white;border:none;border-radius:6px;cursor:pointer;font-size:14px;font-weight:600;'>📊 Vérifier l'état</button><button type='button' onclick='runRepair()' style='padding:12px 24px;background:#3b82f6;color:white;border:none;border-radius:6px;cursor:pointer;font-size:14px;font-weight:600;'>🚀 Lancer la réparation</button></div>",
        "adjust": {
            "align": "center",
            "top": "",
            "left": "",
            "right": "",
            "bottom": "",
            "width": "900px"
        }
    },
    {
        "id": "repair_status_title",
        "component": "component_messagehtml",
        "html": "<h3 style='margin:30px auto 10px auto;max-width:900px;color:#1e3a5f;font-size:18px;border-bottom:2px solid #3b82f6;padding-bottom:10px;'>📈 État actuel</h3>",
        "adjust": {
            "align": "center",
            "top": "",
            "left": "",
            "right": "",
            "bottom": "",
            "width": "900px"
        }
    },
    {
        "id": "repair_status_content",
        "component": "component_messagehtml",
        "html": "<div id='status_content' style='margin:0 auto;max-width:900px;min-height:100px;padding:20px;background:white;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,0.1);border:1px solid #e0e0e0;'><div style='text-align:center;color:#6c757d;'>Cliquez sur \"Vérifier l'état\" pour voir les statistiques</div></div>",
        "adjust": {
            "align": "center",
            "top": "",
            "left": "",
            "right": "",
            "bottom": "",
            "width": "900px"
        }
    },
    {
        "id": "repair_progress",
        "component": "component_messagehtml",
        "html": "<div id='progress_section' style='display:none;margin:30px auto;max-width:900px;padding:20px;background:white;border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,0.1);'><h3 style='margin:0 0 15px 0;color:#1e3a5f;border-bottom:2px solid #3b82f6;padding-bottom:10px;'>⏳ Progression</h3><div id='progress_bar_container'></div><div id='progress_log' style='max-height:300px;overflow-y:auto;background:#1e1e1e;color:#d4d4d4;padding:15px;border-radius:6px;font-family:Consolas,Monaco,monospace;font-size:13px;margin-top:15px;'></div></div>",
        "adjust": {
            "align": "center",
            "top": "",
            "left": "",
            "right": "",
            "bottom": "",
            "width": "900px"
        }
    },
    {
        "id": "repair_results",
        "component": "component_messagehtml",
        "html": "<div id='results_section' style='display:none;margin:30px auto;max-width:900px;padding:20px;background:white;border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,0.1);'><h3 style='margin:0 0 15px 0;color:#1e3a5f;border-bottom:2px solid #3b82f6;padding-bottom:10px;'>✅ Résultats</h3><div id='results_content'></div></div>",
        "adjust": {
            "align": "center",
            "top": "",
            "left": "",
            "right": "",
            "bottom": "",
            "width": "900px"
        }
    },
    {
        "id": "repair_js",
        "component": "component_js",
        "src": "*application*/superadmin/repair_count_echange/repair_count_echange.js"
    },
    {
        "id": "repair_css",
        "component": "component_css",
        "src": "*application*/superadmin/repair_count_echange/repair_count_echange.css"
    }
]
