Implement dual-surface financials and db bootstrap
This commit is contained in:
38
lib/types.ts
38
lib/types.ts
@@ -213,6 +213,21 @@ export type TaxonomyStatementRow = {
|
||||
sourceFactIds: number[];
|
||||
};
|
||||
|
||||
export type FinancialStatementSurfaceKind = 'faithful' | 'standardized';
|
||||
|
||||
export type StandardizedStatementRow = {
|
||||
key: string;
|
||||
label: string;
|
||||
category: string;
|
||||
order: number;
|
||||
values: Record<string, number | null>;
|
||||
hasDimensions: boolean;
|
||||
sourceConcepts: string[];
|
||||
sourceRowKeys: string[];
|
||||
sourceFactIds: number[];
|
||||
resolvedSourceRowKeys: Record<string, string | null>;
|
||||
};
|
||||
|
||||
export type TaxonomyFactRow = {
|
||||
id: number;
|
||||
snapshotId: number;
|
||||
@@ -256,16 +271,6 @@ export type MetricValidationResult = {
|
||||
validatedAt: string | null;
|
||||
};
|
||||
|
||||
export type StandardizedStatementRow = {
|
||||
key: string;
|
||||
label: string;
|
||||
concept: string;
|
||||
category: string;
|
||||
sourceConcepts: string[];
|
||||
values: Record<string, number | null>;
|
||||
hasDimensions: boolean;
|
||||
};
|
||||
|
||||
export type FilingFaithfulStatementRow = {
|
||||
key: string;
|
||||
label: string;
|
||||
@@ -280,6 +285,8 @@ export type FilingFaithfulStatementRow = {
|
||||
export type DimensionBreakdownRow = {
|
||||
rowKey: string;
|
||||
concept: string | null;
|
||||
sourceRowKey: string | null;
|
||||
sourceLabel: string | null;
|
||||
periodId: string;
|
||||
axis: string;
|
||||
member: string;
|
||||
@@ -287,6 +294,11 @@ export type DimensionBreakdownRow = {
|
||||
unit: string | null;
|
||||
};
|
||||
|
||||
export type FinancialStatementSurface<Row> = {
|
||||
kind: FinancialStatementSurfaceKind;
|
||||
rows: Row[];
|
||||
};
|
||||
|
||||
export type CompanyFinancialStatementsResponse = {
|
||||
company: {
|
||||
ticker: string;
|
||||
@@ -295,8 +307,12 @@ export type CompanyFinancialStatementsResponse = {
|
||||
};
|
||||
statement: FinancialStatementKind;
|
||||
window: FinancialHistoryWindow;
|
||||
defaultSurface: FinancialStatementSurfaceKind;
|
||||
periods: FinancialStatementPeriod[];
|
||||
rows: TaxonomyStatementRow[];
|
||||
surfaces: {
|
||||
faithful: FinancialStatementSurface<TaxonomyStatementRow>;
|
||||
standardized: FinancialStatementSurface<StandardizedStatementRow>;
|
||||
};
|
||||
nextCursor: string | null;
|
||||
facts: {
|
||||
rows: TaxonomyFactRow[];
|
||||
|
||||
Reference in New Issue
Block a user