Fixes 500 on /trade-in/api/v1/geocode/reverse when Nominatim bans prod IP after geocode_missing batch. Cadastral lookup via main backend new endpoint /api/v1/cadastral/reverse is primary (37k buildings in ЕКБ, <10ms, no external API). Nominatim is fallback wrapped in try/except so HTTPStatusError no longer bubbles to FastAPI 500. Architecture: - main backend: new GET /api/v1/cadastral/reverse — cad_buildings nearest within radius, filters out гаражи/СНТ. Added to gendesign_shared network with alias gendesign-backend for cross-stack DNS. - tradein backend: _cadastral_reverse() calls main backend, returns None on any error. reverse_geocode prefers cadastral → falls back to Nominatim → returns None (endpoint becomes 404 instead of 500). Env: MAIN_BACKEND_URL=http://gendesign-backend:8000 in tradein prod. Tests: 7 new cases covering cadastral/nominatim/fallback/error paths. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| admin_cadastre.py | ||
| admin_etl.py | ||
| admin_jobs.py | ||
| admin_leads.py | ||
| admin_scrape.py | ||
| admin_weight_profiles.py | ||
| analytics.py | ||
| cadastral.py | ||
| concepts.py | ||
| custom_pois.py | ||
| landing.py | ||
| parcels.py | ||
| photos.py | ||
| pilot.py | ||
| trade_in.py | ||
| users.py | ||