feat(analytics): add Redis 24h cache to neighborhood score endpoint (TEC-3072)
The GET /neighborhoods/:district/score handler was missing Redis caching. Adds NEIGHBORHOOD_SCORE CachePrefix + CacheTTL (24h) and wires CacheService.getOrSet into GetNeighborhoodScoreHandler. Updates handler tests to cover cache behavior. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -45,6 +45,8 @@ export const CacheTTL = {
|
||||
MARKET_HISTORY: 21600, // 6 hours
|
||||
/** AVM valuation estimate per listing — long TTL, model outputs are stable within a day */
|
||||
VALUATION_LISTING: 86400, // 24 h
|
||||
/** [TEC-3072] Neighborhood score — 24h TTL, POI data changes infrequently */
|
||||
NEIGHBORHOOD_SCORE: 86400, // 24 h
|
||||
} as const;
|
||||
|
||||
export enum CachePrefix {
|
||||
@@ -67,6 +69,8 @@ export enum CachePrefix {
|
||||
TRENDING_AREAS = 'cache:analytics:trending_areas',
|
||||
PRICE_MOVERS = 'cache:analytics:price_movers',
|
||||
MARKET_HISTORY = 'cache:analytics:market_history',
|
||||
/** [TEC-3072] Neighborhood score per district */
|
||||
NEIGHBORHOOD_SCORE = 'cache:analytics:neighborhood_score',
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
|
||||
Reference in New Issue
Block a user