- Add bundled financial modeling pipeline (ratios, KPI dimensions/notes, trend series, standardization) - Introduce company financial bundles storage (Drizzle migration + repo wiring) - Refactor financials page/API/query flow to use surfaceKind + cadence and new response shapes
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import type {
|
|
CompanyFinancialStatementsResponse,
|
|
FinancialCadence,
|
|
FinancialSurfaceKind
|
|
} from '@/lib/types';
|
|
import {
|
|
defaultFinancialSyncLimit,
|
|
getCompanyFinancials
|
|
} from '@/lib/server/financial-taxonomy';
|
|
|
|
type GetCompanyFinancialStatementsInput = {
|
|
ticker: string;
|
|
surfaceKind: FinancialSurfaceKind;
|
|
cadence: FinancialCadence;
|
|
includeDimensions: boolean;
|
|
includeFacts?: boolean;
|
|
factsCursor?: string | null;
|
|
factsLimit?: number;
|
|
cursor?: string | null;
|
|
limit?: number;
|
|
v2Enabled?: boolean;
|
|
v3Enabled?: boolean;
|
|
queuedSync: boolean;
|
|
};
|
|
|
|
export async function getCompanyFinancialStatements(
|
|
input: GetCompanyFinancialStatementsInput
|
|
): Promise<CompanyFinancialStatementsResponse> {
|
|
return await getCompanyFinancials({
|
|
ticker: input.ticker,
|
|
surfaceKind: input.surfaceKind,
|
|
cadence: input.cadence,
|
|
includeDimensions: input.includeDimensions,
|
|
includeFacts: input.includeFacts ?? false,
|
|
factsCursor: input.factsCursor,
|
|
factsLimit: input.factsLimit,
|
|
cursor: input.cursor,
|
|
limit: input.limit,
|
|
v3Enabled: input.v3Enabled ?? input.v2Enabled ?? true,
|
|
queuedSync: input.queuedSync
|
|
});
|
|
}
|
|
|
|
export { defaultFinancialSyncLimit };
|
|
|
|
export const __financialStatementsInternals = {
|
|
defaultFinancialSyncLimit
|
|
};
|