feat(tradein): interactive benefit calculator in OfferCard (Брусника секция 4) #684
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#684
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-tradein-calculator"
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?
Web-native version of Brusnika's report p.4 «Формирование выкупной стоимости». Replaces the deferred OfferCard stub with an INTERACTIVE benefit calculator.
Inputs (live recompute, no fetch): editable «цена в объявлении» (defaults to the estimate's asking median) + a bargaining-% slider (0–20%). Outputs update synchronously: cost rows (торг %×asking, риелтор %×after-bargain, аренда/юр/реклама fixed ranges), total «потери при самостоятельной продаже», and a prominent «Ваша выгода» (what trade-in saves) + advantages.
All rates in ONE config DEFAULT_OFFER_RATES (offer-rates.ts): торг 5–15%, риелтор 2–3%, аренда 90–150k/3мес, юр от ~19k, реклама 4–36k — defaults copied from Brusnika, marked illustrative (TODO commercial: swap to Praktika's terms). UI warn-banner states these are not an official offer.
Strict TS, tsc --noEmit clean, themed via existing trade-in brand CSS vars, responsive. (ESLint not configured in project.)
Refs #657 #658
Interactive benefit calculator in OfferCard (???????? ?????? 4). Frontend-only. Verified: offer-rates.ts is a clean pure-function calc module, math-safe (base=Math.max(0,price), lo/hi pairing correct, totalPctMid div-by-zero guarded). Input sanitized ? onPriceInput strips to digits-only (replace /\D/g), empty->0 else Number(digits) => NO NaN possible; bargain via range slider (always valid); useMemo recompute on deps. TS strict clean (no any/ts-ignore), reset restores estimate median. RATES are prominently labeled illustrative (generic ??-market per Brusnika p.4, NOT official Praktika offer, TODO commercial, single source of truth) ? honest, no fabricated binding terms (consistent with #683). ADVISORY (non-blocking): replace illustrative rates with real Praktika commercial terms before treating as binding offer ? explicitly intended. APPROVE.