STAGE

Change referral program

Challenge Based Rewards (student - active)

History
How to read this page: one screen, one Save. Every input is a dropdown, text, number, or date/time field — no JSON anywhere.
  • Blue pills predicate = named boolean rules composed from primitives. (Value-kind defined terms are shown without a pill — the Kind dropdown labels them.)
  • Datatypes (datetime, list[int], etc.) drive the operator dropdown — only the operators valid for the chosen subject's type appear.
  • Two date windows: start → frozen (inviting allowed) and start → end (rewards apply).

Program Information

Lower number = higher priority.

Schedule

Today |📅
Now |🕐
Note: You are 1 hour ahead of server time.
Today |📅
Now |🕐

Defined Terms Expand all Collapse all

Named typed constants (value-kind) and named boolean rules (predicate-kind) used by the clauses below. Predicate-kind terms expand to show their OR-branches.
# Name Kind Datatype Value (for value-kind) / Branches (for predicate-kind)
1
Today |📅
Now |🕐
— program begins
2
Today |📅
Now |🕐
— inviting closes; existing invitees can still earn rewards until end_date
3
Today |📅
Now |🕐
— last lesson date eligible for reward
4 — comma-separated
5 — opt-in toggle name
6 — comma-separated user IDs
7 — (predicates return bool) predicate  1 branch — link was created during [start_date, frozen_date)
Branches of "inviting_window_active" — matches if ANY branch matches
#Conditions (ALL must match)
1
Conditions in branch 1
#SubjectOperatorValue (literal)Value term refPredicate ref
1
2
8 — (predicates return bool) predicate  1 branch — current time is within [start_date, end_date)
Branches of "lesson_window_active"
#Conditions
1
Conditions in branch 1
#SubjectOperatorValue (literal)Value term refPredicate ref
1
2
9 — (predicate) predicate   — advocate's user.id is not in challenge_user_blocklist
10 — (predicate) predicate   — advocate has the challenges eligibility toggle
11 — (predicate) predicate   — invitee passes country + blocklist checks

Eligibility

Evaluated at referral link creation. ALL conditions must match for this program to apply to a new referral. Lesson-specific metrics (e.g. lesson.usd_amount) are not available here — referencing them is a save-time error.
# Subject Operator Value (literal) Value term ref Predicate ref
1
2
3
4

Reward Calculation Expand all Collapse all

Evaluated at each lesson completion. First rule whose conditions all match wins; its reward is paid. If none match, no reward for that lesson (but the program stays applied to the referral).
# Reward typeAmountStatus Description Conditions (ALL must match)
1 2 conditions
Conditions for rule 1 — Enhanced challenge reward
#SubjectOperatorValue (literal)Value term refPredicate ref
1
2
2