feat(analytics): add GET /analytics/market-history endpoint

Time-series endpoint returning monthly/weekly market data points
for the analytics page. Queries MarketIndex aggregated by period
with 6-hour Redis cache. Includes unit tests.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-21 02:37:10 +07:00
parent 0651074319
commit f7b0fe6f5d
9 changed files with 297 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import { GetDistrictStatsHandler } from './application/queries/get-district-stat
import { GetHeatmapHandler } from './application/queries/get-heatmap/get-heatmap.handler';
import { GetListingAiAdviceHandler } from './application/queries/get-listing-ai-advice/get-listing-ai-advice.handler';
import { GetMarketReportHandler } from './application/queries/get-market-report/get-market-report.handler';
import { GetMarketHistoryHandler } from './application/queries/get-market-history/get-market-history.handler';
import { GetMarketSnapshotHandler } from './application/queries/get-market-snapshot/get-market-snapshot.handler';
import { GetPriceMoversHandler } from './application/queries/get-price-movers/get-price-movers.handler';
import { GetProjectAiAdviceHandler } from './application/queries/get-project-ai-advice/get-project-ai-advice.handler';
@@ -49,6 +50,7 @@ const CommandHandlers = [
const QueryHandlers = [
GetMarketReportHandler,
GetMarketHistoryHandler,
GetHeatmapHandler,
GetPriceTrendHandler,
GetDistrictStatsHandler,