From 69a9b28c215e469759776903fcc438325d266607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kadir=20G=C3=BCnay?= <42644031+kdrgny-dev@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:15:21 +0300 Subject: [PATCH] kesif: konut ve tipsiz kayitlari sonuclardan ele MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ayvalik merkezde 3 km taramada donen 20 sonucun ikisi satilabilir bir isletme degildi: bir apartman girisi (apartment_building) ve hic primaryType'i olmayan bir kayit. - DEFAULT_EXCLUDED_TYPES'a konut tipleri eklendi (apartment_building, apartment_complex, condominium_complex, housing_complex). Dordu de Table A'da, excludedTypes degeri olarak canli API'de tek tek dogrulandi (hepsi HTTP 200). - Ayni sekilde bus_stop ve transit_depot eklendi; listedeki mevcut toplu tasima niyetini tamamliyor, bus_station tek basina duraklari kacirıyordu. - primaryType'i olmayan kayitlar post-filter'da eleniyor. Google'in destekledigi hicbir kategoriye girmeyen bu kayitlar pratikte yarim kalmis harita girdileri oluyor. Ayni koordinatta once/sonra: 20 sonuc (2 cop) -> 19 sonuc (0 cop), mesru kategorilerin hepsi yerinde. Co-Authored-By: Claude Opus 5 --- server/utils/places.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/server/utils/places.ts b/server/utils/places.ts index 9367fc9..e87918f 100644 --- a/server/utils/places.ts +++ b/server/utils/places.ts @@ -24,15 +24,16 @@ export async function geocodeAddress(address: string, apiKey: string): Promise !POST_FILTER_EXCLUDED_TYPES.includes(p.primaryType ?? '')) + // A missing primaryType means Google has no supported category for the place + // at all. In practice these are half-registered map entries ("kırmızı el + // arabası", a person's name on a doorway) — never something to sell to. + const filtered = (res.places ?? []) + .filter(p => p.primaryType) + .filter(p => !POST_FILTER_EXCLUDED_TYPES.includes(p.primaryType!)) return filtered.map((p) => { const reviews: ReviewSnippet[] = (p.reviews ?? [])