al_ard legacy filter audit (WS3 canonicalization) โ
After 20260612220000_ws3_brokerage_taxonomy.sql, properties_base.al_ard stores English machine keys (available, sold_by_us, โฆ). Several DB objects still filtered on legacy Arabic literals, which broke public catalog visibility for new listings.
Migration 20260630110000_fix_catalog_al_ard_available_keys.sql introduces property_is_catalog_live(al_ard, show_in_catalog) and patches the objects below.
Fixed in 20260630110000 โ
| Object | Previous filter | New filter |
|---|---|---|
property_is_catalog_live() | โ (new helper) | show_in_catalog AND al_ard IN ('available', 'ู
ุนุฑูุถ') |
get_catalog_properties() | al_ard = 'ู
ุนุฑูุถ' (web regression in 20260628180141) | property_is_catalog_live(...) |
api.get_catalog_properties() | wrapper | unchanged (delegates to public) |
properties_catalog view | al_ard = 'available' only | property_is_catalog_live(...) |
get_public_bundle() | show_in_catalog AND al_ard = 'available' | property_is_catalog_live(...) |
ceo_dashboard_stats() property active count | al_ard = 'available' | al_ard IN ('available', 'ู
ุนุฑูุถ') |
Already correct (English-only, no change needed) โ
These objects were patched in WS3 partial migrations and already use al_ard = 'available':
check_duplicate_active_listingtriggercheck_property_alerts_on_new_listingtriggerget_area_market_reportget_matches_by_client_tokennotify_matching_requests/notify_on_property_status_match/notify_on_request_matchnotify_matching_whatsapp_triggertransfer_approved_submission(default insert)- Request match notifications (
20260613160000,20260630120000)
Arabic prose in exception/notification messages (e.g. 'ุนูุงุฑ ู
ุนุฑูุถ') is intentional copy โ not DB filters.
Intentionally not changed โ
| Object | Reason |
|---|---|
check_property_alerts edge fn | Already accepts both keys in application code |
| Duplicate-listing guards | Only available rows are active listings post-WS3 CHECK |
| WhatsApp catalog sync | Reads properties table directly; staff must set show_in_catalog + available |
Client parity โ
Flutter propertyIsCatalogLive() mirrors the SQL helper for share-text and UI gates.
Verification โ
sql
-- Should return rows where show_in_catalog=true AND al_ard='available'
SELECT count(*) FROM get_catalog_properties();
SELECT property_is_catalog_live('available', true); -- true
SELECT property_is_catalog_live('ู
ุนุฑูุถ', true); -- true
SELECT property_is_catalog_live('sold_by_us', true); -- false