Skip to content

Instantly share code, notes, and snippets.

View hmseeb's full-sized avatar

Haseeb Azhar hmseeb

View GitHub Profile
@hmseeb
hmseeb / quick-update.md
Created March 14, 2026 21:42
Quick update for Dan

Yo bro removed queue, all leads deliver as soon as they are assigned.

You can add webhook to the broker whether they've added it through onboarding form or not: Dashboard > Brokers > click broker > Edit > Operational Settings > CRM Webhook URL

You can send a test lead webhook payload to the broker webhook if we have it added by: Dashboard > Brokers > click broker > Test Webhook (or from the edit form below the webhook URL field, or from the dropdown menu on the broker list)

@hmseeb
hmseeb / whats-new.md
Last active March 14, 2026 21:41
PPL Lead Management — What's New

What's New — PPL Lead Management

Bug Fixes

  • Loan range fix — orders with min/max set to 0 now correctly treated as "no limit"
  • Credit floor — no longer hardcoded at 600, uses lowest active order's minimum instead
  • Pending leads bug — leads that couldn't be assigned now properly go to Unassigned queue
  • Delivery timeouts — stale pending deliveries timeout after 10min, queued deliveries expire after 48h
  • Custom hours format — PM hours (14:00+) now parse correctly for broker contact windows
  • Vault secrets error logging — delivery trigger now writes an error instead of silently skipping
@hmseeb
hmseeb / leadrwizard-flow.md
Created March 14, 2026 01:00
LeadrWizard v1.0 — Application Flow (Mermaid Diagrams)

LeadrWizard — Application Flow

AI-powered autonomous onboarding agent. Agencies self-serve via Stripe, their clients get onboarded automatically through multi-channel conversations (SMS, voice, email, web widget).

1. Agency Signup Flow

sequenceDiagram
    participant Agency as Agency Admin
    participant Checkout as /api/signup/checkout
@hmseeb
hmseeb / ppl-leadr-flow-high-level.md
Created March 13, 2026 14:26
PPL Leadr Management — High-Level System Flow (Mermaid)

PPL Leadr Management — System Flow

flowchart TD
    WH["Webhook Received\nPOST /api/leads/incoming"] --> VAL["Validate & Dedupe"]
    VAL --> INSERT["Insert Lead (pending)"]
    INSERT --> ASSIGN["Assignment Engine\n(SQL RPC + Global Lock)"]

    ASSIGN -- "Match Found" --> ASSIGNED["Lead Assigned to Broker\nOrder Updated"]
    ASSIGN -- "No Match" --> UNASSIGNED["Unassigned Queue\n(with reason)"]
@hmseeb
hmseeb / ppl-leadr-flow.md
Created March 13, 2026 14:25
PPL Leadr Management — Full System Flow (Mermaid)

PPL Leadr Management — System Flow

flowchart TD
    subgraph INGESTION["🔵 Lead Ingestion"]
        WH["POST /api/leads/incoming\n(Webhook)"]
        VAL["Validate Payload\n(Zod Schema)"]
        IDEM["Idempotency Check\n(ghl_contact_id)"]
        INS["Insert Lead\nstatus = pending"]
        WH --> VAL --> IDEM --> INS

GHL Integration — PPL Lead Management

This system receives leads from GHL, scores them against all eligible orders using a 0-100 point algorithm, and delivers them via webhook to the winning broker's CRM.


Incoming Lead

GHL Webhook Integration — PPL Onboarding

Endpoint

POST https://ppl-onboarding.vercel.app/api/webhooks/ghl
Content-Type: application/json

Request Payload

What we're building

We have a Retell AI voice agent that creates cases in IRS Logics CRM through a Supabase edge function. Currently, the edge function extracts caller_name, caller_phone, and estimated_tax_debt from the Retell function call and creates a case.

We need to also capture the Retell call_id so we can later link the call recording URL to the case (handled separately via n8n post-call webhook).

How Retell sends the payload

When Retell triggers a custom function, it sends a POST request to our edge function with this structure:

@hmseeb
hmseeb / openclaw-client2-config.json
Last active March 9, 2026 10:35
openclaw client 2 config — maverick + qwen3.5 benchmark-optimized pairing
{
"meta": {
"lastTouchedVersion": "2026.2.9",
"lastTouchedAt": "2026-03-09T15:30:00.000Z"
},
"wizard": {
"lastRunAt": "2026-03-06T11:17:33.016Z",
"lastRunVersion": "2026.2.9",
"lastRunCommand": "doctor",
"lastRunMode": "local"
@hmseeb
hmseeb / openclaw-config.json
Last active March 9, 2026 10:35
openclaw config — maverick + qwen3.5 benchmark-optimized pairing
{
"meta": {
"lastTouchedVersion": "2026.2.9",
"lastTouchedAt": "2026-03-09T15:30:00.000Z"
},
"wizard": {
"lastRunAt": "2026-03-05T20:00:38.720Z",
"lastRunVersion": "2026.2.9",
"lastRunCommand": "doctor",
"lastRunMode": "local"