From 566f5dac92006afa55e454804b543bbb281ebb0f Mon Sep 17 00:00:00 2001 From: Boki Date: Mon, 23 Jun 2025 22:51:55 -0400 Subject: [PATCH] removed more stuff --- .../process-individual-symbol.action.ts | 32 ++++++++++-- libs/data/questdb/src/types.ts | 49 ------------------- 2 files changed, 29 insertions(+), 52 deletions(-) diff --git a/apps/stock/data-ingestion/src/handlers/ceo/actions/process-individual-symbol.action.ts b/apps/stock/data-ingestion/src/handlers/ceo/actions/process-individual-symbol.action.ts index 58096c6..3e1f0c9 100644 --- a/apps/stock/data-ingestion/src/handlers/ceo/actions/process-individual-symbol.action.ts +++ b/apps/stock/data-ingestion/src/handlers/ceo/actions/process-individual-symbol.action.ts @@ -1,10 +1,16 @@ import { getRandomUserAgent } from '@stock-bot/utils'; import type { CeoHandler } from '../ceo.handler'; +interface ProcessIndividualSymbolPayload { + ceoId: string; + symbol: string; + timestamp?: string; +} + export async function processIndividualSymbol( this: CeoHandler, - payload: any, - _context: any + payload: ProcessIndividualSymbolPayload, + _context: unknown ): Promise { const { ceoId, symbol, timestamp } = payload; const proxy = this.proxy?.getProxy(); @@ -42,7 +48,27 @@ export async function processIndividualSymbol( return null; // No data to process } const latestSpielTime = data.spiels[0]?.timestamp; - const posts = data.spiels.map((spiel: any) => ({ + interface Spiel { + spiel: string; + spiel_reply_to_id: string; + spiel_reply_to: string; + spiel_reply_to_name: string; + spiel_reply_to_edited: boolean; + user_id: string; + name: string; + timestamp: string; + spiel_id: string; + color: string; + parent_id: string; + public_id: string; + parent_channel: string; + parent_timestamp: string; + votes: number; + editable: boolean; + edited: boolean; + } + + const posts = data.spiels.map((spiel: Spiel) => ({ ceoId, spiel: spiel.spiel, spielReplyToId: spiel.spiel_reply_to_id, diff --git a/libs/data/questdb/src/types.ts b/libs/data/questdb/src/types.ts index 5ec8a0e..f1514d6 100644 --- a/libs/data/questdb/src/types.ts +++ b/libs/data/questdb/src/types.ts @@ -146,34 +146,6 @@ export interface InsertResult { errors?: string[]; } -/** - * Schema Definition Types - */ -interface ColumnDefinition { - name: string; - type: - | 'SYMBOL' - | 'STRING' - | 'DOUBLE' - | 'FLOAT' - | 'LONG' - | 'INT' - | 'BOOLEAN' - | 'TIMESTAMP' - | 'DATE' - | 'BINARY'; - indexed?: boolean; - capacity?: number; // For SYMBOL type -} - -interface TableDefinition { - name: string; - columns: ColumnDefinition[]; - partitionBy?: 'NONE' | 'DAY' | 'MONTH' | 'YEAR'; - timestamp?: string; // Column name to use as designated timestamp - dedup?: boolean; -} - /** * Connection Pool Types */ @@ -210,27 +182,6 @@ export interface PerformanceMetrics { memoryUsage: number; } -/** - * Query Builder Types - */ -interface TimeSeriesQuery { - table: TableNames | string; - columns?: string[]; - timeRange?: TimeRange; - groupBy?: string[]; - aggregations?: Record; - sampleBy?: string; - latestBy?: string[]; - orderBy?: Array<{ column: string; direction: 'ASC' | 'DESC' }>; - limit?: number; -} - -interface AggregationQuery { - aggregations: Record; - groupBy?: string[]; - having?: string[]; -} - export interface TimeRange { startTime: Date; endTime: Date;