Implement fiscal-style research MVP flows
Some checks failed
PR Checks / typecheck-and-build (push) Has been cancelled
Some checks failed
PR Checks / typecheck-and-build (push) Has been cancelled
This commit is contained in:
66
lib/types.ts
66
lib/types.ts
@@ -5,6 +5,10 @@ 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 WatchlistItem = {
|
||||
id: number;
|
||||
user_id: string;
|
||||
@@ -14,12 +18,18 @@ export type WatchlistItem = {
|
||||
category: string | null;
|
||||
tags: string[];
|
||||
created_at: string;
|
||||
status: CoverageStatus;
|
||||
priority: CoveragePriority;
|
||||
updated_at: string;
|
||||
last_reviewed_at: string | null;
|
||||
latest_filing_date: string | null;
|
||||
};
|
||||
|
||||
export type Holding = {
|
||||
id: number;
|
||||
user_id: string;
|
||||
ticker: string;
|
||||
company_name: string | null;
|
||||
shares: string;
|
||||
avg_cost: string;
|
||||
current_price: string | null;
|
||||
@@ -165,6 +175,19 @@ export type PortfolioInsight = {
|
||||
created_at: string;
|
||||
};
|
||||
|
||||
export type ResearchJournalEntry = {
|
||||
id: number;
|
||||
user_id: string;
|
||||
ticker: string;
|
||||
accession_number: string | null;
|
||||
entry_type: ResearchJournalEntryType;
|
||||
title: string | null;
|
||||
body_markdown: string;
|
||||
metadata: Record<string, unknown> | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
};
|
||||
|
||||
export type CompanyFinancialPoint = {
|
||||
filingDate: string;
|
||||
filingType: Filing['filing_type'];
|
||||
@@ -332,6 +355,28 @@ export type CompanyFinancialStatementsResponse = {
|
||||
pendingFilings: number;
|
||||
queuedSync: boolean;
|
||||
};
|
||||
overviewMetrics: {
|
||||
referencePeriodId: string | null;
|
||||
referenceDate: string | null;
|
||||
latest: {
|
||||
revenue: number | null;
|
||||
netIncome: number | null;
|
||||
totalAssets: number | null;
|
||||
cash: number | null;
|
||||
debt: number | null;
|
||||
};
|
||||
series: Array<{
|
||||
periodId: string;
|
||||
filingDate: string;
|
||||
periodEnd: string | null;
|
||||
label: string;
|
||||
revenue: number | null;
|
||||
netIncome: number | null;
|
||||
totalAssets: number | null;
|
||||
cash: number | null;
|
||||
debt: number | null;
|
||||
}>;
|
||||
};
|
||||
metrics: {
|
||||
taxonomy: Filing['metrics'];
|
||||
validation: MetricValidationResult | null;
|
||||
@@ -371,6 +416,27 @@ export type CompanyAnalysis = {
|
||||
financials: CompanyFinancialPoint[];
|
||||
filings: Filing[];
|
||||
aiReports: CompanyAiReport[];
|
||||
coverage: WatchlistItem | null;
|
||||
journalPreview: ResearchJournalEntry[];
|
||||
recentAiReports: CompanyAiReport[];
|
||||
latestFilingSummary: {
|
||||
accessionNumber: string;
|
||||
filingDate: string;
|
||||
filingType: Filing['filing_type'];
|
||||
filingUrl: string | null;
|
||||
submissionUrl: string | null;
|
||||
summary: string | null;
|
||||
hasAnalysis: boolean;
|
||||
} | null;
|
||||
keyMetrics: {
|
||||
referenceDate: string | null;
|
||||
revenue: number | null;
|
||||
netIncome: number | null;
|
||||
totalAssets: number | null;
|
||||
cash: number | null;
|
||||
debt: number | null;
|
||||
netMargin: number | null;
|
||||
};
|
||||
};
|
||||
|
||||
export type NavGroup = 'overview' | 'research' | 'portfolio';
|
||||
|
||||
Reference in New Issue
Block a user