# 5. Commission Tracking — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: commission_tracking.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 |
|---------|--------------------|----------|
| 5.1 Track Pending, Earned, and Paid Commissions | Commission status: the status (the pending, the earned, the paid) | TC-SA-14-05-001 |
| 5.1 Track Pending, Earned, and Paid Commissions | Pending commission: the pending (the commission that is not yet earned, e.g., the referral is not confirmed) | TC-SA-14-05-002 |
| 5.1 Track Pending, Earned, and Paid Commissions | Earned commission: the earned (the commission that is earned, e.g., the referral is confirmed) | TC-SA-14-05-003 |
| 5.1 Track Pending, Earned, and Paid Commissions | Paid commission: the paid (the commission that is paid, e.g., the payout is made) | TC-SA-14-05-004 |
| 5.1 Track Pending, Earned, and Paid Commissions | Commission record: the record (the affiliate, the commission, the status, the date) | TC-SA-14-05-005 |
| 5.1 Track Pending, Earned, and Paid Commissions | Commission view: the view (the commissions per affiliate, per status) | TC-SA-14-05-006 |
| 5.1 Track Pending, Earned, and Paid Commissions | Audit logging of the commission tracking | TC-SA-14-05-007 |
| 5.1 Track Pending, Earned, and Paid Commissions | Rule: the commission status is the pending, the earned, or the paid; the status is the control | TC-SA-14-05-001 |
| 5.1 Track Pending, Earned, and Paid Commissions | Rule: the pending commission is the in-progress (the commission that is not yet earned, e.g., the referral is not confirmed); the pending is the state | TC-SA-14-05-002 |
| 5.1 Track Pending, Earned, and Paid Commissions | Rule: the earned commission is the confirmed (the commission that is earned, e.g., the referral is confirmed); the earned is the state | TC-SA-14-05-003 |
| 5.1 Track Pending, Earned, and Paid Commissions | Rule: the paid commission is the settled (the commission that is paid, e.g., the payout is made); the paid is the state | TC-SA-14-05-004 |
| 5.1 Track Pending, Earned, and Paid Commissions | Rule: the commissions are visible (the commissions per affiliate, per status); the tracking is managed | TC-SA-14-05-006 |
| 5.1 Track Pending, Earned, and Paid Commissions | Rule: commission tracking is audit-logged with the affiliate, commission, and timestamp | TC-SA-14-05-007 |
| 5.2 Track Subscription Renewals from Referrals | Renewal tracking: the tracking (the affiliate, the referral, the renewal, the commission) | TC-SA-14-05-008 |
| 5.2 Track Subscription Renewals from Referrals | Renewal scope: the scope (the referral, the renewal) | TC-SA-14-05-009 |
| 5.2 Track Subscription Renewals from Referrals | Renewal commission: the commission (the commission for the renewal, e.g., a percentage of the renewal) | TC-SA-14-05-010 |
| 5.2 Track Subscription Renewals from Referrals | Renewal record: the record (the affiliate, the referral, the renewal, the commission, the date) | TC-SA-14-05-011 |
| 5.2 Track Subscription Renewals from Referrals | Renewal view: the view (the renewals per affiliate, per period) | TC-SA-14-05-012 |
| 5.2 Track Subscription Renewals from Referrals | Renewal trend: the trend (the renewal trend, the period) | TC-SA-14-05-013 |
| 5.2 Track Subscription Renewals from Referrals | Audit logging of the renewal tracking | TC-SA-14-05-014 |
| 5.2 Track Subscription Renewals from Referrals | Rule: the renewal tracking is explicit (the affiliate, the referral, the renewal, the commission); the tracking is the visibility | TC-SA-14-05-008 |
| 5.2 Track Subscription Renewals from Referrals | Rule: the renewal scope is the referral and the renewal; the scope is the control | TC-SA-14-05-009 |
| 5.2 Track Subscription Renewals from Referrals | Rule: the renewal commission is the value (the commission for the renewal, e.g., a percentage of the renewal); the commission is the measure | TC-SA-14-05-010 |
| 5.2 Track Subscription Renewals from Referrals | Rule: the renewal record is the proof (the affiliate, the referral, the renewal, the commission, the date); the record is the audit | TC-SA-14-05-011 |
| 5.2 Track Subscription Renewals from Referrals | Rule: the renewals are visible (the renewals per affiliate, per period); the tracking is managed | TC-SA-14-05-012 |
| 5.2 Track Subscription Renewals from Referrals | Rule: renewal tracking is audit-logged with the affiliate, referral, and timestamp | TC-SA-14-05-014 |
| 5.3 Commission Calculator Configuration | Calculator input: the input (the input for the calculator, e.g., the purchase amount, the rate) | TC-SA-14-05-015 |
| 5.3 Commission Calculator Configuration | Calculation rule: the rule (the rule for the calculation, e.g., the percentage, the fixed amount) | TC-SA-14-05-016 |
| 5.3 Commission Calculator Configuration | Calculator output: the output (the output of the calculator, e.g., the commission) | TC-SA-14-05-017 |
| 5.3 Commission Calculator Configuration | Calculator definition: the calculator defined by the Super Admin (the inputs, the rules, the output) | TC-SA-14-05-015 |
| 5.3 Commission Calculator Configuration | Calculator use: the use (the calculator is used to calculate the commission) | TC-SA-14-05-018 |
| 5.3 Commission Calculator Configuration | Calculator record: the record (the input, the rule, the output, the date) | TC-SA-14-05-019 |
| 5.3 Commission Calculator Configuration | Audit logging of the calculator definition and the uses | TC-SA-14-05-020 |
| 5.3 Commission Calculator Configuration | Rule: the calculator input is the basis (the input for the calculator, e.g., the purchase amount, the rate); the input is the data | TC-SA-14-05-015 |
| 5.3 Commission Calculator Configuration | Rule: the calculation rule is the method (the rule for the calculation, e.g., the percentage, the fixed amount); the rule is the logic | TC-SA-14-05-016 |
| 5.3 Commission Calculator Configuration | Rule: the calculator output is the result (the output of the calculator, e.g., the commission); the output is the value | TC-SA-14-05-017 |
| 5.3 Commission Calculator Configuration | Rule: a calculator change (the inputs, the rules, the output updated) is recorded (the new inputs, the new rules, the new output, the time); it is auditable | TC-SA-14-05-021 |
| 5.3 Commission Calculator Configuration | Rule: the calculator is visible (the inputs, the rules, the outputs); the calculation is managed | TC-SA-14-05-022 |
| 5.3 Commission Calculator Configuration | Rule: calculator definition and uses are audit-logged with the input, rule, and timestamp | TC-SA-14-05-020 |

