import { AuthorStats } from '../services/author-stats-aggregator.service'; interface OKRData { authorName: string; role?: string; reviewPeriod?: string; strongPoints: string[]; weakPoints: string[]; knowledgeGaps: string[]; okr3Month: { objective: string; keyResults: Array<{ kr: string; why: string; actionSteps?: string[] }>; }; okr6Month?: { objective: string; keyResults: Array<{ kr: string; why: string }>; }; okr12Month?: { objective: string; keyResults: Array<{ kr: string; why: string }>; }; actionPlan?: Array<{ area: string; action: string; timeline: string; success: string; support: string; }>; authorStats: AuthorStats; historicalOkrs?: any[]; // Historical OKR data } /** * Format comprehensive OKR data into HTML */ export function formatOKRToHTML(data: OKRData): string { const { authorName, role, reviewPeriod, strongPoints, weakPoints, knowledgeGaps, okr3Month, okr6Month, okr12Month, actionPlan, authorStats, historicalOkrs = [], } = data; // Extract author slug for back button const authorSlug = authorName.toLowerCase().replace(/[^a-z0-9]/g, '_'); return `
Generated on ${new Date().toLocaleDateString()}
| Area | Action | Timeline | Success Criteria | Support Needed |
|---|---|---|---|---|
| ${item.area} | ${item.action} | ${item.timeline} | ${item.success} | ${item.support} |
Code Quality
${getQualityNote(authorStats.quality)}Complexity
${getComplexityNote(authorStats.complexity)}Test Coverage
${getTestNote(authorStats.tests)}Impact
${getImpactNote(authorStats.impact)}Track progress and evolution over time (${historicalOkrs.length} total records)
${okr.okr3Month.objective}
${ okr.okr3Month.keyResults ?.map( (kr: any, i: number) => `