# 1. Commission Structure — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: commission_structure.md — every feature, sub-feature, and rule covered

---

## Test Execution Policy
- Zero tolerance: any deviation from documented behavior = FAILED = bug
- Every bug is immediately logged/reported (Bug ID, feature, sub-feature,
  expected vs actual, severity) and fixed 100% before the group passes
- Feature group passes only at 100% test pass rate

## Coverage Matrix
| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 1.1 Configure Commission Rates | Rate type: the type (the percentage, the fixed amount) | TC-SA-14-01-001 |
| 1.1 Configure Commission Rates | Rate value: the value (the percentage, e.g., 20%, or the fixed amount, e.g., 200) | TC-SA-14-01-002 |
| 1.1 Configure Commission Rates | Rate scope: the scope (the rate applies to the items, the plans, the courses) | TC-SA-14-01-003 |
| 1.1 Configure Commission Rates | Rate definition: the rate defined by the Super Admin (the type, the value, the scope) | TC-SA-14-01-001 |
| 1.1 Configure Commission Rates | Rate application: the rate applied (the commission is calculated per the rate) | TC-SA-14-01-004 |
| 1.1 Configure Commission Rates | Rate record: the rate recorded (the rate type, the rate value, the scope) | TC-SA-14-01-005 |
| 1.1 Configure Commission Rates | Audit logging of the rate definition and the changes | TC-SA-14-01-006 |
| 1.1 Configure Commission Rates | Rule: the rate type is the percentage or the fixed amount; the type is the basis | TC-SA-14-01-001 |
| 1.1 Configure Commission Rates | Rule: the rate value is the amount (the percentage, e.g., 20%, or the fixed amount, e.g., 200); the value is the measure | TC-SA-14-01-002 |
| 1.1 Configure Commission Rates | Rule: the rate scope is the application (the items, the plans, the courses); the scope is the control | TC-SA-14-01-003 |
| 1.1 Configure Commission Rates | Rule: a rate change (the type, the value, the scope updated) is recorded (the new type, the new value, the new scope, the time); it is auditable | TC-SA-14-01-007 |
| 1.1 Configure Commission Rates | Rule: the commission rates are visible (the types, the values, the scopes); the commission structure is managed | TC-SA-14-01-008 |
| 1.1 Configure Commission Rates | Rule: rate definition and changes are audit-logged with the rate type, value, and timestamp | TC-SA-14-01-006 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Tier definition: the tier (the Tier 1, the Tier 2) | TC-SA-14-01-009 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Tier rate: the rate (the rate per tier, e.g., Tier 1 20%, Tier 2 10%) | TC-SA-14-01-010 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Tier scope: the scope (the tier applies to the referrals, the sub-affiliates) | TC-SA-14-01-011 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Structure definition: the structure defined by the Super Admin (the tiers, the rates, the scope) | TC-SA-14-01-009 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Commission application: the commission applied (the Tier 1 for the direct, the Tier 2 for the sub) | TC-SA-14-01-012 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Commission record: the commission recorded (the affiliate, the tier, the rate, the commission) | TC-SA-14-01-013 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Audit logging of the structure definition and the applications | TC-SA-14-01-014 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Rule: the tier is explicit (the Tier 1, the Tier 2); the tier is the structure | TC-SA-14-01-009 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Rule: the tier rate is the measure (the rate per tier, e.g., Tier 1 20%, Tier 2 10%); the rate is the basis | TC-SA-14-01-010 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Rule: the tier scope is the application (the referrals, the sub-affiliates); the scope is the control | TC-SA-14-01-011 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Rule: a structure change (the tiers, the rates, the scope updated) is recorded (the new tiers, the new rates, the new scope, the time); it is auditable | TC-SA-14-01-015 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Rule: the tier structure is visible (the tiers, the rates, the scopes); the multi-tier structure is managed | TC-SA-14-01-016 |
| 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates) | Rule: structure definition and applications are audit-logged with the affiliate, tier, and timestamp | TC-SA-14-01-014 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Recruitment reward: the reward (the reward for the recruit, e.g., a fixed amount, a percentage) | TC-SA-14-01-017 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Reward condition: the condition (the condition for the reward, e.g., the recruit makes a purchase) | TC-SA-14-01-018 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Leadership bonus: the bonus (the bonus for the leader, e.g., a percentage of the team's commissions) | TC-SA-14-01-019 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Reward definition: the reward defined by the Super Admin (the reward, the condition, the scope) | TC-SA-14-01-017 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Reward application: the reward applied (the recruiter earns the reward for the recruit) | TC-SA-14-01-020 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Reward record: the reward recorded (the recruiter, the recruit, the reward, the condition) | TC-SA-14-01-021 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Audit logging of the reward definition and the applications | TC-SA-14-01-022 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Rule: the recruitment reward is the incentive (the reward for the recruit, e.g., a fixed amount, a percentage); the reward is the value | TC-SA-14-01-017 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Rule: the reward condition is the trigger (the condition for the reward, e.g., the recruit makes a purchase); the condition is the gate | TC-SA-14-01-018 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Rule: the leadership bonus is the leadership incentive (the bonus for the leader, e.g., a percentage of the team's commissions); the bonus is the value | TC-SA-14-01-019 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Rule: a reward change (the reward, the condition, the scope updated) is recorded (the new reward, the new condition, the new scope, the time); it is auditable | TC-SA-14-01-023 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Rule: the recruitment rewards are visible (the rewards, the conditions, the scopes); the recruitment incentives are managed | TC-SA-14-01-024 |
| 1.3 Recruitment Rewards and Leadership Bonuses | Rule: reward definition and applications are audit-logged with the recruiter, recruit, and timestamp | TC-SA-14-01-022 |

