feat: lead dashboard with status history (conversion = WON) #29

Merged
ngqile merged 14 commits from add-lead-dashboard into main 2026-12-01 02:51:22 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 07c3ecb7ad - Show all commits

No files matched your search

@@ -1,5 +1,5 @@
-- Co-Lite change add-lead-dashboard: event lead status history (design decision 1).
-- Target: `service-counter`. Additive only. Run once, after the release package, before 02.
-- Target: `service-counter`. Additive only. Run before the new images go live (services-counter writes this table), then 02.
USE `service-counter`;
CREATE TABLE IF NOT EXISTS `event_lead_status_change` (
@@ -12,4 +12,4 @@ INSERT INTO `event_lead_status_change` (`company_id`, `event_lead_id`, `from_sta
SELECT el.company_id, el.id, 'OPEN', el.status, COALESCE(el.updated_at, el.captured_at), COALESCE(el.updated_by, el.captured_by)
FROM `event_lead` el
WHERE el.status <> 'OPEN'
AND NOT EXISTS (SELECT 1 FROM `event_lead_status_change` s WHERE s.event_lead_id = el.id AND s.from_status IS NOT NULL);
AND NOT EXISTS (SELECT 1 FROM `event_lead_status_change` s WHERE s.event_lead_id = el.id AND s.to_status = el.status);