1 Commits

Author SHA1 Message Date
admin
04f30ca3e7 Fix TypeScript errors in financial validation 2025-11-10 14:06:02 -05:00

View File

@@ -536,9 +536,9 @@ Focus on finding these specific fields in the document. Extract exact values, nu
const otherValues = otherPeriods
.map(p => {
const val = extractNumericValue(financials[p]!.revenue || '');
return val !== null && val > 0 ? { period: p, value: val } : null;
return val !== null && val > 0 ? { period: p as 'fy3' | 'fy2' | 'fy1' | 'ltm', value: val } : null;
})
.filter((v): v is { period: string; value: number } => v !== null);
.filter((v): v is { period: 'fy3' | 'fy2' | 'fy1' | 'ltm'; value: number } => v !== null);
if (otherValues.length > 0) {
const avgOtherValue = otherValues.reduce((a, b) => a + b.value, 0) / otherValues.length;