updated symbols

This commit is contained in:
Boki 2025-06-29 13:32:55 -04:00
parent 44fa3e8c0c
commit 11eb470e5f

View file

@ -73,10 +73,10 @@ export async function spiderSymbol(
// Extract and store unique exchanges
const exchanges: Exchange[] = [];
for (const symbol of symbols) {
if (symbol.exchangeCode && !exchanges.some(ex => ex.exchange === symbol.exchangeCode)) {
if (symbol.exchange && !exchanges.some(ex => ex.exchange === symbol.exchange)) {
exchanges.push({
exchange: symbol.exchangeCode,
exchangeName: symbol.exchangeShortName || '',
exchange: symbol.exchange,
exchangeName: symbol.exchangeName || '',
countryCode: symbol.countryCode || '',
source: 'qm',
});
@ -186,11 +186,16 @@ export async function searchSymbols(
await sessionManager.incrementSuccessfulCalls(sessionId, session.uuid);
// Process symbol data
const processedSymbols = Array.isArray(symbols) ? symbols.map((symbol: any) => ({
...symbol,
qmSearchCode: symbol.symbol || '',
symbol: (symbol.symbol as string)?.split(':')[0] || '',
})) : [];
const processedSymbols = Array.isArray(symbols) ? symbols.map((symbol: any) => {
const { exchangeCode, exchangeShortName, ...rest } = symbol;
return {
...rest,
exchange: exchangeCode,
exchangeName: exchangeShortName,
qmSearchCode: symbol.symbol,
symbol: (symbol.symbol as string)?.split(':')[0],
};
}) : [];
this.logger.debug('QM API returned symbols ${query} - ${processedSymbols.length}', {
query,