initial commit

This commit is contained in:
Saki
2026-06-02 00:34:42 -04:00
commit 3768d83b5b
14 changed files with 1939 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
// 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.");
}
}