New module lib/listing-personas.ts derives persona tags and a short
"why live here" narrative from data the UI already has — the listing,
the neighborhood score, and the nearby POI list returned by Phase C.
Persona detection (emoji + short Vietnamese label):
- Gia đình có con nhỏ — educationScore ≥ 7 AND bedrooms ≥ 2
- Gia đình trẻ — exactly 2 PN AND healthcareScore ≥ 7
- Người đi làm xa — metroDistanceM ≤ 1 km OR transportScore ≥ 7 OR ≥ 2 transit POIs
- Người trẻ / độc thân — ≤ 1 PN OR (apartment + shopping ≥ 7 + ≥ 2 restaurants)
- Yêu thiên nhiên — greeneryScore ≥ 7 OR ≥ 1 park POI
- Ưu tiên an ninh — safetyScore ≥ 8
- Người lớn tuổi — healthcareScore ≥ 8 AND ≥ 2 hospital POIs
- Nhà đầu tư — SALE + totalScore ≥ 75 + transportScore ≥ 7
Each persona carries a concrete reason string (uses POI counts and
metro distance when available). The narrative highlights the top 3
categories scoring ≥ 7 with a matching POI detail.
UI: PersonaFitCard sits between the quick-specs bar and the main grid
with primary/5 background so it reads as a feature. Renders:
1) chips for each matching persona, 2) a tight bullet list of reasons,
3) the "Vì sao nên ở đây" narrative block. Silently collapses when no
personas match AND no narrative can be composed.
No schema change, no backend change. Phase D of 4 (next: Phase B schema
columns for admin-authored overrides + Phase E AI advisor with Opus).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>