The scenario
A referral application for insurance agents needs to track multi-level agent recruitment, referred customers, issued policies, and commission splits per level.
What is in this drawing
Read the decisions behind it.
01
Self-referential Agent parent_agent_id captures upline/downline hierarchy for multi-level referrals
02
CommissionRule and CommissionEntry model level-based bonus payouts without recalculating each time
03
Separate Customer and AgentReferral tables distinguish lead referrals from agent recruitment
Use this schema when building a multi-level marketing or referral tracking system where agents recruit other agents and earn commissions from downline sales.
More like this