feat(analytics): add GET /analytics/price-movers endpoint
Top tăng/giảm giá theo district cho Home dashboard. Compares avg listing prices between current and previous time windows, filters by min sample size (10), caches for 30 min. TEC-3053 Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -37,6 +37,8 @@ export const CacheTTL = {
|
||||
MARKET_SNAPSHOT: 300, // 5 min
|
||||
/** Trending areas — 30 min TTL, aggregation is expensive */
|
||||
TRENDING_AREAS: 1800, // 30 min
|
||||
/** Price movers — 30 min TTL, aggregation over two time windows */
|
||||
PRICE_MOVERS: 1800, // 30 min
|
||||
} as const;
|
||||
|
||||
export enum CachePrefix {
|
||||
@@ -55,6 +57,7 @@ export enum CachePrefix {
|
||||
AGENT_LISTINGS = 'cache:agent:listings',
|
||||
MARKET_SNAPSHOT = 'cache:analytics:market_snapshot',
|
||||
TRENDING_AREAS = 'cache:analytics:trending_areas',
|
||||
PRICE_MOVERS = 'cache:analytics:price_movers',
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
|
||||
Reference in New Issue
Block a user