fix(leads): window revenue_total/deals_total to leads_window (#1383) #1694

Merged
lekss361 merged 1 commit from fix/leads-stats-window-1383 into main 2026-06-17 18:05:53 +00:00

1 commit

Author SHA1 Message Date
64ed95271f fix(leads): window revenue_total/deals_total to leads_window (#1383)
Some checks failed
CI / changes (push) Successful in 10s
CI / changes (pull_request) Successful in 8s
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Successful in 1m42s
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 1m45s
CI / backend-tests (push) Failing after 8m48s
CI / backend-tests (pull_request) Failing after 8m46s
Both metrics were querying prinzip_deals without any date filter,
returning all-time figures while the surrounding stats (leads_window,
converted_window, conv_pct_window) were scoped to the last N months.
Now both subqueries restrict to deals linked to leads in window_leads
(via deal_id IN (...)), making all «за период» figures consistent.
2026-06-17 20:49:16 +03:00