AI Hub pricing contract (Flutter β Hermes β suggest-price) β
Mobile AI Center sends structured payloads only β never free-text location, type, or condition.
Quick Estimate routing β
- Primary:
POST ${HERMES_URL}/chatwithuse_case: suggest_priceandcontext(see below). - Fallback: Supabase edge fn
suggest-pricewith the same semantic payload when Hermes returns 5xx/network or non-JSON output.
Context shapes β
CRM property (default) β
json
{ "property_id": "<uuid>" }Server loads properties row and joins comparable_sales, real_estate_transactions, market_parameters.
Structured fallback (property not in CRM) β
English machine keys only:
json
{
"governorate": "hawalli",
"area_key": "salmiya",
"al_wada": "built",
"property_category": "residential_private",
"al_hala": "good",
"size_sqm": 400,
"block": "5"
}Edge-fn fallback additionally maps area_key β Arabic area label and property_category β Arabic property_type for comparable filters.
Content tab β
POST ${HERMES_URL}/chat with:
json
{
"use_case": "property_desc",
"context": {
"property_id": "<uuid>",
"content_type": "property_description | market_report | valuation_summary",
"locale": "ar | en",
"instruction": "..."
}
}Circuit-breaker falls back to ai-assistant edge fn (same use_case + context).
Response (pricing) β
JSON matching SuggestPriceEstimate in lib/data/models/suggest_price.dart:
estimated_price_per_sqm,min_price_per_sqm,max_price_per_sqmtotal_estimated_value,confidence,reasoning,market_trendcomparable_count,data_sources,ai_powered
Server work (aldilaijanre) β
Ensure suggest-price and Hermes suggest_price accept property_id and structured canonical maps; fetch comparables server-side. See HERMES_AI_GATEWAY.md.
