HALO CRM research
Real and working
Domain 3 · money · ~3,700 LOC

Referrals + referral invoicing

Pays commission to partners who introduced creators. Uses a temporal-ownership model: commission is computed from links overlapping the queried month, so unlinking stops future earnings without erasing past ones.

What it is and how it feeds the rest

Mechanically

Pays commission to partners who introduced creators. Uses a temporal-ownership model: commission is computed from links overlapping the queried month, so unlinking stops future earnings without erasing past ones.

How it connects

The money-out counterpart to creator invoicing; same settlement spine, opposite direction.

Pages

  • src/pages/Referrals.tsx
  • src/pages/ReferralInvoicing.tsx

Components

  • src/components/referrals/
  • src/components/referral-invoicing/

Convex modules

  • referrals.ts
  • referralInvoicing.ts
  • referralDemo.ts

Tables

  • referralPartners
  • referralPayments
  • referralLinks

Findings that touch this domain

high All money is float64; 2 rounding calls in 11,274 LOC, none in invoicing/referrals/payroll

convex/schema.ts:103,132,153,393,703

high Catastrophic cancellation — a fully-paid invoice can show a non-zero balance

convex/referralInvoicing.ts:138

high Same commission computed two contradictory ways; both displayed, no ledger arbitrates

convex/referrals.ts:534 vs :546

Open questions

Research priority for this domain is low. Agent findings splice in below this line and survive regeneration.