feat(tradein/lead): POST /api/v1/trade-in/lead — persist contact leads (#2376) #2390
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#2390
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-lead-endpoint"
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?
Summary
trade_in_leads(миграция172_trade_in_leads.sql): id, estimate_id FK→trade_in_estimates (ON DELETE SET NULL), phone, consent (CHECK IS TRUE), source, user_agent, created_at, notified_at.POST /api/v1/trade-in/lead— валидацияestimate_idсуществует (404 если нет) → INSERT RETURNING → commit → structured log (без PII в логах).consent: Literal[True]— 422 при false/отсутствии.pilot.py).Test plan
test_trade_in_lead.py) — happy path, consent=false→422, missing consent→422, invalid phone→422, unknown estimate_id→404 (no commit), known estimate_id→200pytest tests/test_trade_in_lead.py tests/test_migrations_manifest.py— 10/10 passedruff check— clean;CAST(:x AS type)psycopg v3 conventions everywhereRefs #2376, parent #1971