Lead Summaries

Lead summaries are staff handoffs. They should report confirmed requirements, real matching properties, and honest no-match guidance.

app.alba_core.leads.build_lead_summary(requirements: RentalRequirements, matches: list[MatchResult]) str[source]

Create a plain staff handoff summary from verified Alba Core output.

The summary is deliberately practical: confirmed requirements first, then real suggested properties with PropertyMe references.

app.alba_core.leads.money(value: float | None) str[source]

Format a weekly rent value for summaries.

Example

from app.alba_core.leads import build_lead_summary
from app.alba_core.matching import PropertyMatcher
from app.alba_core.models import RentalRequirements
from app.propertyme.cache import load_property_cache

properties = load_property_cache("data/propertyme_property_seed_latest.json")
requirements = RentalRequirements(city="Auckland", budget_max=5000, bedrooms_min=4)
matches = PropertyMatcher(top_n=3).match(requirements, properties).matches

summary = build_lead_summary(requirements, matches)
print(summary)

No-match example

summary = build_lead_summary(
    RentalRequirements(city="Auckland", budget_max=100, bedrooms_min=8),
    [],
)

print(summary)