import { BaseHandler, Handler, Operation, ScheduledOperation, type IServiceContainer, } from '@stock-bot/handlers'; import { fetchExchanges, fetchExchangesAndSymbols, fetchSession, fetchSymbols } from './actions'; @Handler('ib') export class IbHandler extends BaseHandler { constructor(services: IServiceContainer) { super(services); } @Operation('fetch-session') async fetchSession(): Promise | undefined> { return fetchSession(this); } @Operation('fetch-exchanges') async fetchExchanges(): Promise { return fetchExchanges(this); } @Operation('fetch-symbols') async fetchSymbols(): Promise { return fetchSymbols(this); } @Operation('ib-exchanges-and-symbols') @ScheduledOperation('ib-exchanges-and-symbols', '0 0 * * 0', { priority: 5, description: 'Fetch and update IB exchanges and symbols data', immediately: false, }) async fetchExchangesAndSymbols(): Promise { return fetchExchangesAndSymbols(this); } }