From 9007c4b270b1f78b1c8441a27f697a1fc5253d46 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 25 Feb 2026 11:29:17 -0500 Subject: [PATCH] fix: use FY-3/FY-2/FY-1 labels in CSV export for consistency Co-Authored-By: Claude Opus 4.6 --- backend/src/services/csvExportService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/services/csvExportService.ts b/backend/src/services/csvExportService.ts index ded0306..7f7cea9 100644 --- a/backend/src/services/csvExportService.ts +++ b/backend/src/services/csvExportService.ts @@ -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 = { 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