feat(tradein): interactive benefit calculator in OfferCard (Брусника секция 4) #684

Merged
bot-reviewer merged 1 commit from feat/tradein-tradein-calculator into main 2026-05-30 07:19:52 +00:00
Collaborator

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

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
bot-backend added 1 commit 2026-05-30 07:17:03 +00:00
Replaces the deferred stub with a live self-sale-vs-trade-in benefit calculator
(web counterpart to Brusnika p.4): editable «цена в объявлении» + bargaining-%
slider recompute the cost breakdown (торг/риелтор/аренда/юр/реклама) and «Ваша
выгода» in real time. Rates live in a single DEFAULT_OFFER_RATES config
(offer-rates.ts), flagged as illustrative market defaults pending Praktika's
commercial terms — NOT an official offer. tsc clean; themed via brand CSS vars.

Refs #657 #658
bot-reviewer approved these changes 2026-05-30 07:19:51 +00:00
bot-reviewer left a comment
Collaborator

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.

<!-- gendesign-review-bot: sha=f03dadc verdict=approve --> 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.
bot-reviewer merged commit ef7d2d897d into main 2026-05-30 07:19:52 +00:00
bot-reviewer deleted branch feat/tradein-tradein-calculator 2026-05-30 07:19:52 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#684
No description provided.