diff --git a/apps/outreach-worker/src/workflows/match-grants.ts b/apps/outreach-worker/src/workflows/match-grants.ts index 8d2a5ba..f26dee5 100644 --- a/apps/outreach-worker/src/workflows/match-grants.ts +++ b/apps/outreach-worker/src/workflows/match-grants.ts @@ -44,7 +44,7 @@ import type { NodePgDatabase } from 'drizzle-orm/node-postgres'; export type OutreachDb = NodePgDatabase; -const CANDIDATE_ORG_LIMIT = 500; +const CANDIDATE_ORG_LIMIT = 2_000; const GRANTS_PER_ORG = 50; const MIN_DAYS_TO_DEADLINE = 21; const MIN_AWARD_CEILING = 10_000; diff --git a/packages/outreach-core/src/orgs/queries/list-match-candidate-orgs.server.ts b/packages/outreach-core/src/orgs/queries/list-match-candidate-orgs.server.ts index 7bfc41f..977f17f 100644 --- a/packages/outreach-core/src/orgs/queries/list-match-candidate-orgs.server.ts +++ b/packages/outreach-core/src/orgs/queries/list-match-candidate-orgs.server.ts @@ -46,6 +46,12 @@ export async function serverListMatchCandidateOrgs( isNull(schema.orgs.nteeCode), sql`${schema.orgs.nteeCode} NOT LIKE 'T%'`, ), + // Definitive grantmaker check: an org that files a 990-PF IS a + // private foundation, whatever its NTEE code says (many carry + // E/S codes or none). The funders table is exactly that roster. + sql`NOT EXISTS ( + SELECT 1 FROM funders f WHERE f.ein = ${schema.orgs.ein} + )`, ), ) .limit(limit);