Passa al contenuto principale

Admin - Incentives

Referral, credit and promotion monitoring for admin

📄️Credit economy: family credit granted, spent and returned, the discount it gave on paid orders and who absorbed it, the teacher credit ledger and the outstanding balances

Three clocks, each stated on its measure: the ledger measures (family_credit_*, teacher_credit_*) count rows by the date they were written; the discount measures (paid_orders_with_credit, credit_discount_*, credit_absorbed_*, credit_awaiting_settlement) follow the orders created in the range, as finance revenue does. 'Paid' means the order status is charged, partial_transfer or full_transfer: a pending checkout, an expired one (deleted) and a free order never count. Absorption is read off the lessons already settled (status transferred), as frozen by the payout run in lesson.credit_to_*. `balances` are per-holder ledger sums as of end_date_time (now when omitted). `totals` covers the whole range, `series` the same measures per period. With competence_school, the family ledger and family balances follow the family's current competence school and the discount measures the order's own; the teacher ledger cannot be split (credit earned on lessons of several schools, spent on documents of several issuers), so teacher_credit_* and balances.teacher are null.

📄️Promotions: usages, families, discount given, free lessons, revenue and who absorbed the discount, overall and per promotion

Usages count by their own date; every order and lesson measure follows the orders created in the range. An order counts only while standing — money collected (charged, partial_transfer, full_transfer) or booked free (free_teacher_paid), and at least one lesson still on — so a discount on an expired or fully refunded booking is never counted. Absorption is read off settled lessons (lesson.promotion_to_*). `totals` covers the whole range, `series` the same measures per period, `promotions` one row per promotion with activity in the range plus every live one, sorted by discount applied. With competence_school, every measure follows the order's own competence school (lesson_order.competence_school_id), a usage through the lesson it was recorded for.

📄️Referral funnel: invitations, referred signups, conversions to the first paid lesson and the credit granted

Cohort measures (invite_*, invited_emails*, referred_signups*) follow the addresses invited or the families signed up in the range and report what became of them as of today; event measures (first_paid_lessons*, *_credit_granted, awards_flagged_for_review) count what happened in the range. Rates are only computed within a cohort. A referral credit is the welcome credit when it references no order or an order of the credited family itself, otherwise it is the referrer credit. The referrer is the inviting family's paterfamilias user. `totals` covers the whole range, `series` the same measures per `granularity` period (paginated by period), `top_referrers` the most effective referrers of the range. With competence_school, each row follows the current competence school of its family: an invitation the inviting family's, a sign-up and its first paid lesson the family that signed up, a credit the family credited.