Skip to content

feat: add EventReferral node type definition#1186

Merged
pyramation merged 1 commit into
mainfrom
feat/event-referral-node-type
May 18, 2026
Merged

feat: add EventReferral node type definition#1186
pyramation merged 1 commit into
mainfrom
feat/event-referral-node-type

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Adds the EventReferral node type definition to the node-type-registry. EventReferral is a sibling to EventTracker — it watches any table for DML events and records events attributed to the referrer (inviter) by automatically looking up claimed_invites from the membership_type context.

Parameter schema:

  • event_name (required) — event type name to record for the referrer
  • events — DML events to watch (default: ['INSERT'])
  • actor_field — column containing the invitee ID (default: owner_id)
  • entity_field — optional column for entity-scoped referral events
  • auto_register_type — auto-register in event_types (default: true)
  • conditions / condition_field / watch_fields — same compound condition support as EventTracker

Companion 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

  • Verify EventReferral parameter schema matches what the SQL generator in constructive-db expects
  • Confirm conditionProperties spread correctly includes condition_field, condition_value, conditions, watch_fields

Notes

  • No runtime behavior change — this is purely a TypeScript definition consumed by the seed generator
  • The conditionDefs/conditionProperties are shared with EventTracker and JobTrigger

Link to Devin session: https://app.devin.ai/sessions/e0a3f1cfea6e4e809160c9d0cd755b90
Requested by: @pyramation

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
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 4923b6a into main May 18, 2026
37 checks passed
@pyramation pyramation deleted the feat/event-referral-node-type branch May 18, 2026 01:33
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.

1 participant