0dac8128bd
- Restructured server layer with 5 domains: shared, screener, portfolio, calls, finance - Migrated 58 TypeScript files to domain-driven structure - Updated CLAUDE.md with new architecture documentation - Added .gitignore rules for .md files (except CLAUDE.md) - Removed unused CatalystAnalyst import from app.ts - Fixed lint errors: removed unused imports, fixed regex escape, added console suppressions - Verified no sensitive data in git history - Server code compiles cleanly with TypeScript strict mode
30 lines
951 B
TypeScript
30 lines
951 B
TypeScript
import { Asset } from './Asset';
|
|
import type { EtfData, EtfMetrics } from '../types/models.model';
|
|
|
|
export class Etf extends Asset {
|
|
metrics: EtfMetrics;
|
|
|
|
constructor(data: EtfData) {
|
|
super(data);
|
|
this.metrics = {
|
|
expenseRatio: parseFloat(String(data.expenseRatio)) || 0,
|
|
totalAssets: parseFloat(String(data.totalAssets)) || 0,
|
|
yield: parseFloat(String(data.yield)) || 0,
|
|
volume: parseFloat(String(data.volume)) || 0,
|
|
fiveYearReturn: parseFloat(String(data.fiveYearReturn)) || 0,
|
|
};
|
|
}
|
|
|
|
getDisplayMetrics(): Record<string, string> {
|
|
return {
|
|
Ticker: this.ticker,
|
|
Type: 'ETF',
|
|
Price: this.formatCurrency(this.currentPrice),
|
|
'Exp Ratio%': `${this.metrics.expenseRatio.toFixed(2)}%`,
|
|
'Yield%': `${this.metrics.yield.toFixed(2)}%`,
|
|
AUM: this.formatLargeNumber(this.metrics.totalAssets),
|
|
'5Y Return%': `${this.metrics.fiveYearReturn.toFixed(1)}%`,
|
|
};
|
|
}
|
|
}
|