gendesign/tradein-mvp/backend/app/services
bot-backend 77692b2244 fix(pdf): brand-spoof + median=0 empty-state + SSRF + дисклеймер + sources (Refs #772)
5 связанных client-facing+legal дефектов PDF-генерации (audit #7/#8/#9/#13/#33):
A (#7): бренд PDF из estimate.created_by (get_brand_for_user), НЕ из ?brand=
  query — param удалён → brand-spoof невозможен.
B (#9): generate_trade_in_pdf гейтит по estimate.insufficient_data → empty-state
  страница «недостаточно данных» вместо «0,0 млн» + фабрикованной таблицы потерь.
C (#8): _build_cover рендерит brand.logo_url (validated) + brand.pdf_disclaimer
  на обложке (были =None).
D (#13): _safe_logo_url/_safe_color + _make_safe_url_fetcher блокирует file://;
  base_url=None (был file:///) → SSRF closed. logo_url+primary_color валидируются.
E (#33): n_with_repair=n_total (убран фабрикованный 40%); sources из
  estimate.sources_used (не хардкод); None-guard в _examples_rows.
report_number не менялся (estimate_id UUID — уникален; смена display сломала бы
нумерацию без чёткого спека).

brand.py изменений не потребовал. pytest -k 'pdf or brand' 54 pass, ruff clean.
2026-05-30 19:51:14 +03:00
..
exporters fix(pdf): brand-spoof + median=0 empty-state + SSRF + дисклеймер + sources (Refs #772) 2026-05-30 19:51:14 +03:00
matching feat(tradein): same-building матчинг аналогов по house_id (#6) 2026-05-28 13:55:51 +05:00
scrapers fix(scrapers): yandex area из embedded-state JSON (Refs #775) (#783) 2026-05-30 16:38:12 +00:00
__init__.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
account_quota.py fix(tradein): atomic conditional quota increment — close TOCTOU (#747) (#749) 2026-05-30 15:52:34 +00:00
brand.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
cache.py feat(tradein): Phase 3.2 — /api/v1/search endpoint + Redis cache (#479) 2026-05-23 14:44:22 +00:00
cian_session.py fix(tradein): CIAN_REQUIRED_COOKIES — add real auth cookies (DMIR_AUTH + Cian session) (#480) 2026-05-23 14:52:24 +00:00
dadata.py feat(tradein): DaData /suggest tier в /suggest endpoint (PR Q2) 2026-05-27 19:08:58 +05:00
estimator.py fix(estimator): expected_sold guard listings_clean → median_price>0 (Refs #773) (#784) 2026-05-30 16:39:08 +00:00
geocoder.py feat(tradein): DaData /suggest tier в /suggest endpoint (PR Q2) 2026-05-27 19:08:58 +05:00
house_metadata.py feat(tradein): postgres_fdw live read of gendesign.cad_buildings (replaces snapshot) (#493) 2026-05-24 08:57:30 +00:00
image_sanitizer.py fix(tradein-photos): sanitize uploaded images via Pillow re-encode (#511) 2026-05-24 11:32:04 +00:00
scheduler.py fix(scheduler): atomic _claim_run via advisory xact lock (Refs #750) (#752) 2026-05-30 16:04:33 +00:00
scrape_pipeline.py feat(scrapers): wire N1.ru city sweep — pipeline + scheduler + admin endpoint (#575) (#745) 2026-05-30 15:43:38 +00:00
scrape_runs.py fix(tradein/avito): anti-bot hardening — sleep + abort + shared session (#487) 2026-05-23 20:08:40 +00:00
scraper_settings.py feat(tradein): global scraper delay setting (applies across all scrapers) (#485) 2026-05-23 15:43:28 +00:00
search_query.py feat(tradein): Phase 3.2 — /api/v1/search endpoint + Redis cache (#479) 2026-05-23 14:44:22 +00:00