Add consolidated disclosure statement type
Create unified disclosure statement to organize footnote disclosures separate from primary financial statements. Disclosures are now grouped by type (tax, debt, securities, derivatives, leases, intangibles, ma, revenue, cash_flow) in a dedicated statement type for cleaner UI presentation.
This commit is contained in:
231
lib/types.ts
231
lib/types.ts
@@ -5,22 +5,28 @@ export type User = {
|
||||
image: string | null;
|
||||
};
|
||||
|
||||
export type CoverageStatus = 'backlog' | 'active' | 'watch' | 'archive';
|
||||
export type CoveragePriority = 'low' | 'medium' | 'high';
|
||||
export type ResearchJournalEntryType = 'note' | 'filing_note' | 'status_change';
|
||||
export type NumberScaleUnit = 'thousands' | 'millions' | 'billions';
|
||||
export type ResearchArtifactKind = 'filing' | 'ai_report' | 'note' | 'upload' | 'memo_snapshot' | 'status_change';
|
||||
export type ResearchArtifactSource = 'system' | 'user';
|
||||
export type ResearchVisibilityScope = 'private' | 'organization';
|
||||
export type ResearchMemoRating = 'strong_buy' | 'buy' | 'hold' | 'sell';
|
||||
export type ResearchMemoConviction = 'low' | 'medium' | 'high';
|
||||
export type CoverageStatus = "backlog" | "active" | "watch" | "archive";
|
||||
export type CoveragePriority = "low" | "medium" | "high";
|
||||
export type ResearchJournalEntryType = "note" | "filing_note" | "status_change";
|
||||
export type NumberScaleUnit = "thousands" | "millions" | "billions";
|
||||
export type ResearchArtifactKind =
|
||||
| "filing"
|
||||
| "ai_report"
|
||||
| "note"
|
||||
| "upload"
|
||||
| "memo_snapshot"
|
||||
| "status_change";
|
||||
export type ResearchArtifactSource = "system" | "user";
|
||||
export type ResearchVisibilityScope = "private" | "organization";
|
||||
export type ResearchMemoRating = "strong_buy" | "buy" | "hold" | "sell";
|
||||
export type ResearchMemoConviction = "low" | "medium" | "high";
|
||||
export type ResearchMemoSection =
|
||||
| 'thesis'
|
||||
| 'variant_view'
|
||||
| 'catalysts'
|
||||
| 'risks'
|
||||
| 'disconfirming_evidence'
|
||||
| 'next_actions';
|
||||
| "thesis"
|
||||
| "variant_view"
|
||||
| "catalysts"
|
||||
| "risks"
|
||||
| "disconfirming_evidence"
|
||||
| "next_actions";
|
||||
|
||||
export type WatchlistItem = {
|
||||
id: number;
|
||||
@@ -78,14 +84,14 @@ export type FilingExtraction = {
|
||||
export type FilingExtractionMeta = {
|
||||
provider: string;
|
||||
model: string;
|
||||
source: 'primary_document' | 'metadata_fallback';
|
||||
source: "primary_document" | "metadata_fallback";
|
||||
generatedAt: string;
|
||||
};
|
||||
|
||||
export type Filing = {
|
||||
id: number;
|
||||
ticker: string;
|
||||
filing_type: '10-K' | '10-Q' | '8-K';
|
||||
filing_type: "10-K" | "10-Q" | "8-K";
|
||||
filing_date: string;
|
||||
accession_number: string;
|
||||
cik: string;
|
||||
@@ -113,44 +119,44 @@ export type Filing = {
|
||||
updated_at: string;
|
||||
};
|
||||
|
||||
export type TaskStatus = 'queued' | 'running' | 'completed' | 'failed';
|
||||
export type TaskStatus = "queued" | "running" | "completed" | "failed";
|
||||
export type TaskType =
|
||||
| 'sync_filings'
|
||||
| 'refresh_prices'
|
||||
| 'analyze_filing'
|
||||
| 'portfolio_insights'
|
||||
| 'index_search';
|
||||
| "sync_filings"
|
||||
| "refresh_prices"
|
||||
| "analyze_filing"
|
||||
| "portfolio_insights"
|
||||
| "index_search";
|
||||
export type TaskStage =
|
||||
| 'queued'
|
||||
| 'running'
|
||||
| 'completed'
|
||||
| 'failed'
|
||||
| 'sync.fetch_filings'
|
||||
| 'sync.discover_assets'
|
||||
| 'sync.extract_taxonomy'
|
||||
| 'sync.normalize_taxonomy'
|
||||
| 'sync.derive_metrics'
|
||||
| 'sync.validate_pdf_metrics'
|
||||
| 'sync.persist_taxonomy'
|
||||
| 'sync.fetch_metrics'
|
||||
| 'sync.persist_filings'
|
||||
| 'sync.hydrate_statements'
|
||||
| 'refresh.load_holdings'
|
||||
| 'refresh.fetch_quotes'
|
||||
| 'refresh.persist_prices'
|
||||
| 'analyze.load_filing'
|
||||
| 'analyze.fetch_document'
|
||||
| 'analyze.extract'
|
||||
| 'analyze.generate_report'
|
||||
| 'analyze.persist_report'
|
||||
| 'search.collect_sources'
|
||||
| 'search.fetch_documents'
|
||||
| 'search.chunk'
|
||||
| 'search.embed'
|
||||
| 'search.persist'
|
||||
| 'insights.load_holdings'
|
||||
| 'insights.generate'
|
||||
| 'insights.persist';
|
||||
| "queued"
|
||||
| "running"
|
||||
| "completed"
|
||||
| "failed"
|
||||
| "sync.fetch_filings"
|
||||
| "sync.discover_assets"
|
||||
| "sync.extract_taxonomy"
|
||||
| "sync.normalize_taxonomy"
|
||||
| "sync.derive_metrics"
|
||||
| "sync.validate_pdf_metrics"
|
||||
| "sync.persist_taxonomy"
|
||||
| "sync.fetch_metrics"
|
||||
| "sync.persist_filings"
|
||||
| "sync.hydrate_statements"
|
||||
| "refresh.load_holdings"
|
||||
| "refresh.fetch_quotes"
|
||||
| "refresh.persist_prices"
|
||||
| "analyze.load_filing"
|
||||
| "analyze.fetch_document"
|
||||
| "analyze.extract"
|
||||
| "analyze.generate_report"
|
||||
| "analyze.persist_report"
|
||||
| "search.collect_sources"
|
||||
| "search.fetch_documents"
|
||||
| "search.chunk"
|
||||
| "search.embed"
|
||||
| "search.persist"
|
||||
| "insights.load_holdings"
|
||||
| "insights.generate"
|
||||
| "insights.persist";
|
||||
|
||||
export type TaskStageContext = {
|
||||
progress?: {
|
||||
@@ -173,12 +179,12 @@ export type TaskNotificationStat = {
|
||||
|
||||
export type TaskNotificationAction = {
|
||||
id:
|
||||
| 'open_details'
|
||||
| 'open_filings'
|
||||
| 'open_analysis'
|
||||
| 'open_analysis_report'
|
||||
| 'open_search'
|
||||
| 'open_portfolio';
|
||||
| "open_details"
|
||||
| "open_filings"
|
||||
| "open_analysis"
|
||||
| "open_analysis_report"
|
||||
| "open_search"
|
||||
| "open_portfolio";
|
||||
label: string;
|
||||
href: string | null;
|
||||
primary?: boolean;
|
||||
@@ -188,7 +194,7 @@ export type TaskNotificationView = {
|
||||
title: string;
|
||||
statusLine: string;
|
||||
detailLine: string | null;
|
||||
tone: 'info' | 'success' | 'error';
|
||||
tone: "info" | "success" | "error";
|
||||
progress: {
|
||||
current: number;
|
||||
total: number;
|
||||
@@ -201,12 +207,12 @@ export type TaskNotificationView = {
|
||||
|
||||
export type TaskNotificationEntry = {
|
||||
id: string;
|
||||
kind: 'single' | 'filing_sync_batch';
|
||||
kind: "single" | "filing_sync_batch";
|
||||
status: TaskStatus;
|
||||
title: string;
|
||||
statusLine: string;
|
||||
detailLine: string | null;
|
||||
progress: TaskNotificationView['progress'];
|
||||
progress: TaskNotificationView["progress"];
|
||||
stats: TaskNotificationStat[];
|
||||
updatedAt: string;
|
||||
primaryTaskId: string;
|
||||
@@ -284,12 +290,12 @@ export type ResearchJournalEntry = {
|
||||
updated_at: string;
|
||||
};
|
||||
|
||||
export type SearchSource = 'documents' | 'filings' | 'research';
|
||||
export type SearchSource = "documents" | "filings" | "research";
|
||||
export type SearchResult = {
|
||||
chunkId: number;
|
||||
documentId: number;
|
||||
source: SearchSource;
|
||||
sourceKind: 'filing_document' | 'filing_brief' | 'research_note';
|
||||
sourceKind: "filing_document" | "filing_brief" | "research_note";
|
||||
sourceRef: string;
|
||||
title: string | null;
|
||||
ticker: string | null;
|
||||
@@ -407,7 +413,7 @@ export type ResearchWorkspace = {
|
||||
|
||||
export type CompanyFinancialPoint = {
|
||||
filingDate: string;
|
||||
filingType: Filing['filing_type'];
|
||||
filingType: Filing["filing_type"];
|
||||
revenue: number | null;
|
||||
netIncome: number | null;
|
||||
totalAssets: number | null;
|
||||
@@ -415,19 +421,30 @@ export type CompanyFinancialPoint = {
|
||||
debt: number | null;
|
||||
};
|
||||
|
||||
export type FinancialStatementKind = 'income' | 'balance' | 'cash_flow' | 'equity' | 'comprehensive_income';
|
||||
export type FinancialHistoryWindow = '10y' | 'all';
|
||||
export type FinancialCadence = 'annual' | 'quarterly' | 'ltm';
|
||||
export type FinancialDisplayMode = 'faithful' | 'standardized';
|
||||
export type FinancialStatementKind =
|
||||
| "income"
|
||||
| "balance"
|
||||
| "cash_flow"
|
||||
| "disclosure"
|
||||
| "equity"
|
||||
| "comprehensive_income";
|
||||
export type FinancialHistoryWindow = "10y" | "all";
|
||||
export type FinancialCadence = "annual" | "quarterly" | "ltm";
|
||||
export type FinancialDisplayMode = "faithful" | "standardized";
|
||||
export type FinancialSurfaceKind =
|
||||
| 'income_statement'
|
||||
| 'balance_sheet'
|
||||
| 'cash_flow_statement'
|
||||
| 'ratios'
|
||||
| 'segments_kpis'
|
||||
| 'adjusted'
|
||||
| 'custom_metrics';
|
||||
export type FinancialUnit = 'currency' | 'count' | 'shares' | 'percent' | 'ratio';
|
||||
| "income_statement"
|
||||
| "balance_sheet"
|
||||
| "cash_flow_statement"
|
||||
| "ratios"
|
||||
| "segments_kpis"
|
||||
| "adjusted"
|
||||
| "custom_metrics";
|
||||
export type FinancialUnit =
|
||||
| "currency"
|
||||
| "count"
|
||||
| "shares"
|
||||
| "percent"
|
||||
| "ratio";
|
||||
export type FinancialCategory = string;
|
||||
|
||||
export type FinancialStatementPeriod = {
|
||||
@@ -437,7 +454,7 @@ export type FinancialStatementPeriod = {
|
||||
filingDate: string;
|
||||
periodStart: string | null;
|
||||
periodEnd: string | null;
|
||||
filingType: Extract<Filing['filing_type'], '10-K' | '10-Q'>;
|
||||
filingType: Extract<Filing["filing_type"], "10-K" | "10-Q">;
|
||||
periodLabel: string;
|
||||
};
|
||||
|
||||
@@ -486,10 +503,17 @@ export type DerivedFinancialRow = {
|
||||
export type StandardizedFinancialRow = DerivedFinancialRow;
|
||||
export type StandardizedStatementRow = StandardizedFinancialRow;
|
||||
export type SurfaceFinancialRow = StandardizedFinancialRow & {
|
||||
statement?: Extract<FinancialStatementKind, 'income' | 'balance' | 'cash_flow'>;
|
||||
statement?: Extract<
|
||||
FinancialStatementKind,
|
||||
"income" | "balance" | "cash_flow"
|
||||
>;
|
||||
detailCount?: number;
|
||||
resolutionMethod?: 'direct' | 'surface_bridge' | 'formula_derived' | 'not_meaningful';
|
||||
confidence?: 'high' | 'medium' | 'low';
|
||||
resolutionMethod?:
|
||||
| "direct"
|
||||
| "surface_bridge"
|
||||
| "formula_derived"
|
||||
| "not_meaningful";
|
||||
confidence?: "high" | "medium" | "low";
|
||||
warningCodes?: string[];
|
||||
};
|
||||
|
||||
@@ -522,7 +546,7 @@ export type NormalizationSummary = {
|
||||
|
||||
export type NormalizationMetadata = {
|
||||
parserEngine: string;
|
||||
regime: 'us-gaap' | 'ifrs-full' | 'unknown';
|
||||
regime: "us-gaap" | "ifrs-full" | "unknown";
|
||||
fiscalPack: string | null;
|
||||
parserVersion: string;
|
||||
surfaceRowCount: number;
|
||||
@@ -549,7 +573,7 @@ export type StructuredKpiRow = {
|
||||
values: Record<string, number | null>;
|
||||
sourceConcepts: string[];
|
||||
sourceFactIds: number[];
|
||||
provenanceType: 'taxonomy' | 'structured_note';
|
||||
provenanceType: "taxonomy" | "structured_note";
|
||||
hasDimensions: boolean;
|
||||
};
|
||||
|
||||
@@ -577,12 +601,12 @@ export type TaxonomyFactRow = {
|
||||
};
|
||||
|
||||
export type MetricValidationCheck = {
|
||||
metricKey: keyof NonNullable<Filing['metrics']>;
|
||||
metricKey: keyof NonNullable<Filing["metrics"]>;
|
||||
taxonomyValue: number | null;
|
||||
llmValue: number | null;
|
||||
absoluteDiff: number | null;
|
||||
relativeDiff: number | null;
|
||||
status: 'not_run' | 'matched' | 'mismatch' | 'error';
|
||||
status: "not_run" | "matched" | "mismatch" | "error";
|
||||
evidencePages: number[];
|
||||
pdfUrl: string | null;
|
||||
provider: string | null;
|
||||
@@ -591,7 +615,7 @@ export type MetricValidationCheck = {
|
||||
};
|
||||
|
||||
export type MetricValidationResult = {
|
||||
status: 'not_run' | 'matched' | 'mismatch' | 'error';
|
||||
status: "not_run" | "matched" | "mismatch" | "error";
|
||||
checks: MetricValidationCheck[];
|
||||
validatedAt: string | null;
|
||||
};
|
||||
@@ -617,7 +641,7 @@ export type DimensionBreakdownRow = {
|
||||
member: string;
|
||||
value: number | null;
|
||||
unit: string | null;
|
||||
provenanceType?: 'taxonomy' | 'structured_note';
|
||||
provenanceType?: "taxonomy" | "structured_note";
|
||||
};
|
||||
|
||||
export type TrendSeries = {
|
||||
@@ -676,7 +700,7 @@ export type CompanyFinancialStatementsResponse = {
|
||||
queuedSync: boolean;
|
||||
};
|
||||
metrics: {
|
||||
taxonomy: Filing['metrics'];
|
||||
taxonomy: Filing["metrics"];
|
||||
validation: MetricValidationResult | null;
|
||||
};
|
||||
normalization: NormalizationMetadata;
|
||||
@@ -686,7 +710,7 @@ export type CompanyFinancialStatementsResponse = {
|
||||
export type CompanyAiReport = {
|
||||
accessionNumber: string;
|
||||
filingDate: string;
|
||||
filingType: Filing['filing_type'];
|
||||
filingType: Filing["filing_type"];
|
||||
provider: string;
|
||||
model: string;
|
||||
summary: string;
|
||||
@@ -708,7 +732,7 @@ export type CompanyProfile = {
|
||||
website: string | null;
|
||||
fiscalYearEnd: string | null;
|
||||
employeeCount: number | null;
|
||||
source: 'sec_derived' | 'unavailable';
|
||||
source: "sec_derived" | "unavailable";
|
||||
};
|
||||
|
||||
export type CompanyValuationSnapshot = {
|
||||
@@ -718,17 +742,22 @@ export type CompanyValuationSnapshot = {
|
||||
trailingPe: number | null;
|
||||
evToRevenue: number | null;
|
||||
evToEbitda: number | null;
|
||||
source: 'derived' | 'partial' | 'unavailable';
|
||||
source: "derived" | "partial" | "unavailable";
|
||||
};
|
||||
|
||||
export type CompanyBullBear = {
|
||||
source: 'ai_synthesized' | 'memo_fallback' | 'unavailable';
|
||||
source: "ai_synthesized" | "memo_fallback" | "unavailable";
|
||||
bull: string[];
|
||||
bear: string[];
|
||||
updatedAt: string | null;
|
||||
};
|
||||
|
||||
export type RecentDevelopmentKind = '8-K' | '10-K' | '10-Q' | 'press_release' | 'news';
|
||||
export type RecentDevelopmentKind =
|
||||
| "8-K"
|
||||
| "10-K"
|
||||
| "10-Q"
|
||||
| "press_release"
|
||||
| "news";
|
||||
|
||||
export type RecentDevelopmentItem = {
|
||||
id: string;
|
||||
@@ -748,11 +777,11 @@ export type RecentDevelopmentsWeeklySnapshot = {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
updatedAt: string;
|
||||
source: 'ai_synthesized' | 'heuristic';
|
||||
source: "ai_synthesized" | "heuristic";
|
||||
};
|
||||
|
||||
export type RecentDevelopments = {
|
||||
status: 'ready' | 'partial' | 'unavailable';
|
||||
status: "ready" | "partial" | "unavailable";
|
||||
items: RecentDevelopmentItem[];
|
||||
weeklySnapshot: RecentDevelopmentsWeeklySnapshot | null;
|
||||
};
|
||||
@@ -784,7 +813,7 @@ export type CompanyAnalysis = {
|
||||
latestFilingSummary: {
|
||||
accessionNumber: string;
|
||||
filingDate: string;
|
||||
filingType: Filing['filing_type'];
|
||||
filingType: Filing["filing_type"];
|
||||
filingUrl: string | null;
|
||||
submissionUrl: string | null;
|
||||
summary: string | null;
|
||||
@@ -805,8 +834,8 @@ export type CompanyAnalysis = {
|
||||
recentDevelopments: RecentDevelopments;
|
||||
};
|
||||
|
||||
export type NavGroup = 'overview' | 'research' | 'portfolio';
|
||||
export type NavMatchMode = 'exact' | 'prefix';
|
||||
export type NavGroup = "overview" | "research" | "portfolio";
|
||||
export type NavMatchMode = "exact" | "prefix";
|
||||
|
||||
export type NavItem = {
|
||||
id: string;
|
||||
@@ -824,8 +853,8 @@ export type ActiveContext = {
|
||||
};
|
||||
|
||||
// Chart Types
|
||||
export type ChartType = 'line' | 'combination';
|
||||
export type TimeRange = '1W' | '1M' | '3M' | '1Y' | '3Y' | '5Y' | '10Y' | '20Y';
|
||||
export type ChartType = "line" | "combination";
|
||||
export type TimeRange = "1W" | "1M" | "3M" | "1Y" | "3Y" | "5Y" | "10Y" | "20Y";
|
||||
|
||||
// Chart Data Formats
|
||||
export type PriceDataPoint = {
|
||||
@@ -849,7 +878,7 @@ export type DataSeries<T extends ChartDataPoint = ChartDataPoint> = {
|
||||
label: string;
|
||||
data: T[];
|
||||
color?: string;
|
||||
type?: 'line' | 'area' | 'bar';
|
||||
type?: "line" | "area" | "bar";
|
||||
visible?: boolean;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user