feat: add EventReferral node type definition#1186
Merged
Merged
Conversation
EventReferral is a sibling to EventTracker that watches any table for DML events and records events attributed to the referrer (inviter) by looking up claimed_invites automatically from the membership_type context. Supports the same compound condition system as EventTracker (condition_field, watch_fields, or full AND/OR/NOT conditions). Refs #877
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
EventReferralnode type definition to the node-type-registry. EventReferral is a sibling toEventTracker— it watches any table for DML events and records events attributed to the referrer (inviter) by automatically looking upclaimed_invitesfrom the membership_type context.Parameter schema:
event_name(required) — event type name to record for the referrerevents— DML events to watch (default:['INSERT'])actor_field— column containing the invitee ID (default:owner_id)entity_field— optional column for entity-scoped referral eventsauto_register_type— auto-register in event_types (default:true)conditions/condition_field/watch_fields— same compound condition support as EventTrackerCompanion PR in constructive-db implements the SQL generator and wiring.
Refs #877
Review & Testing Checklist for Human
Risk: 🟢 Low — additive change, new file + one export line
EventReferralparameter schema matches what the SQL generator in constructive-db expectsconditionPropertiesspread correctly includes condition_field, condition_value, conditions, watch_fieldsNotes
conditionDefs/conditionPropertiesare shared with EventTracker and JobTriggerLink to Devin session: https://app.devin.ai/sessions/e0a3f1cfea6e4e809160c9d0cd755b90
Requested by: @pyramation