Add research workspace and graphing flows
This commit is contained in:
100
lib/types.ts
100
lib/types.ts
@@ -8,6 +8,19 @@ export type User = {
|
||||
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';
|
||||
|
||||
export type WatchlistItem = {
|
||||
id: number;
|
||||
@@ -188,6 +201,93 @@ export type ResearchJournalEntry = {
|
||||
updated_at: string;
|
||||
};
|
||||
|
||||
export type ResearchArtifact = {
|
||||
id: number;
|
||||
user_id: string;
|
||||
organization_id: string | null;
|
||||
ticker: string;
|
||||
accession_number: string | null;
|
||||
kind: ResearchArtifactKind;
|
||||
source: ResearchArtifactSource;
|
||||
subtype: string | null;
|
||||
title: string | null;
|
||||
summary: string | null;
|
||||
body_markdown: string | null;
|
||||
search_text: string | null;
|
||||
visibility_scope: ResearchVisibilityScope;
|
||||
tags: string[];
|
||||
metadata: Record<string, unknown> | null;
|
||||
file_name: string | null;
|
||||
mime_type: string | null;
|
||||
file_size_bytes: number | null;
|
||||
storage_path: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
linked_to_memo: boolean;
|
||||
};
|
||||
|
||||
export type ResearchMemo = {
|
||||
id: number;
|
||||
user_id: string;
|
||||
organization_id: string | null;
|
||||
ticker: string;
|
||||
rating: ResearchMemoRating | null;
|
||||
conviction: ResearchMemoConviction | null;
|
||||
time_horizon_months: number | null;
|
||||
packet_title: string | null;
|
||||
packet_subtitle: string | null;
|
||||
thesis_markdown: string;
|
||||
variant_view_markdown: string;
|
||||
catalysts_markdown: string;
|
||||
risks_markdown: string;
|
||||
disconfirming_evidence_markdown: string;
|
||||
next_actions_markdown: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
};
|
||||
|
||||
export type ResearchMemoEvidenceLink = {
|
||||
id: number;
|
||||
memo_id: number;
|
||||
artifact_id: number;
|
||||
section: ResearchMemoSection;
|
||||
annotation: string | null;
|
||||
sort_order: number;
|
||||
created_at: string;
|
||||
artifact: ResearchArtifact;
|
||||
};
|
||||
|
||||
export type ResearchPacketSection = {
|
||||
section: ResearchMemoSection;
|
||||
title: string;
|
||||
body_markdown: string;
|
||||
evidence: ResearchMemoEvidenceLink[];
|
||||
};
|
||||
|
||||
export type ResearchPacket = {
|
||||
ticker: string;
|
||||
companyName: string | null;
|
||||
generated_at: string;
|
||||
memo: ResearchMemo | null;
|
||||
sections: ResearchPacketSection[];
|
||||
};
|
||||
|
||||
export type ResearchLibraryResponse = {
|
||||
artifacts: ResearchArtifact[];
|
||||
availableTags: string[];
|
||||
};
|
||||
|
||||
export type ResearchWorkspace = {
|
||||
ticker: string;
|
||||
companyName: string | null;
|
||||
coverage: WatchlistItem | null;
|
||||
latestFilingDate: string | null;
|
||||
memo: ResearchMemo | null;
|
||||
library: ResearchArtifact[];
|
||||
packet: ResearchPacket;
|
||||
availableTags: string[];
|
||||
};
|
||||
|
||||
export type CompanyFinancialPoint = {
|
||||
filingDate: string;
|
||||
filingType: Filing['filing_type'];
|
||||
|
||||
Reference in New Issue
Block a user