# 2. Commission Calculator & Earnings — Test Cases

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

## Test Execution Policy

- Zero tolerance: any deviation from the documented behavior is a defect.
- Every failed test is logged with a Bug ID, the feature, the sub-feature, the expected vs actual result, and the severity; 100% of bugs are fixed before the group passes.
- 100% pass rate is required for the group to be marked complete.

## Coverage Matrix

| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 2.1 | Enter a course price | TC-AF-4-02-001 |
| 2.1 | Enter a quantity | TC-AF-4-02-002 |
| 2.1 | Commission calculated at the Affiliate's rate | TC-AF-4-02-003 |
| 2.1 | Scenario modeling | TC-AF-4-02-004 |
| 2.1 | Rate shown in the calculator | TC-AF-4-02-005 |
| 2.1 | Calculator available on web and mobile | TC-AF-4-02-006 |
| 2.1 | Calculator event logging (used) | TC-AF-4-02-007 |
| 2.1 | Audit logging of the commission calculator | TC-AF-4-02-008 |
| 2.1 | Rule: The commission is calculated at the Affiliate's rate. | TC-AF-4-02-001 |
| 2.1 | Rule: Scenarios can be modeled. | TC-AF-4-02-002 |
| 2.1 | Rule: Calculator events (used) are logged with the account and the timestamp. | TC-AF-4-02-003 |
| 2.1 | Rule: The commission calculator is audit-logged with the account and the timestamp. | TC-AF-4-02-004 |
| 2.2 | Detailed earnings statement | TC-AF-4-02-009 |
| 2.2 | Each commission entry with customer, course, amount, date | TC-AF-4-02-010 |
| 2.2 | Select the statement period | TC-AF-4-02-011 |
| 2.2 | View the statement | TC-AF-4-02-012 |
| 2.2 | Download the statement | TC-AF-4-02-013 |
| 2.2 | Statement available on web and mobile | TC-AF-4-02-014 |
| 2.2 | Statement event logging (viewed, downloaded) | TC-AF-4-02-015 |
| 2.2 | Audit logging of the earnings statement | TC-AF-4-02-016 |
| 2.2 | Rule: The statement is itemized per commission entry. | TC-AF-4-02-009 |
| 2.2 | Rule: The period can be selected. | TC-AF-4-02-010 |
| 2.2 | Rule: The statement can be downloaded. | TC-AF-4-02-011 |
| 2.2 | Rule: Statement events (viewed, downloaded) are logged with the account and the timestamp. | TC-AF-4-02-012 |
| 2.2 | Rule: The earnings statement is audit-logged with the account and the timestamp. | TC-AF-4-02-013 |
| 2.3 | Current commission rate shown | TC-AF-4-02-017 |
| 2.3 | Base rate shown | TC-AF-4-02-018 |
| 2.3 | Tier-based increases shown | TC-AF-4-02-019 |
| 2.3 | Effective rate per course | TC-AF-4-02-020 |
| 2.3 | Rate change history | TC-AF-4-02-021 |
| 2.3 | Rate details available on web and mobile | TC-AF-4-02-022 |
| 2.3 | Rate details event logging (viewed) | TC-AF-4-02-023 |
| 2.3 | Audit logging of the commission rate details | TC-AF-4-02-024 |
| 2.3 | Rule: The rate shows the base, tier increases, and effective rate. | TC-AF-4-02-017 |
| 2.3 | Rule: The rate change history is shown. | TC-AF-4-02-018 |
| 2.3 | Rule: Rate details events (viewed) are logged with the account and the timestamp. | TC-AF-4-02-019 |
| 2.3 | Rule: The commission rate details is audit-logged with the account and the timestamp. | TC-AF-4-02-020 |

## 2.1 Commission Calculator

### TC-AF-4-02-001 — Enter a course price
**Type:** Positive
**Covers:** 2.1 → Enter a course price; Rule: The commission is calculated at the Affiliate's rate.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Enter a course price.
2. Observe the result and verify the full behavior: Enter a course price.
**Expected Result:** Enter a course price — delivered exactly as documented.
**Priority:** Critical

### TC-AF-4-02-002 — Enter a quantity
**Type:** Positive
**Covers:** 2.1 → Enter a quantity; Rule: Scenarios can be modeled.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Enter a quantity.
2. Observe the result and verify the full behavior: Enter a quantity.
**Expected Result:** Enter a quantity — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-003 — Commission calculated at the Affiliate's rate
**Type:** Positive
**Covers:** 2.1 → Commission calculated at the Affiliate's rate; Rule: Calculator events (used) are logged with the account and the timestamp.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Commission calculated at the Affiliate's rate.
2. Observe the result and verify the full behavior: Commission calculated at the Affiliate's rate.
**Expected Result:** Commission calculated at the Affiliate's rate — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-004 — Scenario modeling
**Type:** Positive
**Covers:** 2.1 → Scenario modeling; Rule: The commission calculator is audit-logged with the account and the timestamp.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Scenario modeling.
2. Observe the result and verify the full behavior: Scenario modeling.
**Expected Result:** Scenario modeling — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-005 — Rate shown in the calculator
**Type:** Positive
**Covers:** 2.1 → Rate shown in the calculator
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Rate shown in the calculator.
2. Observe the result and verify the full behavior: Rate shown in the calculator.
**Expected Result:** Rate shown in the calculator — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-006 — Calculator available on web and mobile
**Type:** Positive
**Covers:** 2.1 → Calculator available on web and mobile
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Calculator available on web and mobile.
2. Observe the result and verify the full behavior: Calculator available on web and mobile.
**Expected Result:** Calculator available on web and mobile — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-007 — Calculator event logging (used)
**Type:** Positive
**Covers:** 2.1 → Calculator event logging (used)
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Calculator event logging (used).
2. Observe the result and verify the full behavior: Calculator event logging (used).
**Expected Result:** Calculator event logging (used) — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-008 — Audit logging of the commission calculator
**Type:** Positive
**Covers:** 2.1 → Audit logging of the commission calculator
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, perform the commission calculator action.
2. Open the audit log and verify the entry for the action.
**Expected Result:** The commission calculator action is recorded in the audit log with the account and the timestamp.
**Priority:** Critical


