di-refactor coming along

This commit is contained in:
Boki 2025-06-22 18:14:34 -04:00
parent 7d9044ab29
commit 60ada5f6a3
20 changed files with 582 additions and 335 deletions

View file

@ -1,14 +1,17 @@
import { getLogger } from '@stock-bot/logger';
import { getPostgreSQLClient } from '../../../clients';
import type { ServiceContainer } from '@stock-bot/di';
import type { JobPayload } from '../../../types/job-payloads';
const logger = getLogger('enhanced-sync-exchange-stats');
export async function getExchangeStats(payload: JobPayload): Promise<any> {
export async function getExchangeStats(
payload: JobPayload,
container: ServiceContainer
): Promise<any> {
logger.info('Getting exchange statistics...');
try {
const postgresClient = getPostgreSQLClient();
const postgresClient = container.postgres;
const query = `
SELECT
COUNT(*) as total_exchanges,