Possible working ETL
This commit is contained in:
@@ -94,21 +94,41 @@ export class PlatformCacheService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cached transmissions for year, make, and model
|
||||
* Get cached transmissions for year, make, model, and trim
|
||||
*/
|
||||
async getTransmissions(year: number, make: string, model: string): Promise<string[] | null> {
|
||||
const key = this.prefix + 'vehicle-data:transmissions:' + year + ':' + make + ':' + model;
|
||||
async getTransmissionsForTrim(year: number, make: string, model: string, trim: string): Promise<string[] | null> {
|
||||
const key = this.prefix + 'vehicle-data:transmissions:' + year + ':' + make + ':' + model + ':' + trim;
|
||||
return await this.cacheService.get<string[]>(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cached transmissions for year, make, and model
|
||||
* Set cached transmissions for year, make, model, and trim
|
||||
*/
|
||||
async setTransmissions(year: number, make: string, model: string, transmissions: string[], ttl: number = 6 * 3600): Promise<void> {
|
||||
const key = this.prefix + 'vehicle-data:transmissions:' + year + ':' + make + ':' + model;
|
||||
async setTransmissionsForTrim(year: number, make: string, model: string, trim: string, transmissions: string[], ttl: number = 6 * 3600): Promise<void> {
|
||||
const key = this.prefix + 'vehicle-data:transmissions:' + year + ':' + make + ':' + model + ':' + trim;
|
||||
await this.cacheService.set(key, transmissions, ttl);
|
||||
}
|
||||
|
||||
async getTransmissionsForTrimAndEngine(year: number, make: string, model: string, trim: string, engine: string): Promise<string[] | null> {
|
||||
const key = this.prefix + 'vehicle-data:transmissions:' + year + ':' + make + ':' + model + ':' + trim + ':engine:' + engine;
|
||||
return await this.cacheService.get<string[]>(key);
|
||||
}
|
||||
|
||||
async setTransmissionsForTrimAndEngine(year: number, make: string, model: string, trim: string, engine: string, transmissions: string[], ttl: number = 6 * 3600): Promise<void> {
|
||||
const key = this.prefix + 'vehicle-data:transmissions:' + year + ':' + make + ':' + model + ':' + trim + ':engine:' + engine;
|
||||
await this.cacheService.set(key, transmissions, ttl);
|
||||
}
|
||||
|
||||
async getEnginesForTrimAndTransmission(year: number, make: string, model: string, trim: string, transmission: string): Promise<string[] | null> {
|
||||
const key = this.prefix + 'vehicle-data:engines:' + year + ':' + make + ':' + model + ':' + trim + ':transmission:' + transmission;
|
||||
return await this.cacheService.get<string[]>(key);
|
||||
}
|
||||
|
||||
async setEnginesForTrimAndTransmission(year: number, make: string, model: string, trim: string, transmission: string, engines: string[], ttl: number = 6 * 3600): Promise<void> {
|
||||
const key = this.prefix + 'vehicle-data:engines:' + year + ':' + make + ':' + model + ':' + trim + ':transmission:' + transmission;
|
||||
await this.cacheService.set(key, engines, ttl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cached VIN decode result
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user