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
be63b249b5
chore(tradein): close pre-commit ruff gap + add CI pytest gate ( #666 ) ( #675 )
...
Deploy Trade-In / changes (push) Successful in 4s
Deploy Trade-In / test (push) Failing after 4s
Deploy Trade-In / build-backend (push) Has been skipped
Deploy Trade-In / build-frontend (push) Successful in 25s
Deploy Trade-In / deploy (push) Has been skipped
Co-authored-by: bot-backend <bot-backend@gendsgn.local>
Co-committed-by: bot-backend <bot-backend@gendsgn.local>
2026-05-29 19:18:48 +00:00
870f062587
feat(tradein): expected-sold price in estimate PDF ( #648 S5b — final) ( #665 )
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / build-backend (push) Successful in 43s
Deploy Trade-In / deploy (push) Successful in 35s
2026-05-29 14:09:46 +00:00
33c4c84467
feat(tradein): этаж/этажность optional + best test presets по deal count ( #558 )
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-backend (push) Successful in 44s
Deploy Trade-In / build-frontend (push) Successful in 1m53s
Deploy Trade-In / deploy (push) Successful in 44s
2026-05-24 21:44:44 +00:00
5e3ba351a0
fix(tradein): security hotfix — C-3 config default + C-4 empty estimate persist + C-6 PDF URL allowlist ( #435 )
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / build-backend (push) Successful in 38s
Deploy Trade-In / deploy (push) Successful in 25s
2026-05-23 09:38:23 +00:00
420057aa02
fix(tradein): PDF — рабочая ссылка на отчёт + «Есть/Нет» для балкона
...
«Этот отчёт онлайн» и QR-код в PDF вели на
gendsgn.ru/trade-in/trade-in?id=… — двойной /trade-in/: PUBLIC_URL
на проде уже = https://gendsgn.ru/trade-in , а код добавлял /trade-in
ещё раз → ссылка/QR давали 404.
Плюс «Балкон / лоджия» печатался как «1»/«0» (сырое булево) вместо
«Есть»/«Нет».
2026-05-22 16:01:12 +05:00
lekss361
02267d0306
feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in)
...
- FastAPI backend: PostGIS estimator + 3 scrapers (Avito/Cian/Yandex)
- Next.js 15 frontend: tradein.html mockup design, basePath=/trade-in
- WeasyPrint PDF (Брусника-style 4-page report)
- Address autocomplete с typo-tolerance + 6 EKB presets
- Изолированный docker stack gendesign-tradein (отдельная postgres БД)
- Caddy inline routes: gendsgn.ru/trade-in/* и /trade-in/api/v1/*
- Forgejo Actions: .forgejo/workflows/deploy-tradein.yml (shell-based GHCR login)
- Триггер только по paths: tradein-mvp/** (не пересекается с deploy.yml)
- Образы: ghcr.io/lekss361/gendesign-tradein-{backend,frontend}:latest
Первый запуск на сервере (вручную, один раз):
- создать /opt/gendesign/tradein-mvp/.env.runtime (postgres pwd, contact email)
- docker network create gendesign_shared (если нет)
- docker compose -p gendesign-tradein up -d
- docker compose -p gendesign exec caddy caddy reload
2026-05-21 00:25:39 +03:00