fixed some lint issues
This commit is contained in:
parent
566f5dac92
commit
969cbad7ac
14 changed files with 99 additions and 29 deletions
|
|
@ -4,16 +4,25 @@
|
|||
|
||||
import type { IServiceContainer } from '@stock-bot/handlers';
|
||||
|
||||
export async function fetchExchanges(services: IServiceContainer): Promise<any[]> {
|
||||
interface QMExchange {
|
||||
_id?: string;
|
||||
code: string;
|
||||
name: string;
|
||||
country: string;
|
||||
currency: string;
|
||||
timezone?: string;
|
||||
}
|
||||
|
||||
export async function fetchExchanges(services: IServiceContainer): Promise<QMExchange[]> {
|
||||
// Get exchanges from MongoDB
|
||||
const exchanges = await services.mongodb.collection('qm_exchanges').find({}).toArray();
|
||||
const exchanges = await services.mongodb.collection<QMExchange>('qm_exchanges').find({}).toArray();
|
||||
|
||||
return exchanges;
|
||||
}
|
||||
|
||||
export async function getExchangeByCode(services: IServiceContainer, code: string): Promise<any> {
|
||||
export async function getExchangeByCode(services: IServiceContainer, code: string): Promise<QMExchange | null> {
|
||||
// Get specific exchange by code
|
||||
const exchange = await services.mongodb.collection('qm_exchanges').findOne({ code });
|
||||
const exchange = await services.mongodb.collection<QMExchange>('qm_exchanges').findOne({ code });
|
||||
|
||||
return exchange;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,9 +41,14 @@ export async function checkSessions(handler: BaseHandler): Promise<{
|
|||
/**
|
||||
* Create a single session for a specific session ID
|
||||
*/
|
||||
interface CreateSessionInput {
|
||||
sessionId?: string;
|
||||
sessionType?: string;
|
||||
}
|
||||
|
||||
export async function createSingleSession(
|
||||
handler: BaseHandler,
|
||||
input: any
|
||||
input: CreateSessionInput
|
||||
): Promise<{ sessionId: string; status: string; sessionType: string }> {
|
||||
const { sessionId: _sessionId, sessionType } = input || {};
|
||||
const _sessionManager = QMSessionManager.getInstance();
|
||||
|
|
|
|||
|
|
@ -4,16 +4,26 @@
|
|||
|
||||
import type { IServiceContainer } from '@stock-bot/handlers';
|
||||
|
||||
export async function searchSymbols(services: IServiceContainer): Promise<any[]> {
|
||||
interface QMSymbol {
|
||||
_id?: string;
|
||||
symbol: string;
|
||||
name: string;
|
||||
exchange: string;
|
||||
type?: string;
|
||||
sector?: string;
|
||||
industry?: string;
|
||||
}
|
||||
|
||||
export async function searchSymbols(services: IServiceContainer): Promise<QMSymbol[]> {
|
||||
// Get symbols from MongoDB
|
||||
const symbols = await services.mongodb.collection('qm_symbols').find({}).limit(50).toArray();
|
||||
const symbols = await services.mongodb.collection<QMSymbol>('qm_symbols').find({}).limit(50).toArray();
|
||||
|
||||
return symbols;
|
||||
}
|
||||
|
||||
export async function fetchSymbolData(services: IServiceContainer, symbol: string): Promise<any> {
|
||||
export async function fetchSymbolData(services: IServiceContainer, symbol: string): Promise<QMSymbol | null> {
|
||||
// Fetch data for a specific symbol
|
||||
const symbolData = await services.mongodb.collection('qm_symbols').findOne({ symbol });
|
||||
const symbolData = await services.mongodb.collection<QMSymbol>('qm_symbols').findOne({ symbol });
|
||||
|
||||
return symbolData;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue