Add last_status_change_date field for hour-level precision in date filtering

Enhances pending_date and last_sold_date with hour-level precision by introducing the last_status_change_date field. This allows for more accurate filtering of PENDING and SOLD properties when using past_hours parameter. Includes comprehensive tests and version bump to 0.7.1.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Zachary Hampton
2025-11-05 10:09:58 -08:00
parent 4d31e6221f
commit 1608020b69
9 changed files with 253 additions and 7 deletions

View File

@@ -36,6 +36,7 @@ ordered_properties = [
"sold_price",
"last_sold_date",
"last_sold_price",
"last_status_change_date",
"assessed_value",
"estimated_value",
"tax",
@@ -120,7 +121,7 @@ def process_result(result: Property) -> pd.DataFrame:
prop_data["nearby_schools"] = ", ".join(set(prop_data["nearby_schools"])) if prop_data["nearby_schools"] else None
# Convert datetime objects to strings for CSV (preserve full datetime including time)
for date_field in ["list_date", "pending_date", "last_sold_date"]:
for date_field in ["list_date", "pending_date", "last_sold_date", "last_status_change_date"]:
if prop_data.get(date_field):
prop_data[date_field] = prop_data[date_field].strftime("%Y-%m-%d %H:%M:%S") if hasattr(prop_data[date_field], 'strftime') else prop_data[date_field]