Pre-web changes
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user