Add campaign id to event contribution#1496
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe PR extends campaign mapping logic in Changes
Sequence DiagramsequenceDiagram
participant Caller
participant Service as CollectionCampService
participant CiviAPI as Civi API4
Caller->>Service: updateCampaignForCollectionSourceContribution()
activate Service
Service->>CiviAPI: Query Contributions with<br/>Contribution_Details.Source &<br/>Contribution_Details.Events
CiviAPI-->>Service: Contribution data
alt Source or Events present
Service->>Service: Check if Source exists
alt Source found
Service->>CiviAPI: Fetch Collection_Camp by Source
CiviAPI-->>Service: Collection_Camp (found)
Service->>Service: Use Collection_Camp flow
else Source not found
Note over Service: Fallback to Event
Service->>CiviAPI: Fetch Event by ID
CiviAPI-->>Service: Event with campaign_id
Service->>Service: Update contribution with<br/>Event's campaign_id
end
else No Source & No Events
Service->>Service: Return early
end
deactivate Service
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add campaign id to event contribution
Summary by CodeRabbit