feat(analytics): add GET /analytics/market-snapshot endpoint
Dashboard tile endpoint returning activeCount, avgPrice, medianPrice, priceChangePct (1d/7d/30d), avgPricePerM2, daysOnMarket, newListings24h. Redis cache-aside with 5min TTL. CQRS query handler with parallel Prisma queries for p95 <200ms on cache hit. Refs: TEC-3049 Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { PropertyType } from '@prisma/client';
|
||||
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class GetMarketSnapshotDto {
|
||||
@ApiProperty({ description: 'City name', example: 'HCMC' })
|
||||
@IsString()
|
||||
city!: string;
|
||||
|
||||
@ApiPropertyOptional({ enum: PropertyType, description: 'Property type filter' })
|
||||
@IsOptional()
|
||||
@IsEnum(PropertyType)
|
||||
propertyType?: PropertyType;
|
||||
}
|
||||
Reference in New Issue
Block a user