## 1.1 Configure Commission Rates

### TC-SA-14-01-001 — Rate definition: the rate defined by the Super Admin (the type, the value, the scope); the type is the percentage or the fixed amount
**Type:** Positive
**Covers:** 1.1 → Rate type: the type (the percentage, the fixed amount); Rate definition: the rate defined by the Super Admin (the type, the value, the scope); Rule: the rate type is the percentage or the fixed amount; the type is the basis
**Preconditions:** The Super Admin opens the commission structure.
**Steps:**
1. Define the commission rate: the rate type (the percentage, the fixed amount), the rate value (the percentage, e.g., 20%, or the fixed amount, e.g., 200), and the scope (the items, the plans, the courses).
2. Save the rate.
3. Verify the commission rate is live and the type is the percentage or the fixed amount.
**Expected Result:** The commission rate is defined (the type, the value, the scope) — the type is the basis.
**Priority:** Critical

### TC-SA-14-01-002 — Rate value: the value (the percentage, e.g., 20%, or the fixed amount, e.g., 200); the value is the measure
**Type:** Positive
**Covers:** 1.1 → Rate value: the value (the percentage, e.g., 20%, or the fixed amount, e.g., 200); Rule: the rate value is the amount (the percentage, e.g., 20%, or the fixed amount, e.g., 200); the value is the measure
**Preconditions:** A commission rate is defined with a value.
**Steps:**
1. Open the rate value.
2. Verify the value is the percentage (e.g., 20%) or the fixed amount (e.g., 200).
3. Verify the value is the measure for the commission.
**Expected Result:** The rate value is the percentage or the fixed amount — the value is the measure.
**Priority:** High

### TC-SA-14-01-003 — Rate scope: the scope (the rate applies to the items, the plans, the courses); the scope is the control
**Type:** Negative
**Covers:** 1.1 → Rate scope: the scope (the rate applies to the items, the plans, the courses); Rule: the rate scope is the application (the items, the plans, the courses); the scope is the control
**Preconditions:** A commission rate is live with a scope limited to specific plans.
**Steps:**
1. A referred purchase is made on a plan within the scope — verify the commission is calculated per the rate.
2. A referred purchase is made on a plan outside the scope — verify the commission is not calculated per the rate.
3. Verify the scope is the control.
**Expected Result:** The rate scope is enforced — the rate applies only to the scoped items, plans, and courses.
**Priority:** Critical

### TC-SA-14-01-004 — Rate application: the rate applied (the commission is calculated per the rate); the commission is recorded
**Type:** Positive
**Covers:** 1.1 → Rate application: the rate applied (the commission is calculated per the rate)
**Preconditions:** A percentage rate (e.g., 20%) and a fixed-amount rate (e.g., 200) are live.
**Steps:**
1. A referred purchase of 1000 is made under the percentage rate — verify the commission is 200 (20% of 1000).
2. A referred purchase of 1000 is made under the fixed-amount rate — verify the commission is 200.
3. Verify the commission is recorded in both cases.
**Expected Result:** The rate is applied — the commission is calculated per the rate and recorded.
**Priority:** Critical

### TC-SA-14-01-005 — Rate record: the rate recorded (the rate type, the rate value, the scope); the record is the proof
**Type:** Positive
**Covers:** 1.1 → Rate record: the rate recorded (the rate type, the rate value, the scope)
**Preconditions:** A commission rate is defined.
**Steps:**
1. Open the rate record.
2. Verify it shows the rate type, the rate value, and the scope.
**Expected Result:** The rate is recorded — the rate type, the rate value, and the scope are shown.
**Priority:** High

