Added Documents Feature
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Logger } from 'winston';
|
||||
import { PlatformVehiclesClient } from '../external/platform-vehicles/platform-vehicles.client';
|
||||
import { VPICClient } from '../external/vpic/vpic.client';
|
||||
import { env } from '../../../core/config/environment';
|
||||
import { appConfig } from '../../../core/config/config-loader';
|
||||
|
||||
|
||||
/**
|
||||
@@ -22,7 +22,7 @@ export class PlatformIntegrationService {
|
||||
this.vpicClient = vpicClient;
|
||||
|
||||
// Feature flag - can be environment variable or runtime config
|
||||
this.usePlatformService = env.NODE_ENV !== 'test'; // Use platform service except in tests
|
||||
this.usePlatformService = appConfig.config.server.environment !== 'test'; // Use platform service except in tests
|
||||
|
||||
this.logger.info(`Vehicle service integration initialized: usePlatformService=${this.usePlatformService}`);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { logger } from '../../../core/logging/logger';
|
||||
import { cacheService } from '../../../core/config/redis';
|
||||
import { isValidVIN } from '../../../shared-minimal/utils/validators';
|
||||
import { env } from '../../../core/config/environment';
|
||||
import { appConfig } from '../../../core/config/config-loader';
|
||||
import { normalizeMakeName, normalizeModelName } from './name-normalizer';
|
||||
|
||||
export class VehiclesService {
|
||||
@@ -26,10 +26,11 @@ export class VehiclesService {
|
||||
|
||||
constructor(private repository: VehiclesRepository) {
|
||||
// Initialize platform vehicles client
|
||||
const platformConfig = appConfig.getPlatformServiceConfig('vehicles');
|
||||
const platformClient = new PlatformVehiclesClient({
|
||||
baseURL: env.PLATFORM_VEHICLES_API_URL,
|
||||
apiKey: env.PLATFORM_VEHICLES_API_KEY,
|
||||
tenantId: process.env.TENANT_ID,
|
||||
baseURL: platformConfig.url,
|
||||
apiKey: platformConfig.apiKey,
|
||||
tenantId: appConfig.config.server.tenant_id,
|
||||
timeout: 3000,
|
||||
logger
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
import { env } from '../../../../core/config/environment';
|
||||
import { appConfig } from '../../../../core/config/config-loader';
|
||||
import { logger } from '../../../../core/logging/logger';
|
||||
import { cacheService } from '../../../../core/config/redis';
|
||||
import {
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
} from './vpic.types';
|
||||
|
||||
export class VPICClient {
|
||||
private readonly baseURL = env.VPIC_API_URL;
|
||||
private readonly baseURL = appConfig.config.external.vpic.url;
|
||||
private readonly cacheTTL = 30 * 24 * 60 * 60; // 30 days in seconds
|
||||
private readonly dropdownCacheTTL = 7 * 24 * 60 * 60; // 7 days for dropdown data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user