## 2.2 Earnings Statement

### TC-AF-4-02-009 — Detailed earnings statement
**Type:** Positive
**Covers:** 2.2 → Detailed earnings statement; Rule: The statement is itemized per commission entry.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Detailed earnings statement.
2. Observe the result and verify the full behavior: Detailed earnings statement.
**Expected Result:** Detailed earnings statement — delivered exactly as documented.
**Priority:** Critical

### TC-AF-4-02-010 — Each commission entry with customer, course, amount, date
**Type:** Positive
**Covers:** 2.2 → Each commission entry with customer, course, amount, date; Rule: The period can be selected.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Each commission entry with customer, course, amount, date.
2. Observe the result and verify the full behavior: Each commission entry with customer, course, amount, date.
**Expected Result:** Each commission entry with customer, course, amount, date — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-011 — Select the statement period
**Type:** Positive
**Covers:** 2.2 → Select the statement period; Rule: The statement can be downloaded.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Select the statement period.
2. Observe the result and verify the full behavior: Select the statement period.
**Expected Result:** Select the statement period — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-012 — View the statement
**Type:** Positive
**Covers:** 2.2 → View the statement; Rule: Statement events (viewed, downloaded) are logged with the account and the timestamp.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: View the statement.
2. Observe the result and verify the full behavior: View the statement.
**Expected Result:** View the statement — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-013 — Download the statement
**Type:** Positive
**Covers:** 2.2 → Download the statement; Rule: The earnings statement is audit-logged with the account and the timestamp.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Download the statement.
2. Observe the result and verify the full behavior: Download the statement.
**Expected Result:** Download the statement — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-014 — Statement available on web and mobile
**Type:** Positive
**Covers:** 2.2 → Statement available on web and mobile
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Statement available on web and mobile.
2. Observe the result and verify the full behavior: Statement available on web and mobile.
**Expected Result:** Statement available on web and mobile — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-015 — Statement event logging (viewed, downloaded)
**Type:** Positive
**Covers:** 2.2 → Statement event logging (viewed, downloaded)
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Statement event logging (viewed, downloaded).
2. Observe the result and verify the full behavior: Statement event logging (viewed, downloaded).
**Expected Result:** Statement event logging (viewed, downloaded) — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-016 — Audit logging of the earnings statement
**Type:** Positive
**Covers:** 2.2 → Audit logging of the earnings statement
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, perform the earnings statement action.
2. Open the audit log and verify the entry for the action.
**Expected Result:** The earnings statement action is recorded in the audit log with the account and the timestamp.
**Priority:** Critical


## 2.3 Commission Rate Details

### TC-AF-4-02-017 — Current commission rate shown
**Type:** Positive
**Covers:** 2.3 → Current commission rate shown; Rule: The rate shows the base, tier increases, and effective rate.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Current commission rate shown.
2. Observe the result and verify the full behavior: Current commission rate shown.
**Expected Result:** Current commission rate shown — delivered exactly as documented.
**Priority:** Critical

### TC-AF-4-02-018 — Base rate shown
**Type:** Positive
**Covers:** 2.3 → Base rate shown; Rule: The rate change history is shown.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Base rate shown.
2. Observe the result and verify the full behavior: Base rate shown.
**Expected Result:** Base rate shown — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-019 — Tier-based increases shown
**Type:** Positive
**Covers:** 2.3 → Tier-based increases shown; Rule: Rate details events (viewed) are logged with the account and the timestamp.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Tier-based increases shown.
2. Observe the result and verify the full behavior: Tier-based increases shown.
**Expected Result:** Tier-based increases shown — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-020 — Effective rate per course
**Type:** Positive
**Covers:** 2.3 → Effective rate per course; Rule: The commission rate details is audit-logged with the account and the timestamp.
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Effective rate per course.
2. Observe the result and verify the full behavior: Effective rate per course.
**Expected Result:** Effective rate per course — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-021 — Rate change history
**Type:** Positive
**Covers:** 2.3 → Rate change history
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Rate change history.
2. Observe the result and verify the full behavior: Rate change history.
**Expected Result:** Rate change history — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-022 — Rate details available on web and mobile
**Type:** Positive
**Covers:** 2.3 → Rate details available on web and mobile
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Rate details available on web and mobile.
2. Observe the result and verify the full behavior: Rate details available on web and mobile.
**Expected Result:** Rate details available on web and mobile — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-023 — Rate details event logging (viewed)
**Type:** Positive
**Covers:** 2.3 → Rate details event logging (viewed)
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, set up the precondition and perform: Rate details event logging (viewed).
2. Observe the result and verify the full behavior: Rate details event logging (viewed).
**Expected Result:** Rate details event logging (viewed) — delivered exactly as documented.
**Priority:** High

### TC-AF-4-02-024 — Audit logging of the commission rate details
**Type:** Positive
**Covers:** 2.3 → Audit logging of the commission rate details
**Preconditions:** A Affiliate account is active and the Affiliate is in the state required for this behavior.
**Steps:**
1. As a Affiliate, perform the commission rate details action.
2. Open the audit log and verify the entry for the action.
**Expected Result:** The commission rate details action is recorded in the audit log with the account and the timestamp.
**Priority:** Critical
