import {
  BaseHandler,
  Disabled,
  Handler,
  ScheduledOperation
} from '@stock-bot/handlers';
import type { DataIngestionServices } from '../../types';
import { fetchCountries, spiderUrl } from './actions';

@Handler('te')
@Disabled()
export class TeHandler extends BaseHandler<DataIngestionServices> {
  constructor(services: any) {
    super(services);
  }

  @ScheduledOperation('te-countries', '0 0 * * 0', {
    priority: 5,
    description: 'Fetch and update Trading Economics countries data',
    immediately: false,
  })
  @Disabled()
  fetchCountries = fetchCountries;

  @ScheduledOperation('te-spider', '0 0 * * 0', {
    priority: 5,
    description: 'Fetch and update Trading Economics countries data',
    immediately: false,
  })
  spiderUrlSchedule = spiderUrl;
}