fix(enrichment): stop PDL billing on no-match via required-field gating by TheodoreSpeaks · Pull Request #5184 · simstudioai/sim · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/sim/enrichments/company-domain/company-domain.test.ts
4 changes: 3 additions & 1 deletion apps/sim/enrichments/company-domain/company-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export const companyDomainEnrichment: EnrichmentConfig = {
buildParams: (inputs) => {
const name = str(inputs.companyName)
if (!name) return null
return { name }
// `required` makes PDL 404 (free) when the match has no website,
// instead of charging a credit for a match we'd discard as a no-match.
return { name, required: 'website' }
},
mapOutput: (output) => {
const company = output.company as Record<string, unknown> | undefined
Expand Down
4 changes: 3 additions & 1 deletion apps/sim/enrichments/company-info/company-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export const companyInfoEnrichment: EnrichmentConfig = {
buildParams: (inputs) => {
const website = normalizeDomain(inputs.domain)
if (!website) return null
return { website }
// `required` makes PDL 404 (free) when neither field we extract is
// present, instead of charging a credit for a match we'd discard.
return { website, required: 'employee_count OR summary' }
},
mapOutput: (output) => {
const company = output.company as Record<string, unknown> | undefined
Expand Down
3 changes: 3 additions & 0 deletions apps/sim/enrichments/phone-number/phone-number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ export const phoneNumberEnrichment: EnrichmentConfig = {
buildParams: (inputs) => {
const name = str(inputs.fullName)
if (!name) return null
// `required` makes PDL 404 (free) when the profile has no phone,
// instead of charging a credit for a match we'd discard as a no-match.
return filterUndefined({
name,
company: normalizeDomain(inputs.companyDomain) || undefined,
min_likelihood: 6,
required: 'phone_numbers OR mobile_phone',
})
},
mapOutput: (output) => {
Expand Down
3 changes: 3 additions & 0 deletions apps/sim/enrichments/work-email/work-email.ts
Loading