Requirements And Records ======================== These models are the shared data shapes used by extraction, matching, and API responses. They intentionally keep raw owner, tenant, and token data out of the matching layer. .. autoclass:: app.alba_core.models.RentalRequirements :members: Example: merge conversation turns --------------------------------- .. code-block:: python from app.alba_core.models import RentalRequirements first_turn = RentalRequirements(city="Auckland", budget_max=5000) second_turn = RentalRequirements(bedrooms_min=4, property_type="house") requirements = first_turn.merge(second_turn) print(requirements.is_search_ready) print(requirements.to_dict()) .. autoclass:: app.alba_core.models.PropertyRecord :members: Example: public API output -------------------------- .. code-block:: python from app.propertyme.cache import load_property_cache properties = load_property_cache("data/propertyme_property_seed_latest.json") public_property = properties[0].to_public_dict() print(public_property["address"]) print(public_property["rent_pw"]) .. autoclass:: app.alba_core.models.MatchResult :members: Example: serialise a match result --------------------------------- .. code-block:: python 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) match = PropertyMatcher().match(requirements, properties).matches[0] print(match.to_dict()) .. autofunction:: app.alba_core.models.clean_text