feat(export): Telegram summary format (tg) for §22 forecast — slice #959 #1093
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1093
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/forecast-export-telegram-959"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Что
Третий dep-free формат экспорта §22-отчёта (slice EPIC #959):
tg— компактная Telegram-выжимка для шеринга в чат. (MD полный + JSON сырой уже есть; теперь TG компактный.)Относится к #959 (остаются DOCX/pptx — нужны deps).
Содержимое
render_report_telegram_summary(report)вreport_md.py— чистый, без новых deps, DRY (переиспользует хелперы изreport_pdf). ~9 строк plain-text: заголовок+кад+район, «что строить» вердикт, индекс дефицита, мес. предложения, скор, уверенность, дефицит по сценариям (1 строка), рекомендованный класс, advisory-каваеат. Telegram-safe (• буллеты, без GFM-таблиц/MarkdownV2). Graceful на пустом.GET /{cad}/forecast/export?format=tg→ inlinetext/plain; charset=utf-8(НЕ attachment — сниппет для копи-пейста). md/json без изменений; нет рана → 404; невалидный format → 422.Качество
code-reviewer: ✅ APPROVE — graceful, DRY, md/json byte-identical (early-return), no deps, Telegram-safe, короткий вывод. 35 тестов в затронутых файлах (982 passed), ruff clean. 2 минора (stale docstring / широкий assert) — doc/cosmetic, non-blocking.Тест-план (post-deploy)
GET /api/v1/parcels/66:41:0702048:27/forecast/export?format=tg→ 200 text/plain inline, компактная выжимка.render_report_telegram_summary (pure, no new deps, DRY-reuses report_pdf str helpers) + `tg` format on GET /{cad}/forecast/export → inline text/plain snippet (no attachment, copy-paste-ready). md/json unchanged; no-run 404, bad format 422. Graceful on thin/empty reports. Part of EPIC #959.