feat: add neighborhood ranking workflow

This commit is contained in:
2026-06-23 17:56:50 +08:00
parent b73a89e576
commit 1d5138d118
2 changed files with 203 additions and 5 deletions

View File

@@ -44,6 +44,31 @@ export type MarketOverview = {
highest_supply_risk_area: AreaScoreSummary | null;
};
export type NeighborhoodScore = {
neighborhood_id: string;
area_id: string;
name: string;
area_name: string;
district: string;
month: string;
investment_score: number;
recommendation: string;
liquidity_score: number;
rent_support_score: number;
price_safety_score: number;
location_score: number;
building_age_score: number;
transaction_count: number;
transaction_price_psm: number;
listing_count: number;
listing_price_psm: number;
rent_price_psm: number;
median_days_on_market: number;
annual_rent_yield_pct: number;
discount_pct: number;
available_units: number;
};
export type WatchlistItem = {
watchlist_item_id: number;
neighborhood_id: string | null;
@@ -71,6 +96,10 @@ export async function fetchAreaScores(month: string): Promise<AreaScore[]> {
return fetchJson(`/api/v1/areas/scores?month=${encodeURIComponent(month)}`);
}
export async function fetchNeighborhoodScores(month: string): Promise<NeighborhoodScore[]> {
return fetchJson(`/api/v1/neighborhoods/scores?month=${encodeURIComponent(month)}`);
}
export async function fetchWatchlistItems(): Promise<WatchlistItem[]> {
return fetchJson("/api/v1/watchlist");
}