Prioritize SEC financials for 10-K/10-Q and keep other filings qualitative
This commit is contained in:
@@ -35,6 +35,10 @@ function formatFilingDate(value: string) {
|
||||
return format(date, 'MMM dd, yyyy');
|
||||
}
|
||||
|
||||
function hasFinancialSnapshot(filing: Filing) {
|
||||
return filing.filing_type === '10-K' || filing.filing_type === '10-Q';
|
||||
}
|
||||
|
||||
function resolveOriginalFilingUrl(filing: Filing) {
|
||||
if (filing.filing_url) {
|
||||
return filing.filing_url;
|
||||
@@ -171,7 +175,7 @@ function FilingsPageContent() {
|
||||
return (
|
||||
<AppShell
|
||||
title="Filings Stream"
|
||||
subtitle="Sync SEC submissions and generate AI red-flag analysis asynchronously."
|
||||
subtitle="Sync SEC submissions, keep 10-K/10-Q financial snapshots, and analyze qualitative signals from other forms."
|
||||
actions={(
|
||||
<Button variant="secondary" className="w-full sm:w-auto" onClick={() => void loadFilings(searchTicker || undefined)}>
|
||||
<TimerReset className="size-4" />
|
||||
@@ -254,6 +258,7 @@ function FilingsPageContent() {
|
||||
<div className="space-y-3">
|
||||
<div className="space-y-3 lg:hidden">
|
||||
{filings.map((filing) => {
|
||||
const financialForm = hasFinancialSnapshot(filing);
|
||||
const revenue = filing.metrics?.revenue;
|
||||
const hasAnalysis = Boolean(filing.analysis?.text || filing.analysis?.legacyInsights);
|
||||
const originalFilingUrl = resolveOriginalFilingUrl(filing);
|
||||
@@ -275,8 +280,10 @@ function FilingsPageContent() {
|
||||
|
||||
<dl className="mt-3 grid grid-cols-1 gap-2 text-xs sm:grid-cols-2">
|
||||
<div className="rounded-md border border-[color:var(--line-weak)] px-2 py-1.5">
|
||||
<dt className="text-[color:var(--terminal-muted)]">Revenue Snapshot</dt>
|
||||
<dd className="mt-1 text-[color:var(--terminal-bright)]">{revenue ? formatCompactCurrency(revenue) : 'n/a'}</dd>
|
||||
<dt className="text-[color:var(--terminal-muted)]">Financial Snapshot</dt>
|
||||
<dd className="mt-1 text-[color:var(--terminal-bright)]">
|
||||
{financialForm ? (revenue ? formatCompactCurrency(revenue) : 'n/a') : 'Qualitative filing'}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="rounded-md border border-[color:var(--line-weak)] px-2 py-1.5">
|
||||
<dt className="text-[color:var(--terminal-muted)]">Accession</dt>
|
||||
@@ -331,6 +338,7 @@ function FilingsPageContent() {
|
||||
</thead>
|
||||
<tbody>
|
||||
{filings.map((filing) => {
|
||||
const financialForm = hasFinancialSnapshot(filing);
|
||||
const revenue = filing.metrics?.revenue;
|
||||
const hasAnalysis = Boolean(filing.analysis?.text || filing.analysis?.legacyInsights);
|
||||
const originalFilingUrl = resolveOriginalFilingUrl(filing);
|
||||
@@ -343,7 +351,7 @@ function FilingsPageContent() {
|
||||
</td>
|
||||
<td>{filing.filing_type}</td>
|
||||
<td>{formatFilingDate(filing.filing_date)}</td>
|
||||
<td>{revenue ? formatCompactCurrency(revenue) : 'n/a'}</td>
|
||||
<td>{financialForm ? (revenue ? formatCompactCurrency(revenue) : 'n/a') : 'Qualitative filing'}</td>
|
||||
<td className="max-w-[18rem]">{filing.company_name}</td>
|
||||
<td>{hasAnalysis ? 'Ready' : 'Not generated'}</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user