feat(tradein): expected-sold price in estimate PDF (#648 S5b — final) #665

Merged
Light1YT merged 2 commits from feat/648-s5b-pdf-dual-display into main 2026-05-29 14:09:47 +00:00
Owner

Stage 5b (FINAL) of #648 — mirror the web dual-display in the WeasyPrint PDF cover: «Ожидаемая цена продажи» equal-prominence next to «Ориентир запроса» + −N% chip + ДКП explainer. Graceful single-asking fallback when expected_sold null. Pure rendering; WeasyPrint import made lazy (HTML builders testable). 10 tests. Completes #648 (S1-S5): asking→sold correction live end-to-end (estimate API + web + PDF), self-refreshing. Refs #648.

Stage 5b (FINAL) of #648 — mirror the web dual-display in the WeasyPrint PDF cover: «Ожидаемая цена продажи» equal-prominence next to «Ориентир запроса» + −N% chip + ДКП explainer. Graceful single-asking fallback when expected_sold null. Pure rendering; WeasyPrint import made lazy (HTML builders testable). 10 tests. **Completes #648 (S1-S5): asking→sold correction live end-to-end (estimate API + web + PDF), self-refreshing.** Refs #648.
Light1YT added 2 commits 2026-05-29 14:09:46 +00:00
Show «Ориентир запроса» (asking median) and «Ожидаемая цена продажи»
(expected sold, S3 rosreestr ДКП) as two EQUAL-weight figures (same value
typography; sold card gets a subtle accent tint only), each with range +
₽/м², plus a tasteful −N% discount chip (aria-labelled, Unicode minus) and
an explainer. Graceful: expected_sold null/0 (old estimates / empty ratio
table) → single asking figure, no empty card/rows. Tokens-only CSS, responsive.

tsc --noEmit clean (TS strict); npm run build passes.
Mirror the S5a web dual-display in the WeasyPrint PDF cover: equal-prominence
«Ожидаемая цена продажи» figure (value + range + ₽/м²) next to «Ориентир
запроса», with a −N% discount chip and the ДКП-Росреестра explainer. Graceful
single-asking fallback when expected_sold is None/0; each sold sub-field guarded.

Pure rendering change — no DB/schema/API impact. WeasyPrint import made lazy so
the HTML builders are testable without the native GTK stack.

- trade_in_pdf.py: _dual_price_block / _price_figure_cell / _discount_pct + cover wiring
- tests/services/test_trade_in_pdf_dual_price.py: 10 unit tests
Light1YT merged commit 870f062587 into main 2026-05-29 14:09:47 +00:00
Light1YT deleted branch feat/648-s5b-pdf-dual-display 2026-05-29 14:09:47 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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#665
No description provided.