## 5.1 Track Pending, Earned, and Paid Commissions

### TC-SA-14-05-001 — Commission status: the status (the pending, the earned, the paid); the status is the control
**Type:** Negative
**Covers:** 5.1 → Commission status: the status (the pending, the earned, the paid); Rule: the commission status is the pending, the earned, or the paid; the status is the control
**Preconditions:** Commissions exist in each status (pending, earned, paid).
**Steps:**
1. Verify a commission for an unconfirmed referral has the status pending.
2. Verify a commission for a confirmed referral has the status earned and a paid commission has the status paid.
3. Attempt to set a commission to a status other than pending, earned, or paid — verify the system rejects it.
**Expected Result:** The commission status is the pending, the earned, or the paid — no other status is allowed.
**Priority:** High

### TC-SA-14-05-002 — Pending commission: the pending (the commission that is not yet earned, e.g., the referral is not confirmed); the pending is the state
**Type:** Positive
**Covers:** 5.1 → Pending commission: the pending (the commission that is not yet earned, e.g., the referral is not confirmed); Rule: the pending commission is the in-progress (the commission that is not yet earned, e.g., the referral is not confirmed); the pending is the state
**Preconditions:** A referral has been made but not yet confirmed.
**Steps:**
1. View the pending commissions.
2. Verify the commission for the unconfirmed referral is shown as pending (the commission that is not yet earned).
3. Verify the pending is the in-progress state.
**Expected Result:** The pending commission is shown — the commission that is not yet earned (the referral is not confirmed).
**Priority:** High

### TC-SA-14-05-003 — Earned commission: the earned (the commission that is earned, e.g., the referral is confirmed); the earned is the state
**Type:** Positive
**Covers:** 5.1 → Earned commission: the earned (the commission that is earned, e.g., the referral is confirmed); Rule: the earned commission is the confirmed (the commission that is earned, e.g., the referral is confirmed); the earned is the state
**Preconditions:** A referral has been confirmed.
**Steps:**
1. View the earned commissions.
2. Verify the commission for the confirmed referral is shown as earned (the commission that is earned).
3. Verify the earned is the confirmed state.
**Expected Result:** The earned commission is shown — the commission that is earned (the referral is confirmed).
**Priority:** High

### TC-SA-14-05-004 — Paid commission: the paid (the commission that is paid, e.g., the payout is made); the paid is the state
**Type:** Positive
**Covers:** 5.1 → Paid commission: the paid (the commission that is paid, e.g., the payout is made); Rule: the paid commission is the settled (the commission that is paid, e.g., the payout is made); the paid is the state
**Preconditions:** A payout has been made for an earned commission.
**Steps:**
1. View the paid commissions.
2. Verify the commission for the made payout is shown as paid (the commission that is paid).
3. Verify the paid is the settled state.
**Expected Result:** The paid commission is shown — the commission that is paid (the payout is made).
**Priority:** High

### TC-SA-14-05-005 — Commission record: the record (the affiliate, the commission, the status, the date); the record is the proof
**Type:** Positive
**Covers:** 5.1 → Commission record: the record (the affiliate, the commission, the status, the date)
**Preconditions:** Commissions have been tracked.
**Steps:**
1. Open the commission record.
2. Verify it shows the affiliate, the commission, the status, and the date.
**Expected Result:** The commission is recorded — the affiliate, the commission, the status, and the date are shown.
**Priority:** High

### TC-SA-14-05-006 — Commission view: the view (the commissions per affiliate, per status); the tracking is managed
**Type:** Positive
**Covers:** 5.1 → Commission view: the view (the commissions per affiliate, per status); Rule: the commissions are visible (the commissions per affiliate, per status); the tracking is managed
**Preconditions:** Commissions exist for multiple affiliates in multiple statuses.
**Steps:**
1. View the commissions per affiliate — verify each affiliate's commissions are shown.
2. View the commissions per status — verify the pending, earned, and paid are shown separately.
3. Verify the tracking is complete and managed.
**Expected Result:** The commissions are visible — the commissions per affiliate, per status are shown.
**Priority:** High

### TC-SA-14-05-007 — Commission tracking is audit-logged with the affiliate, commission, and timestamp
**Type:** Positive
**Covers:** 5.1 → Audit logging of the commission tracking; Rule: commission tracking is audit-logged with the affiliate, commission, and timestamp
**Preconditions:** Commission tracking events have occurred.
**Steps:**
1. Open the audit trail and filter by "commission tracking".
2. Verify entries show the affiliate, the commission, and the timestamp.
**Expected Result:** The commission tracking is audit-logged with the affiliate, commission, and timestamp.
**Priority:** Critical

## 5.2 Track Subscription Renewals from Referrals

### TC-SA-14-05-008 — Renewal tracking: the tracking (the affiliate, the referral, the renewal, the commission); the tracking is the visibility
**Type:** Positive
**Covers:** 5.2 → Renewal tracking: the tracking (the affiliate, the referral, the renewal, the commission); Rule: the renewal tracking is explicit (the affiliate, the referral, the renewal, the commission); the tracking is the visibility
**Preconditions:** A referred subscription has been renewed.
**Steps:**
1. View the renewal tracking.
2. Verify it shows the affiliate, the referral, the renewal, and the commission.
3. Verify the tracking is explicit.
**Expected Result:** The renewal tracking is shown — the affiliate, the referral, the renewal, and the commission are visible.
**Priority:** Critical

### TC-SA-14-05-009 — Renewal scope: the scope (the referral, the renewal); the scope is the control
**Type:** Negative
**Covers:** 5.2 → Renewal scope: the scope (the referral, the renewal); Rule: the renewal scope is the referral and the renewal; the scope is the control
**Preconditions:** Renewal tracking is live with the scope (the referral, the renewal).
**Steps:**
1. A referred subscription is renewed — verify the renewal is tracked (the scope applies).
2. A non-referred subscription is renewed — verify the renewal is not tracked for any affiliate (the scope does not apply).
3. Verify the scope is the control.
**Expected Result:** The renewal scope is enforced — only the renewals of referred subscriptions are tracked.
**Priority:** Critical

### TC-SA-14-05-010 — Renewal commission: the commission (the commission for the renewal, e.g., a percentage of the renewal); the commission is the measure
**Type:** Positive
**Covers:** 5.2 → Renewal commission: the commission (the commission for the renewal, e.g., a percentage of the renewal); Rule: the renewal commission is the value (the commission for the renewal, e.g., a percentage of the renewal); the commission is the measure
**Preconditions:** A referred subscription of 1000 is renewed and the renewal commission is 10% of the renewal.
**Steps:**
1. View the renewal commission.
2. Verify the commission is 100 (10% of the 1000 renewal).
3. Verify the commission is the value.
**Expected Result:** The renewal commission is shown — the commission for the renewal (e.g., a percentage of the renewal).
**Priority:** High

### TC-SA-14-05-011 — Renewal record: the record (the affiliate, the referral, the renewal, the commission, the date); the record is the audit
**Type:** Positive
**Covers:** 5.2 → Renewal record: the record (the affiliate, the referral, the renewal, the commission, the date); Rule: the renewal record is the proof (the affiliate, the referral, the renewal, the commission, the date); the record is the audit
**Preconditions:** A renewal has been tracked.
**Steps:**
1. Open the renewal record.
2. Verify it shows the affiliate, the referral, the renewal, the commission, and the date.
**Expected Result:** The renewal is recorded — the affiliate, the referral, the renewal, the commission, and the date are shown.
**Priority:** High

### TC-SA-14-05-012 — Renewal view: the view (the renewals per affiliate, per period); the tracking is managed
**Type:** Positive
**Covers:** 5.2 → Renewal view: the view (the renewals per affiliate, per period); Rule: the renewals are visible (the renewals per affiliate, per period); the tracking is managed
**Preconditions:** Renewals exist for multiple affiliates across multiple periods.
**Steps:**
1. View the renewals per affiliate — verify each affiliate's renewals are shown.
2. View the renewals per period — verify the renewals for each period are shown.
3. Verify the tracking is complete and managed.
**Expected Result:** The renewals are visible — the renewals per affiliate, per period are shown.
**Priority:** High

### TC-SA-14-05-013 — Renewal trend: the trend (the renewal trend, the period); the trend is the direction
**Type:** Positive
**Covers:** 5.2 → Renewal trend: the trend (the renewal trend, the period)
**Preconditions:** Renewals exist across multiple periods.
**Steps:**
1. View the renewal trend.
2. Verify the trend is shown per period (e.g., increasing, decreasing, stable).
3. Verify the trend is the direction of the renewals.
**Expected Result:** The renewal trend is shown — the renewal trend per period is visible.
**Priority:** Medium

### TC-SA-14-05-014 — Renewal tracking is audit-logged with the affiliate, referral, and timestamp
**Type:** Positive
**Covers:** 5.2 → Audit logging of the renewal tracking; Rule: renewal tracking is audit-logged with the affiliate, referral, and timestamp
**Preconditions:** Renewal tracking events have occurred.
**Steps:**
1. Open the audit trail and filter by "renewal tracking".
2. Verify entries show the affiliate, the referral, and the timestamp.
**Expected Result:** The renewal tracking is audit-logged with the affiliate, referral, and timestamp.
**Priority:** Critical

## 5.3 Commission Calculator Configuration

### TC-SA-14-05-015 — Calculator definition: the calculator defined by the Super Admin (the inputs, the rules, the output); the calculator input is the basis
**Type:** Positive
**Covers:** 5.3 → Calculator input: the input (the input for the calculator, e.g., the purchase amount, the rate); Calculator definition: the calculator defined by the Super Admin (the inputs, the rules, the output); Rule: the calculator input is the basis (the input for the calculator, e.g., the purchase amount, the rate); the input is the data
**Preconditions:** The Super Admin opens the commission tracking.
**Steps:**
1. Define the calculator configuration: the inputs (e.g., the purchase amount, the rate), the calculation rules (e.g., the percentage, the fixed amount), and the output (e.g., the commission).
2. Save the calculator.
3. Verify the calculator is live and the commissions are calculated (the calculator is the tool).
**Expected Result:** The calculator is defined (the inputs, the rules, the output) — the input is the basis.
**Priority:** Critical

### TC-SA-14-05-016 — Calculation rule: the rule (the rule for the calculation, e.g., the percentage, the fixed amount); the rule is the logic
**Type:** Positive
**Covers:** 5.3 → Calculation rule: the rule (the rule for the calculation, e.g., the percentage, the fixed amount); Rule: the calculation rule is the method (the rule for the calculation, e.g., the percentage, the fixed amount); the rule is the logic
**Preconditions:** The calculator is defined with a calculation rule.
**Steps:**
1. Open the calculation rule.
2. Verify the rule is the percentage or the fixed amount.
3. Verify the rule is the method for the calculation.
**Expected Result:** The calculation rule is shown — the rule for the calculation (e.g., the percentage, the fixed amount).
**Priority:** High

### TC-SA-14-05-017 — Calculator output: the output (the output of the calculator, e.g., the commission); the output is the value
**Type:** Positive
**Covers:** 5.3 → Calculator output: the output (the output of the calculator, e.g., the commission); Rule: the calculator output is the result (the output of the calculator, e.g., the commission); the output is the value
**Preconditions:** The calculator is defined with an output.
**Steps:**
1. Open the calculator output.
2. Verify the output is the commission.
3. Verify the output is the result of the calculation.
**Expected Result:** The calculator output is shown — the output of the calculator (e.g., the commission).
**Priority:** High

### TC-SA-14-05-018 — Calculator use: the use (the calculator is used to calculate the commission); the calculation is recorded
**Type:** Negative
**Covers:** 5.3 → Calculator use: the use (the calculator is used to calculate the commission)
**Preconditions:** The calculator is live (percentage rule, 20%).
**Steps:**
1. Provide the input (the purchase amount 1000, the rate 20%) — verify the output is the commission (200).
2. Provide an invalid input (a negative purchase amount) — verify the calculator rejects it or flags it as a deviation.
3. Verify the calculation is recorded.
**Expected Result:** The calculator is used — the input is provided, the rule is applied, the output is the commission, and the calculation is recorded.
**Priority:** Critical

### TC-SA-14-05-019 — Calculator record: the record (the input, the rule, the output, the date); the record is the proof
**Type:** Positive
**Covers:** 5.3 → Calculator record: the record (the input, the rule, the output, the date)
**Preconditions:** A commission has been calculated using the calculator.
**Steps:**
1. Open the calculator record.
2. Verify it shows the input, the rule, the output, and the date.
**Expected Result:** The calculation is recorded — the input, the rule, the output, and the date are shown.
**Priority:** High

### TC-SA-14-05-020 — Calculator definition and uses are audit-logged with the input, rule, and timestamp
**Type:** Positive
**Covers:** 5.3 → Audit logging of the calculator definition and the uses; Rule: calculator definition and uses are audit-logged with the input, rule, and timestamp
**Preconditions:** Calculator definition and use events have occurred.
**Steps:**
1. Open the audit trail and filter by "commission calculator".
2. Verify entries show the input, the rule, and the timestamp.
**Expected Result:** The calculator definition and uses are audit-logged with the input, rule, and timestamp.
**Priority:** Critical

### TC-SA-14-05-021 — A calculator change (the inputs, the rules, the output updated) is recorded (the new inputs, the new rules, the new output, the time); it is auditable
**Type:** Positive
**Covers:** 5.3 → Rule: a calculator change (the inputs, the rules, the output updated) is recorded (the new inputs, the new rules, the new output, the time); it is auditable
**Preconditions:** The calculator is live.
**Steps:**
1. Change the calculator (the new inputs, the new rules, the new output, the time).
2. Verify the calculator is updated.
3. Verify the change is recorded and auditable.
**Expected Result:** The calculator change is recorded (the new inputs, the new rules, the new output, the time) — it is auditable.
**Priority:** High

### TC-SA-14-05-022 — The calculator is visible (the inputs, the rules, the outputs); the calculation is managed
**Type:** Positive
**Covers:** 5.3 → Rule: the calculator is visible (the inputs, the rules, the outputs); the calculation is managed
**Preconditions:** The calculator is defined.
**Steps:**
1. Open the calculator view.
2. Verify the inputs, the rules, and the outputs are visible.
3. Verify the calculation is managed.
**Expected Result:** The calculator is visible — the inputs, the rules, and the outputs are shown.
**Priority:** Medium
