Phase 2 part 5: find people and verify emails with Hunter.io

Review gets Find people (Domain Search by the departments, seniority and
count set in Settings → Lead sources), Find their email (Email Finder for
a named person at a company), and Verify (one, or every unchecked address
in New). Every call is kept in enrich_runs (schema 9) with its result and
credits, and shown on the card. Nothing runs on a schedule. Sources are
shown by name (Hunter.io, origami.chat, explee.com).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 05:53:52 -07:00
co-authored by Claude Opus 5.5
parent efca73bcd4
commit 82d569da9c
18 changed files with 1348 additions and 11 deletions
+16
View File
@@ -8,7 +8,9 @@ import (
"time"
"supermarket/internal/crm"
"supermarket/internal/enrich"
"supermarket/internal/prospects"
"supermarket/internal/secrets"
"supermarket/internal/signals"
)
@@ -108,6 +110,11 @@ func (s *Server) renderProspects(w http.ResponseWriter, r *http.Request, tab str
s.serverError(w, err)
return
}
runs, err := enrich.Latest(s.DB, subjects...)
if err != nil {
s.serverError(w, err)
return
}
events := map[string][]signals.Event{}
for _, e := range evs {
if e.Stage != signals.StageFound {
@@ -130,6 +137,10 @@ func (s *Server) renderProspects(w http.ResponseWriter, r *http.Request, tab str
"Channels": signals.Channels,
"Back": reviewURL(tab, signalID),
"Today": time.Now().Format("2006-01-02"),
"Hunter": s.Secrets.Has(secrets.HunterAPIKey),
"Runs": runs,
"Unverified": len(unverified(companies, loose)),
"MaxVerify": maxVerify,
}})
}
@@ -165,6 +176,11 @@ func (s *Server) prospectAction(w http.ResponseWriter, r *http.Request) {
err, msg = prospects.RejectCompany(s.DB, id, now), "rejected"
case "contact/reject":
err, msg = prospects.RejectContact(s.DB, id, now), "rejected"
case "company/people", "contact/find-email", "contact/verify":
err, msg = s.enrichAction(r, kind, action, id), "hunter-done"
if action == "verify" {
msg = "verified"
}
case "company/reconsider", "contact/reconsider":
err, msg = prospects.Reconsider(s.DB, kind, id), "reconsidered"
case "company/suppress":