Files
portal/docs/superpowers
Дмитрий da4ab729df docs(supplier): spec + 3 plans for webhook reliability (phases 1-3)
Investigation 2026-05-25: for tenant client1 (tenant_id=2) on prod liderra.ru:
  - 205 leads at supplier (info@lkomega.ru, visit=rt) vs 160 deals on portal
  - 82 leads lost (76 via 302-redirect from ValidationException, mostly
    non-B-prefix projects: client.carmoney.ru, cashmotor.ru, etc.)
  - 37 duplicate deals (CSV-recovered SupplierLead vid=null + later
    webhook with real vid "create two Deals because supplier_lead_deliveries
    locks on supplier_lead_id, not phone+project)

Three independent fixes, three plans, three deploys:
  Phase 1 (low risk): Always JSON 422 for webhook ValidationException
  Phase 2 (med risk, billing): merge webhook-after-CSV-recovered into
    existing deal, no double-charge
  Phase 3 (high risk, migration): accept non-B projects as platform=DIRECT
    end-to-end (controller + 4 services + migration)

Phase 3 includes new LeadRouter fallback path: DIRECT-supplier_projects
match Liderra projects via signal_type+signal_identifier directly
(no project_supplier_links pivot required, since psl rows don't exist
for auto-created DIRECT supplier_projects).

Refs: docs/superpowers/specs/2026-05-25-supplier-webhook-reliability-design.md
2026-05-25 16:25:22 +03:00
..