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,27 +1,8 @@
import { MongoDBClient } from '@stock-bot/mongodb';
import { PostgreSQLClient } from '@stock-bot/postgres';
/**
* Client exports for backward compatibility
*
* @deprecated Use ServiceContainer parameter instead
* This file will be removed once all operations are migrated
*/
let postgresClient: PostgreSQLClient | null = null;
let mongodbClient: MongoDBClient | null = null;
export function setPostgreSQLClient(client: PostgreSQLClient): void {
postgresClient = client;
}
export function getPostgreSQLClient(): PostgreSQLClient {
if (!postgresClient) {
throw new Error('PostgreSQL client not initialized. Call setPostgreSQLClient first.');
}
return postgresClient;
}
export function setMongoDBClient(client: MongoDBClient): void {
mongodbClient = client;
}
export function getMongoDBClient(): MongoDBClient {
if (!mongodbClient) {
throw new Error('MongoDB client not initialized. Call setMongoDBClient first.');
}
return mongodbClient;
}
export { getMongoDBClient, getPostgreSQLClient } from './migration-helper';