Module: PartyResearch
- Defined in:
- app/services/party_research/orchestrator.rb,
app/services/party_research/adapters/base.rb,
app/services/party_research/auto_enricher.rb,
app/services/party_research/adapters/apollo.rb,
app/services/party_research/adapters/gemini.rb,
app/services/party_research/finding_applier.rb,
app/services/party_research/adapters/logo_dev.rb,
app/services/party_research/adapters/google_places.rb,
app/services/party_research/adapters/people_data_labs.rb
Overview
Drives a PartyResearchRun from queued → completed (or failed). For each
selected adapter it:
- Looks up the adapter class via Adapters::Base.lookup
- Skips adapters whose credentials aren't configured (so a partial
setup doesn't kill the whole run) - Calls the adapter and persists its findings
Before any adapter runs, the orchestrator supersedes any still-pending
findings on the same Party from prior runs so the review UI never shows
stale duplicates — accepted/rejected findings are left untouched
(auditable history of past decisions).
Per-adapter state is mirrored to party_research_runs.adapter_progress
(jsonb) as the orchestrator advances, so the show page can render
"Apollo: done · PDL: done · Gemini: running" without needing
Sidekiq::Status. Progress reporting is also delegated to the caller via
the on_progress proc — the Sidekiq worker uses it to drive
sidekiq-status's at(...) / store(...) for completeness.
Defined Under Namespace
Modules: Adapters Classes: AutoEnricher, CustomerProfileChangedHandler, FindingApplier, Orchestrator