Add company analysis view with financials, price history, filings, and AI reports

This commit is contained in:
2026-02-27 09:57:44 -05:00
parent e7320f3bdb
commit 7c3836068f
9 changed files with 512 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import { edenTreaty } from '@elysiajs/eden';
import type { App } from '@/lib/server/api/app';
import type {
CompanyAnalysis,
Filing,
Holding,
PortfolioInsight,
@@ -173,6 +174,16 @@ export async function listFilings(query?: { ticker?: string; limit?: number }) {
return await unwrapData<{ filings: Filing[] }>(result, 'Unable to fetch filings');
}
export async function getCompanyAnalysis(ticker: string) {
const result = await client.api.analysis.company.get({
$query: {
ticker: ticker.trim().toUpperCase()
}
});
return await unwrapData<{ analysis: CompanyAnalysis }>(result, 'Unable to fetch company analysis');
}
export async function queueFilingSync(input: { ticker: string; limit?: number }) {
const result = await client.api.filings.sync.post(input);
return await unwrapData<{ task: Task }>(result, 'Unable to queue filing sync');