### TC-SA-14-01-006 — Rate definition and changes are audit-logged with the rate type, value, and timestamp
**Type:** Positive
**Covers:** 1.1 → Audit logging of the rate definition and the changes; Rule: rate definition and changes are audit-logged with the rate type, value, and timestamp
**Preconditions:** Rate definition and change events have occurred.
**Steps:**
1. Open the audit trail and filter by "commission rate".
2. Verify entries show the rate type, the value, and the timestamp.
**Expected Result:** The rate definition and changes are audit-logged with the rate type, value, and timestamp.
**Priority:** Critical

### TC-SA-14-01-007 — A rate change (the type, the value, the scope updated) is recorded (the new type, the new value, the new scope, the time); it is auditable
**Type:** Positive
**Covers:** 1.1 → Rule: a rate change (the type, the value, the scope updated) is recorded (the new type, the new value, the new scope, the time); it is auditable
**Preconditions:** A commission rate is live.
**Steps:**
1. Change the rate (the new type, the new value, the new scope, the time).
2. Verify the rate is updated.
3. Verify the change is recorded and auditable.
**Expected Result:** The rate change is recorded (the new type, the new value, the new scope, the time) — it is auditable.
**Priority:** High

### TC-SA-14-01-008 — The commission rates are visible (the types, the values, the scopes); the commission structure is managed
**Type:** Positive
**Covers:** 1.1 → Rule: the commission rates are visible (the types, the values, the scopes); the commission structure is managed
**Preconditions:** Multiple commission rates are defined.
**Steps:**
1. Open the commission rates view.
2. Verify the types, the values, and the scopes are visible.
3. Verify the commission structure is managed.
**Expected Result:** The commission rates are visible — the types, the values, and the scopes are shown.
**Priority:** Medium

## 1.2 Multi-Tier Commission Structure (Tier 1 Direct Referrals, Tier 2 Sub-Affiliates)

### TC-SA-14-01-009 — Structure definition: the structure defined by the Super Admin (the tiers, the rates, the scope); the tier is explicit
**Type:** Positive
**Covers:** 1.2 → Tier definition: the tier (the Tier 1, the Tier 2); Structure definition: the structure defined by the Super Admin (the tiers, the rates, the scope); Rule: the tier is explicit (the Tier 1, the Tier 2); the tier is the structure
**Preconditions:** The Super Admin opens the commission structure.
**Steps:**
1. Define the tier structure: the tiers (the Tier 1, the Tier 2), the rates per tier (e.g., Tier 1 20%, Tier 2 10%), and the scope (the referrals, the sub-affiliates).
2. Set the Tier 1 (the direct referrals) and the rate (e.g., 20%).
3. Set the Tier 2 (the sub-affiliates) and the rate (e.g., 10%).
4. Save the structure.
5. Verify the tier structure is live and the commission is tiered (the Tier 1 for the direct, the Tier 2 for the sub).
**Expected Result:** The tier structure is defined (the tiers, the rates, the scope) — the tier is explicit.
**Priority:** Critical

### TC-SA-14-01-010 — Tier rate: the rate (the rate per tier, e.g., Tier 1 20%, Tier 2 10%); the rate is the basis
**Type:** Positive
**Covers:** 1.2 → Tier rate: the rate (the rate per tier, e.g., Tier 1 20%, Tier 2 10%); Rule: the tier rate is the measure (the rate per tier, e.g., Tier 1 20%, Tier 2 10%); the rate is the basis
**Preconditions:** The tier structure is defined.
**Steps:**
1. Open the tier rates.
2. Verify the Tier 1 rate is e.g., 20% and the Tier 2 rate is e.g., 10%.
3. Verify the rate is the basis for the tier commission.
**Expected Result:** The tier rate is the rate per tier — the rate is the basis.
**Priority:** High

### TC-SA-14-01-011 — Tier scope: the scope (the tier applies to the referrals, the sub-affiliates); the scope is the control
**Type:** Positive
**Covers:** 1.2 → Tier scope: the scope (the tier applies to the referrals, the sub-affiliates); Rule: the tier scope is the application (the referrals, the sub-affiliates); the scope is the control
**Preconditions:** The tier structure is defined with a scope.
**Steps:**
1. Open the tier scope.
2. Verify the scope is the referrals (Tier 1) and the sub-affiliates (Tier 2).
3. Verify the scope is the control.
**Expected Result:** The tier scope is the referrals and the sub-affiliates — the scope is the control.
**Priority:** High

### TC-SA-14-01-012 — Commission application: the commission applied (the Tier 1 for the direct, the Tier 2 for the sub); the commission is recorded
**Type:** Positive
**Covers:** 1.2 → Commission application: the commission applied (the Tier 1 for the direct, the Tier 2 for the sub)
**Preconditions:** The tier structure is live (Tier 1 20%, Tier 2 10%).
**Steps:**
1. A referred purchase of 1000 is made by a direct referral of affiliate A — verify affiliate A earns the Tier 1 commission (200).
2. The direct referral (now a sub-affiliate) refers a purchase of 1000 — verify affiliate A earns the Tier 2 commission (100).
3. Verify both commissions are recorded.
**Expected Result:** The commission is applied — the Tier 1 for the direct referral and the Tier 2 for the sub-affiliate.
**Priority:** Critical

### TC-SA-14-01-013 — Commission record: the commission recorded (the affiliate, the tier, the rate, the commission); the record is the proof
**Type:** Positive
**Covers:** 1.2 → Commission record: the commission recorded (the affiliate, the tier, the rate, the commission)
**Preconditions:** Tier commissions have been applied.
**Steps:**
1. Open the commission record.
2. Verify it shows the affiliate, the tier, the rate, and the commission.
**Expected Result:** The commission is recorded — the affiliate, the tier, the rate, and the commission are shown.
**Priority:** High

### TC-SA-14-01-014 — Structure definition and applications are audit-logged with the affiliate, tier, and timestamp
**Type:** Positive
**Covers:** 1.2 → Audit logging of the structure definition and the applications; Rule: structure definition and applications are audit-logged with the affiliate, tier, and timestamp
**Preconditions:** Structure definition and application events have occurred.
**Steps:**
1. Open the audit trail and filter by "tier structure".
2. Verify entries show the affiliate, the tier, and the timestamp.
**Expected Result:** The structure definition and applications are audit-logged with the affiliate, tier, and timestamp.
**Priority:** Critical

### TC-SA-14-01-015 — A structure change (the tiers, the rates, the scope updated) is recorded (the new tiers, the new rates, the new scope, the time); it is auditable
**Type:** Positive
**Covers:** 1.2 → Rule: a structure change (the tiers, the rates, the scope updated) is recorded (the new tiers, the new rates, the new scope, the time); it is auditable
**Preconditions:** The tier structure is live.
**Steps:**
1. Change the structure (the new tiers, the new rates, the new scope, the time).
2. Verify the structure is updated.
3. Verify the change is recorded and auditable.
**Expected Result:** The structure change is recorded (the new tiers, the new rates, the new scope, the time) — it is auditable.
**Priority:** High

### TC-SA-14-01-016 — The tier structure is visible (the tiers, the rates, the scopes); the multi-tier structure is managed
**Type:** Positive
**Covers:** 1.2 → Rule: the tier structure is visible (the tiers, the rates, the scopes); the multi-tier structure is managed
**Preconditions:** The tier structure is defined.
**Steps:**
1. Open the tier structure view.
2. Verify the tiers, the rates, and the scopes are visible.
3. Verify the multi-tier structure is managed.
**Expected Result:** The tier structure is visible — the tiers, the rates, and the scopes are shown.
**Priority:** Medium

## 1.3 Recruitment Rewards and Leadership Bonuses

### TC-SA-14-01-017 — Reward definition: the reward defined by the Super Admin (the reward, the condition, the scope); the recruitment reward is the incentive
**Type:** Positive
**Covers:** 1.3 → Recruitment reward: the reward (the reward for the recruit, e.g., a fixed amount, a percentage); Reward definition: the reward defined by the Super Admin (the reward, the condition, the scope); Rule: the recruitment reward is the incentive (the reward for the recruit, e.g., a fixed amount, a percentage); the reward is the value
**Preconditions:** The Super Admin opens the commission structure.
**Steps:**
1. Define the recruitment reward: the reward (the reward for the recruit, e.g., a fixed amount, a percentage), the condition (the condition for the reward, e.g., the recruit makes a purchase), and the scope.
2. Save the reward.
3. Verify the recruitment rewards are live and the recruiter earns the reward for the recruit.
**Expected Result:** The recruitment reward is defined (the reward, the condition, the scope) — the reward is the incentive.
**Priority:** Critical

### TC-SA-14-01-018 — Reward condition: the condition (the condition for the reward, e.g., the recruit makes a purchase); the condition is the gate
**Type:** Negative
**Covers:** 1.3 → Reward condition: the condition (the condition for the reward, e.g., the recruit makes a purchase); Rule: the reward condition is the trigger (the condition for the reward, e.g., the recruit makes a purchase); the condition is the gate
**Preconditions:** A recruitment reward is live with the condition "the recruit makes a purchase".
**Steps:**
1. An affiliate recruits another affiliate who does not make a purchase — verify the reward is not applied (the condition is not met).
2. The recruit makes a purchase — verify the reward is now applied (the condition is met).
3. Verify the condition is the gate.
**Expected Result:** The reward condition is enforced — the reward is applied only when the condition is met.
**Priority:** Critical

### TC-SA-14-01-019 — Leadership bonus: the bonus (the bonus for the leader, e.g., a percentage of the team's commissions); the bonus is the value
**Type:** Positive
**Covers:** 1.3 → Leadership bonus: the bonus (the bonus for the leader, e.g., a percentage of the team's commissions); Rule: the leadership bonus is the leadership incentive (the bonus for the leader, e.g., a percentage of the team's commissions); the bonus is the value
**Preconditions:** A leadership bonus is defined (e.g., 5% of the team's commissions).
**Steps:**
1. A leader's team earns 10000 in commissions.
2. Verify the leader earns the leadership bonus (500, i.e., 5% of 10000).
3. Verify the bonus is the leadership incentive.
**Expected Result:** The leadership bonus is applied — the leader earns the bonus per the team's commissions.
**Priority:** High

### TC-SA-14-01-020 — Reward application: the reward applied (the recruiter earns the reward for the recruit); the reward is recorded
**Type:** Positive
**Covers:** 1.3 → Reward application: the reward applied (the recruiter earns the reward for the recruit)
**Preconditions:** A recruitment reward is live (e.g., a fixed amount of 500 when the recruit makes a purchase).
**Steps:**
1. An affiliate recruits another affiliate.
2. The recruit makes a purchase.
3. Verify the recruiter earns the reward (500) and the reward is recorded.
**Expected Result:** The reward is applied — the recruiter earns the reward for the recruit and it is recorded.
**Priority:** Critical

### TC-SA-14-01-021 — Reward record: the reward recorded (the recruiter, the recruit, the reward, the condition); the record is the proof
**Type:** Positive
**Covers:** 1.3 → Reward record: the reward recorded (the recruiter, the recruit, the reward, the condition)
**Preconditions:** A recruitment reward has been applied.
**Steps:**
1. Open the reward record.
2. Verify it shows the recruiter, the recruit, the reward, and the condition.
**Expected Result:** The reward is recorded — the recruiter, the recruit, the reward, and the condition are shown.
**Priority:** High

### TC-SA-14-01-022 — Reward definition and applications are audit-logged with the recruiter, recruit, and timestamp
**Type:** Positive
**Covers:** 1.3 → Audit logging of the reward definition and the applications; Rule: reward definition and applications are audit-logged with the recruiter, recruit, and timestamp
**Preconditions:** Reward definition and application events have occurred.
**Steps:**
1. Open the audit trail and filter by "recruitment reward".
2. Verify entries show the recruiter, the recruit, and the timestamp.
**Expected Result:** The reward definition and applications are audit-logged with the recruiter, recruit, and timestamp.
**Priority:** Critical

### TC-SA-14-01-023 — A reward change (the reward, the condition, the scope updated) is recorded (the new reward, the new condition, the new scope, the time); it is auditable
**Type:** Positive
**Covers:** 1.3 → Rule: a reward change (the reward, the condition, the scope updated) is recorded (the new reward, the new condition, the new scope, the time); it is auditable
**Preconditions:** A recruitment reward is live.
**Steps:**
1. Change the reward (the new reward, the new condition, the new scope, the time).
2. Verify the reward is updated.
3. Verify the change is recorded and auditable.
**Expected Result:** The reward change is recorded (the new reward, the new condition, the new scope, the time) — it is auditable.
**Priority:** High

### TC-SA-14-01-024 — The recruitment rewards are visible (the rewards, the conditions, the scopes); the recruitment incentives are managed
**Type:** Positive
**Covers:** 1.3 → Rule: the recruitment rewards are visible (the rewards, the conditions, the scopes); the recruitment incentives are managed
**Preconditions:** Multiple recruitment rewards are defined.
**Steps:**
1. Open the recruitment rewards view.
2. Verify the rewards, the conditions, and the scopes are visible.
3. Verify the recruitment incentives are managed.
**Expected Result:** The recruitment rewards are visible — the rewards, the conditions, and the scopes are shown.
**Priority:** Medium
