// src/core/Asset.js export class Asset { constructor(data) { this.ticker = (data.ticker || 'UNKNOWN').toUpperCase(); this.currentPrice = data.currentPrice || 0; this.type = data.type || 'stock'; } // Helper: Format currency safely formatCurrency(val) { return val ? `$${val.toFixed(2)}` : 'N/A'; } // Shared Logic: Generate the verdict score string calculateVerdict(red, orange, green) { if (red > 0) return '🔴 REJECT'; if (orange >= 3) return '🟡 WATCHLIST'; return '🟢 BUY'; } formatLargeNumber(num) { if (num >= 1e12) return (num / 1e12).toFixed(2) + 'T'; if (num >= 1e9) return (num / 1e9).toFixed(2) + 'B'; if (num >= 1e6) return (num / 1e6).toFixed(2) + 'M'; return num.toString(); } evaluate() { throw new Error("Method 'evaluate()' must be implemented by subclass."); } }