Skip to content

fix(leads): make icpProfileId optional to sync Apollo-only campaigns - #34

Merged
anujeet98 merged 2 commits into
mainfrom
fix/lead-icp-profile-optional
Aug 13, 2026
Merged

fix(leads): make icpProfileId optional to sync Apollo-only campaigns#34
anujeet98 merged 2 commits into
mainfrom
fix/lead-icp-profile-optional

Conversation

@Rishavraaj

Copy link
Copy Markdown
Member

Summary

  • Campaigns created directly in Apollo (no ICP assigned in Zuko) were excluded from the reply sync entirely due to icpProfileId: { not: null } filter
  • Lead.icpProfileId is now nullable so leads can be created without an ICP profile

Changes

  • libs/models/prisma/sales.prismaicpProfileId Int? on Lead model
  • libs/models/prisma/migrations/... — migration to drop NOT NULL constraint
  • libs/sales/src/lib/repositories/leads.repository.tsicpProfileId?: number in CreateLeadInput
  • apps/backend/src/app/integrations/apollo/apollo-sync.service.ts — removed icpProfileId: { not: null } filter from cron query
  • apps/backend/src/app/integrations/apollo/prospects/apollo-prospects.service.tsicpProfileId parameter is now optional in syncRepliesToLeads

Test plan

  • Campaign linked to an ICP profile still syncs replied contacts → leads correctly
  • Campaign with no ICP profile (Apollo-only) now syncs replied contacts → leads
  • Existing leads with icpProfileId are unaffected
  • Migration runs cleanly on fresh DB

🤖 Generated with Claude Code

Rishavraaj and others added 2 commits August 13, 2026 10:32
Campaigns created directly in Apollo have no ICP profile assigned in
Zuko, causing them to be excluded from the reply sync entirely.

- Make Lead.icpProfileId nullable in schema + migration
- Remove icpProfileId filter from syncAllCampaignReplies cron
- Update syncRepliesToLeads signature to accept optional icpProfileId
- Update CreateLeadInput to accept optional icpProfileId

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@anujeet98
anujeet98 merged commit 5ede8ad into main Aug 13, 2026
1 check passed
@anujeet98
anujeet98 deleted the fix/lead-icp-profile-optional branch August 13, 2026 07:59
@Rishavraaj Rishavraaj self-assigned this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants