Skip to content

feat(node-type-registry): add max_depth parameter to EventReferral#1201

Merged
pyramation merged 1 commit into
mainfrom
feat/event-referral-max-depth
May 20, 2026
Merged

feat(node-type-registry): add max_depth parameter to EventReferral#1201
pyramation merged 1 commit into
mainfrom
feat/event-referral-max-depth

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Adds max_depth to EventReferral's parameter_schema in the node-type-registry package. This enables the downstream generator in constructive-db to build multi-level referral chain walks.

Change: One new property in packages/node-type-registry/src/event/referral.ts:

max_depth: {
  type: 'integer',
  description: 'Maximum depth to walk up the invite chain. Default 1 (direct inviter only). Set 2–10 to enable multi-level referral rewards. App-level only — must not be combined with entity_field.',
  default: 1,
  minimum: 1,
  maximum: 10,
}

The generator implementation that consumes this is in constructive-db PR #1261.

Closes constructive-io/constructive-planning#904

Review & Testing Checklist for Human

  • Verify the property position (before auto_register_type, after entity_field) is consistent with other node types
  • Confirm the min/max/default values are reasonable (1–10, default 1)

Notes

This is a purely additive schema change — no existing behavior changes since the default is 1 (today's single-hop behavior). The downstream constructive-db PR has the generator implementation + integration tests.

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

Adds max_depth (integer, 1-10, default 1) to EventReferral parameter_schema.
When >1, the trigger generator walks the claimed_invites chain up to
max_depth levels, enabling multi-level referral rewards.
App-level only — cannot be combined with entity_field.

Closes constructive-io/constructive-planning#904
@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 26a5872 into main May 20, 2026
37 checks passed
@pyramation pyramation deleted the feat/event-referral-max-depth branch May 20, 2026 18:21
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