SCRAPE-9: Implement updateDailySummary() aggregation #14
Reference in New Issue
Block a user
No description provided.
Delete Branch "scraper/daily-summary"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements the
updateDailySummary()function inscraperService.jsthat aggregates daily apartment inventory data into thedaily_summariescollection.Key features:
new_units,rented_units, andstale_unitsarrays with corresponding count fieldsnet_changeas the difference between new and rented unit countstotal_available_todayand fetchestotal_available_yesterdayfrom the previous day's summaryturnover_rateas(rented_units_count / yesterday_total * 100), rounded to 2 decimal placesTest coverage:
Test plan
npm test -- --testPathPatterns="updateDailySummary"- 22/22 tests pass