fix: use FY-3/FY-2/FY-1 labels in CSV export for consistency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
admin
2026-02-25 11:29:17 -05:00
parent d4b1658929
commit 9007c4b270

View File

@@ -135,8 +135,10 @@ class CSVExportService {
csvRows.push('FINANCIAL SUMMARY');
csvRows.push('Period,Revenue,Revenue Growth,Gross Profit,Gross Margin,EBITDA,EBITDA Margin');
if (reviewData.financialSummary?.financials) {
const periodLabels: Record<string, string> = { fy3: 'FY-3', fy2: 'FY-2', fy1: 'FY-1', ltm: 'LTM' };
Object.entries(reviewData.financialSummary.financials).forEach(([period, financials]) => {
csvRows.push(`${period.toUpperCase()},${this.escapeCSVValue(financials.revenue)},${this.escapeCSVValue(financials.revenueGrowth)},${this.escapeCSVValue(financials.grossProfit)},${this.escapeCSVValue(financials.grossMargin)},${this.escapeCSVValue(financials.ebitda)},${this.escapeCSVValue(financials.ebitdaMargin)}`);
const label = periodLabels[period] || period.toUpperCase();
csvRows.push(`${label},${this.escapeCSVValue(financials.revenue)},${this.escapeCSVValue(financials.revenueGrowth)},${this.escapeCSVValue(financials.grossProfit)},${this.escapeCSVValue(financials.grossMargin)},${this.escapeCSVValue(financials.ebitda)},${this.escapeCSVValue(financials.ebitdaMargin)}`);
});
}
csvRows.push(''); // Empty row