> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myfundingmachine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Zoho retirement deletion plan

# Zoho retirement — deletion plan (batch 6 audit)

Do **not** blanket-delete Zoho. Two systems coexist. Schema tables and
`/zoho/sync/*` HTTP contracts need Brock approval before removal (VISION Out of
Scope: schema + external webhook contracts).

## Inventory

### LIVE (keep until a dedicated sunset)

| Path                                                | Role                                                                                   |
| --------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `convex/lib/zohoProspect.ts` + deliverLead overflow | Overflow → 7F `Funding_Prospects` mirror                                               |
| `convex/crons.ts` → `reportOverflowMirrorHealth`    | Daily health check for that mirror                                                     |
| `app/api/zoho/credit-report*` + `credit-reports/*`  | FM\_Credit\_Reports import / enrich                                                    |
| Re-underwrite address enrichment                    | Reads Zoho-derived address fields                                                      |
| Credit-report history / migrated-contact reads      | `zohoInstallations`, `zohoLeads`, `zohoDeals`, `zohoCreditReports`, `migratedContacts` |
| `convex/http.ts` `/zoho/sync/*`                     | External webhook contract                                                              |

### LEGACY (gate now; delete in phases)

| Path                                                      | Role                                                |
| --------------------------------------------------------- | --------------------------------------------------- |
| `/settings/migration*` + Launchpad / pending-action cards | Wizard UI (`NEXT_PUBLIC_ZOHO_MIGRATION_UI_ENABLED`) |
| `app/api/zoho/migrate*`, `authorize`, `revoke`            | Wizard APIs (same flag → 404 when off)              |
| `lib/zoho-migration/` + `convex/migrations*` workers      | One-time vertical CRM migration                     |
| `components/migration/*`                                  | Wizard UI components                                |

### Already removed in batch 6

* Dead `app/api/cron/zoho-sync` + Vercel cron entry
* Dead `app/api/zoho/funding-machines` stub
* `Funding_Machines` cluster helpers from `lib/zoho.ts`
* Dashboard `MigrationHealthCard` widget

## Deletion phases (Brock-gated)

1. **Hide** — set `NEXT_PUBLIC_ZOHO_MIGRATION_UI_ENABLED=false` in preview/prod when no locations still need the wizard. UI + migrate/authorize/revoke APIs return 404; workers/schema stay.
2. **Delete LEGACY code** — remove wizard pages, migrate/authorize/revoke routes, `lib/zoho-migration/`, and unused migration workers once no in-flight jobs remain. Keep LIVE import/enrich + overflow mirror.
3. **Schema / webhook sunset** — only after LIVE overflow + FM\_Credit\_Reports paths are replaced or confirmed unused: drop `convex/schemas/zoho.ts` tables and `/zoho/sync/*` with an explicit Brock approval citation (schema Out of Scope).

## Flag

`NEXT_PUBLIC_ZOHO_MIGRATION_UI_ENABLED` — default **on** (unset ≠ false). Redeploy after changing; `NEXT_PUBLIC_*` is build-time.
