// server/services/report.ts import type { ExecutionResult } from "@shared/types.js"; export function buildReportMarkdown(exec: ExecutionResult, machineName: string): string { const lines = exec.importantLogLines.map((l) => ` ${l}`).join("\n"); return `# Rapport d'exécution — ${machineName} - Exécution : ${exec.executionId} - Action : ${exec.action} - Statut : ${exec.status} - Début : ${exec.startedAt} - Fin : ${exec.finishedAt} - Redémarrage requis : ${exec.rebootRequiredAfterRun ? "oui" : "non"} ## Lignes importantes \`\`\` ${lines || " (aucune)"} \`\`\` ## Log brut Référence : \`${exec.rawLogRef}\` `; }