Add analytics endpoint, price history API, and fix daysAvailable calculation

- Fix daysAvailable to detect gaps >25 days (indicates unit was re-listed)
- Add /unit/:unitCode/price-history endpoint for full price history
- Add /analytics endpoint with monthly trends, seasonality analysis,
  plan performance, historical comparisons, and price per sqft stats
- Add /last-scrape endpoint to return timestamp of most recent data
- Increase priceHistory limit from 5 to 30 for better chart data
This commit is contained in:
2026-01-21 10:10:39 -07:00
parent e9b4528dc5
commit c851a26beb

1149
server.js

File diff suppressed because it is too large Load Diff