Pre-web changes

This commit is contained in:
Eric Gullickson
2025-11-05 11:04:48 -06:00
parent 45fea0f307
commit 0c3ed01f4b
25 changed files with 257 additions and 3538 deletions

View File

@@ -7,6 +7,7 @@ import pool from '../../core/config/database';
import { cacheService } from '../../core/config/redis';
import { VINDecodeService } from './domain/vin-decode.service';
import { PlatformCacheService } from './domain/platform-cache.service';
import { VehicleDataService } from './domain/vehicle-data.service';
export { platformRoutes } from './api/platform.routes';
export { PlatformController } from './api/platform.controller';
@@ -18,6 +19,7 @@ export * from './models/responses';
// Singleton VIN decode service for use by other features
let vinDecodeServiceInstance: VINDecodeService | null = null;
let vehicleDataServiceInstance: VehicleDataService | null = null;
export function getVINDecodeService(): VINDecodeService {
if (!vinDecodeServiceInstance) {
@@ -27,6 +29,14 @@ export function getVINDecodeService(): VINDecodeService {
return vinDecodeServiceInstance;
}
export function getVehicleDataService(): VehicleDataService {
if (!vehicleDataServiceInstance) {
const platformCache = new PlatformCacheService(cacheService);
vehicleDataServiceInstance = new VehicleDataService(platformCache);
}
return vehicleDataServiceInstance;
}
// Helper to get pool for VIN decode service
export function getPool(): Pool {
return pool;