fix(tradein): trade-in PDF cover uses estimate.expires_at, not hardcoded +30d (#1530)
All checks were successful
CI / changes (push) Successful in 10s
CI / changes (pull_request) Successful in 6s
CI / backend-tests (push) Has been skipped
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Has been skipped
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped

This commit is contained in:
bot-backend 2026-06-17 20:27:57 +03:00
parent 18da92ccc7
commit f8ea119d22

View file

@ -449,7 +449,12 @@ def _dual_price_block(estimate: AggregatedEstimate, brand) -> str: # type: igno
def _build_cover(estimate: AggregatedEstimate, input_snapshot: dict, brand) -> str: # type: ignore[no-untyped-def,type-arg]
today = dt.date.today()
expires = today + dt.timedelta(days=30)
# Используем реальное поле expires_at из оценки; fallback на +30 дней если None.
expires = (
estimate.expires_at.date()
if estimate.expires_at is not None
else today + dt.timedelta(days=30)
)
report_num = _report_number(estimate.estimate_id)
# Короткий адрес (для cover): берём первую часть до запятой