# 4. Affiliate Program Controls — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: affiliate_program_controls.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 |
|---------|--------------------|----------|
| 4.1 Approve or Reject Affiliate Applications | Application review: the review (the application, the applicant's details) | TC-SA-14-04-001 |
| 4.1 Approve or Reject Affiliate Applications | Application approval: the approval (the application is approved, the affiliate joins) | TC-SA-14-04-002 |
| 4.1 Approve or Reject Affiliate Applications | Application rejection: the rejection (the application is rejected, the reason) | TC-SA-14-04-003 |
| 4.1 Approve or Reject Affiliate Applications | Application status: the status (the pending, the approved, the rejected) | TC-SA-14-04-004 |
| 4.1 Approve or Reject Affiliate Applications | Application record: the record (the applicant, the application date, the decision, the reason) | TC-SA-14-04-005 |
| 4.1 Approve or Reject Affiliate Applications | Application queue: the queue (the pending applications) | TC-SA-14-04-006 |
| 4.1 Approve or Reject Affiliate Applications | Audit logging of the application decisions | TC-SA-14-04-007 |
| 4.1 Approve or Reject Affiliate Applications | Rule: the application status is the pending, the approved, or the rejected; the status is the control | TC-SA-14-04-004 |
| 4.1 Approve or Reject Affiliate Applications | Rule: the application approval is the join (the affiliate joins, the account is created); the approval is the gate | TC-SA-14-04-002 |
| 4.1 Approve or Reject Affiliate Applications | Rule: the application rejection is the decline (the reason is recorded, the applicant is notified); the rejection is the control | TC-SA-14-04-003 |
| 4.1 Approve or Reject Affiliate Applications | Rule: a decision change (a rejection reversed to an approval) is recorded (the new decision, the reason, the time); it is auditable | TC-SA-14-04-008 |
| 4.1 Approve or Reject Affiliate Applications | Rule: the applications are visible (the applicants, the dates, the decisions, the reasons); the program is managed | TC-SA-14-04-009 |
| 4.1 Approve or Reject Affiliate Applications | Rule: application decisions are audit-logged with the applicant, decision, and timestamp | TC-SA-14-04-007 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Affiliate activation: the activation (the affiliate is active, the earning starts) | TC-SA-14-04-010 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Affiliate suspension: the suspension (the affiliate is suspended, the earning stops, the reason) | TC-SA-14-04-011 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Affiliate termination: the termination (the affiliate is terminated, the program ends, the reason) | TC-SA-14-04-012 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Affiliate status: the status (the active, the suspended, the terminated) | TC-SA-14-04-013 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Status record: the record (the affiliate, the status, the reason, the date) | TC-SA-14-04-014 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Status change: the change (the status is changed, the reason, the date) | TC-SA-14-04-015 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Audit logging of the status changes | TC-SA-14-04-016 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Rule: the affiliate status is the active, the suspended, or the terminated; the status is the control | TC-SA-14-04-013 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Rule: the affiliate activation is the start (the earning starts, the commissions are tracked); the activation is the gate | TC-SA-14-04-010 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Rule: the affiliate suspension is the pause (the earning stops, the reason is recorded); the suspension is the control | TC-SA-14-04-011 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Rule: the affiliate termination is the end (the program ends, the commissions are settled); the termination is the final | TC-SA-14-04-012 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Rule: a status change (a suspension reversed to an activation) is recorded (the new status, the reason, the time); it is auditable | TC-SA-14-04-015 |
| 4.2 Activate, Suspend, and Terminate Affiliates | Rule: status changes are audit-logged with the affiliate, status, and timestamp | TC-SA-14-04-016 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Permission definition: the permission (the discount code creation, the link sharing, the dashboard access) | TC-SA-14-04-017 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Permission scope: the scope (the permission applies to the affiliate) | TC-SA-14-04-018 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Permission limit: the limit (the limit for the permission, e.g., the number of codes) | TC-SA-14-04-019 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Permission grant: the grant (the permission is granted to the affiliate) | TC-SA-14-04-020 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Permission revoke: the revoke (the permission is revoked from the affiliate) | TC-SA-14-04-021 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Permission record: the record (the affiliate, the permission, the scope, the limit) | TC-SA-14-04-022 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Audit logging of the permission grants and revokes | TC-SA-14-04-023 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Rule: the permission is the capability (the discount code creation, the link sharing, the dashboard access); the permission is the grant | TC-SA-14-04-017 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Rule: the permission scope is the application (the permission applies to the affiliate); the scope is the control | TC-SA-14-04-018 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Rule: the permission limit is the boundary (the limit for the permission, e.g., the number of codes); the limit is the control | TC-SA-14-04-019 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Rule: a permission change (the scope, the limit updated, or the permission revoked) is recorded (the new scope, the new limit, the time); it is auditable | TC-SA-14-04-024 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Rule: the affiliate permissions are visible (the affiliates, the permissions, the scopes, the limits); the capabilities are managed | TC-SA-14-04-025 |
| 4.3 Configure Permissions (e.g., Discount Code Creation) | Rule: permission grants and revokes are audit-logged with the affiliate, permission, and timestamp | TC-SA-14-04-023 |

## 4.1 Approve or Reject Affiliate Applications

### TC-SA-14-04-001 — Application review: the review (the application, the applicant's details); the review is the evaluation
**Type:** Positive
**Covers:** 4.1 → Application review: the review (the application, the applicant's details)
**Preconditions:** A pending affiliate application exists.
**Steps:**
1. Super Admin views the application queue: the pending applications (the applicant, the application date, the details).
2. Reviews an application: the applicant's details (the name, the contact, the referral history).
3. Verify the review is the evaluation of the application.
**Expected Result:** The application is reviewed — the applicant's details (the name, the contact, the referral history) are shown.
**Priority:** High

### TC-SA-14-04-002 — Application approval: the approval (the application is approved, the affiliate joins); the approval is the gate
**Type:** Positive
**Covers:** 4.1 → Application approval: the approval (the application is approved, the affiliate joins); Rule: the application approval is the join (the affiliate joins, the account is created); the approval is the gate
**Preconditions:** A pending affiliate application has been reviewed.
**Steps:**
1. Approve the application: the decision (the approved).
2. Verify the affiliate joins (the account is created, the access is granted).
3. Verify the approval is recorded.
**Expected Result:** The application is approved — the affiliate joins, the account is created, and the approval is recorded.
**Priority:** Critical

### TC-SA-14-04-003 — Application rejection: the rejection (the application is rejected, the reason); the rejection is the control
**Type:** Negative
**Covers:** 4.1 → Application rejection: the rejection (the application is rejected, the reason); Rule: the application rejection is the decline (the reason is recorded, the applicant is notified); the rejection is the control
**Preconditions:** A pending affiliate application has been reviewed.
**Steps:**
1. Reject the application: the decision (the rejected), the reason (e.g., the incomplete details, the policy violation).
2. Verify the rejection is recorded with the reason.
3. Verify the applicant is notified with the reason.
**Expected Result:** The application is rejected — the reason is recorded and the applicant is notified.
**Priority:** Critical

### TC-SA-14-04-004 — Application status: the status (the pending, the approved, the rejected); the status is the control
**Type:** Negative
**Covers:** 4.1 → Application status: the status (the pending, the approved, the rejected); Rule: the application status is the pending, the approved, or the rejected; the status is the control
**Preconditions:** Applications exist in each status (pending, approved, rejected).
**Steps:**
1. Verify a new application has the status pending.
2. Verify an approved application has the status approved and a rejected application has the status rejected.
3. Attempt to set an application to a status other than pending, approved, or rejected — verify the system rejects it.
**Expected Result:** The application status is the pending, the approved, or the rejected — no other status is allowed.
**Priority:** High

### TC-SA-14-04-005 — Application record: the record (the applicant, the application date, the decision, the reason); the record is the proof
**Type:** Positive
**Covers:** 4.1 → Application record: the record (the applicant, the application date, the decision, the reason)
**Preconditions:** An application decision has been made.
**Steps:**
1. Open the application record.
2. Verify it shows the applicant, the application date, the decision, and the reason.
**Expected Result:** The application is recorded — the applicant, the application date, the decision, and the reason are shown.
**Priority:** High

### TC-SA-14-04-006 — Application queue: the queue (the pending applications); the queue is the list
**Type:** Positive
**Covers:** 4.1 → Application queue: the queue (the pending applications)
**Preconditions:** Multiple pending affiliate applications exist.
**Steps:**
1. Open the application queue.
2. Verify the pending applications are listed (the applicant, the application date, the details).
3. Verify a decided application no longer appears in the pending queue.
**Expected Result:** The application queue shows the pending applications — the queue is the list.
**Priority:** High

### TC-SA-14-04-007 — Application decisions are audit-logged with the applicant, decision, and timestamp
**Type:** Positive
**Covers:** 4.1 → Audit logging of the application decisions; Rule: application decisions are audit-logged with the applicant, decision, and timestamp
**Preconditions:** Application decisions have been made.
**Steps:**
1. Open the audit trail and filter by "affiliate application".
2. Verify entries show the applicant, the decision, and the timestamp.
**Expected Result:** The application decisions are audit-logged with the applicant, decision, and timestamp.
**Priority:** Critical

### TC-SA-14-04-008 — A decision change (a rejection reversed to an approval) is recorded (the new decision, the reason, the time); it is auditable
**Type:** Positive
**Covers:** 4.1 → Rule: a decision change (a rejection reversed to an approval) is recorded (the new decision, the reason, the time); it is auditable
**Preconditions:** An application has been rejected.
**Steps:**
1. Reverse the decision (the rejection to an approval, the reason, the time).
2. Verify the decision is updated and the affiliate joins.
3. Verify the change is recorded and auditable.
**Expected Result:** The decision change is recorded (the new decision, the reason, the time) — it is auditable.
**Priority:** High

### TC-SA-14-04-009 — The applications are visible (the applicants, the dates, the decisions, the reasons); the program is managed
**Type:** Positive
**Covers:** 4.1 → Rule: the applications are visible (the applicants, the dates, the decisions, the reasons); the program is managed
**Preconditions:** Multiple applications with decisions exist.
**Steps:**
1. Open the applications view.
2. Verify the applicants, the dates, the decisions, and the reasons are visible.
3. Verify the program is managed.
**Expected Result:** The applications are visible — the applicants, the dates, the decisions, and the reasons are shown.
**Priority:** Medium

## 4.2 Activate, Suspend, and Terminate Affiliates

### TC-SA-14-04-010 — Affiliate activation: the activation (the affiliate is active, the earning starts); the activation is the gate
**Type:** Positive
**Covers:** 4.2 → Affiliate activation: the activation (the affiliate is active, the earning starts); Rule: the affiliate activation is the start (the earning starts, the commissions are tracked); the activation is the gate
**Preconditions:** An approved affiliate is not yet active.
**Steps:**
1. Activate the affiliate: the status (the active).
2. Verify the earning starts (the commissions are tracked).
3. Verify the activation is recorded.
**Expected Result:** The affiliate is activated — the earning starts, the commissions are tracked, and the activation is recorded.
**Priority:** Critical

### TC-SA-14-04-011 — Affiliate suspension: the suspension (the affiliate is suspended, the earning stops, the reason); the suspension is the control
**Type:** Negative
**Covers:** 4.2 → Affiliate suspension: the suspension (the affiliate is suspended, the earning stops, the reason); Rule: the affiliate suspension is the pause (the earning stops, the reason is recorded); the suspension is the control
**Preconditions:** An active affiliate is earning commissions.
**Steps:**
1. Suspend the affiliate: the status (the suspended), the reason (e.g., the policy violation, the fraud).
2. Verify the earning stops (the commissions are paused).
3. Verify the suspension is recorded with the reason and the affiliate is notified.
**Expected Result:** The affiliate is suspended — the earning stops, the reason is recorded, and the suspension is recorded.
**Priority:** Critical

### TC-SA-14-04-012 — Affiliate termination: the termination (the affiliate is terminated, the program ends, the reason); the termination is the final
**Type:** Negative
**Covers:** 4.2 → Affiliate termination: the termination (the affiliate is terminated, the program ends, the reason); Rule: the affiliate termination is the end (the program ends, the commissions are settled); the termination is the final
**Preconditions:** An active or suspended affiliate exists.
**Steps:**
1. Terminate the affiliate: the status (the terminated), the reason (e.g., the repeated violations, the contract end).
2. Verify the program ends (the commissions are settled).
3. Verify the termination is recorded with the reason and the affiliate is notified.
**Expected Result:** The affiliate is terminated — the program ends, the commissions are settled, and the termination is recorded.
**Priority:** Critical

### TC-SA-14-04-013 — Affiliate status: the status (the active, the suspended, the terminated); the status is the control
**Type:** Negative
**Covers:** 4.2 → Affiliate status: the status (the active, the suspended, the terminated); Rule: the affiliate status is the active, the suspended, or the terminated; the status is the control
**Preconditions:** Affiliates exist in each status (active, suspended, terminated).
**Steps:**
1. Verify an active affiliate has the status active, a suspended affiliate the status suspended, and a terminated affiliate the status terminated.
2. Attempt to set an affiliate to a status other than active, suspended, or terminated — verify the system rejects it.
3. Verify the status is the control.
**Expected Result:** The affiliate status is the active, the suspended, or the terminated — no other status is allowed.
**Priority:** High

### TC-SA-14-04-014 — Status record: the record (the affiliate, the status, the reason, the date); the record is the proof
**Type:** Positive
**Covers:** 4.2 → Status record: the record (the affiliate, the status, the reason, the date)
**Preconditions:** An affiliate status change has been made.
**Steps:**
1. Open the status record.
2. Verify it shows the affiliate, the status, the reason, and the date.
**Expected Result:** The status is recorded — the affiliate, the status, the reason, and the date are shown.
**Priority:** High

### TC-SA-14-04-015 — A status change (a suspension reversed to an activation) is recorded (the new status, the reason, the time); it is auditable
**Type:** Positive
**Covers:** 4.2 → Status change: the change (the status is changed, the reason, the date); Rule: a status change (a suspension reversed to an activation) is recorded (the new status, the reason, the time); it is auditable
**Preconditions:** An affiliate is suspended.
**Steps:**
1. Reverse the status (the suspension to an activation, the reason, the time).
2. Verify the status is updated and the earning resumes.
3. Verify the change is recorded and auditable.
**Expected Result:** The status change is recorded (the new status, the reason, the time) — it is auditable.
**Priority:** High

### TC-SA-14-04-016 — Status changes are audit-logged with the affiliate, status, and timestamp
**Type:** Positive
**Covers:** 4.2 → Audit logging of the status changes; Rule: status changes are audit-logged with the affiliate, status, and timestamp
**Preconditions:** Affiliate status changes have occurred.
**Steps:**
1. Open the audit trail and filter by "affiliate status".
2. Verify entries show the affiliate, the status, and the timestamp.
**Expected Result:** The status changes are audit-logged with the affiliate, status, and timestamp.
**Priority:** Critical

## 4.3 Configure Permissions (e.g., Discount Code Creation)

### TC-SA-14-04-017 — Permission definition: the permission (the discount code creation, the link sharing, the dashboard access); the permission is the grant
**Type:** Positive
**Covers:** 4.3 → Permission definition: the permission (the discount code creation, the link sharing, the dashboard access); Rule: the permission is the capability (the discount code creation, the link sharing, the dashboard access); the permission is the grant
**Preconditions:** The Super Admin opens the affiliate program controls.
**Steps:**
1. Define the affiliate permissions: the permissions (the discount code creation, the link sharing, the dashboard access), the scope (the permission applies to the affiliate), and the limit (e.g., the number of codes).
2. Save the permissions.
3. Verify the affiliate permissions are live and the affiliate can do what is permitted.
**Expected Result:** The affiliate permissions are defined (the permission, the scope, the limit) — the permission is the capability.
**Priority:** Critical

### TC-SA-14-04-018 — Permission scope: the scope (the permission applies to the affiliate); the scope is the control
**Type:** Negative
**Covers:** 4.3 → Permission scope: the scope (the permission applies to the affiliate); Rule: the permission scope is the application (the permission applies to the affiliate); the scope is the control
**Preconditions:** A permission is granted to affiliate A only.
**Steps:**
1. Affiliate A uses the permission — verify the action is allowed (the scope applies).
2. Affiliate B (without the permission) attempts the same action — verify the action is not allowed (the scope does not apply).
3. Verify the scope is the control.
**Expected Result:** The permission scope is enforced — the permission applies only to the scoped affiliate.
**Priority:** Critical

### TC-SA-14-04-019 — Permission limit: the limit (the limit for the permission, e.g., the number of codes); the limit is the boundary
**Type:** Negative
**Covers:** 4.3 → Permission limit: the limit (the limit for the permission, e.g., the number of codes); Rule: the permission limit is the boundary (the limit for the permission, e.g., the number of codes); the limit is the control
**Preconditions:** An affiliate has the discount code creation permission with a limit of 5 codes and has created 5 codes.
**Steps:**
1. The affiliate attempts to create a 6th discount code — verify the action is not allowed (the limit is met).
2. Verify the limit is the boundary.
**Expected Result:** The permission limit is enforced — the action is not allowed beyond the limit.
**Priority:** Critical

### TC-SA-14-04-020 — Permission grant: the grant (the permission is granted to the affiliate); the action is recorded
**Type:** Positive
**Covers:** 4.3 → Permission grant: the grant (the permission is granted to the affiliate)
**Preconditions:** The Super Admin opens the affiliate program controls.
**Steps:**
1. Grant the permission (e.g., the discount code creation) to the affiliate.
2. Verify the permission is granted and the affiliate can use it.
3. Verify the grant is recorded.
**Expected Result:** The permission is granted — the affiliate can do what is permitted and the grant is recorded.
**Priority:** Critical

### TC-SA-14-04-021 — Permission revoke: the revoke (the permission is revoked from the affiliate); the revoke is recorded
**Type:** Negative
**Covers:** 4.3 → Permission revoke: the revoke (the permission is revoked from the affiliate)
**Preconditions:** An affiliate has the discount code creation permission.
**Steps:**
1. Revoke the permission from the affiliate.
2. The affiliate attempts to create a discount code — verify the action is not allowed (the permission is revoked).
3. Verify the revoke is recorded.
**Expected Result:** The permission is revoked — the affiliate can no longer use it and the revoke is recorded.
**Priority:** Critical

### TC-SA-14-04-022 — Permission record: the record (the affiliate, the permission, the scope, the limit); the record is the proof
**Type:** Positive
**Covers:** 4.3 → Permission record: the record (the affiliate, the permission, the scope, the limit)
**Preconditions:** A permission has been granted to an affiliate.
**Steps:**
1. Open the permission record.
2. Verify it shows the affiliate, the permission, the scope, and the limit.
**Expected Result:** The permission is recorded — the affiliate, the permission, the scope, and the limit are shown.
**Priority:** High

### TC-SA-14-04-023 — Permission grants and revokes are audit-logged with the affiliate, permission, and timestamp
**Type:** Positive
**Covers:** 4.3 → Audit logging of the permission grants and revokes; Rule: permission grants and revokes are audit-logged with the affiliate, permission, and timestamp
**Preconditions:** Permission grants and revokes have occurred.
**Steps:**
1. Open the audit trail and filter by "affiliate permission".
2. Verify entries show the affiliate, the permission, and the timestamp.
**Expected Result:** The permission grants and revokes are audit-logged with the affiliate, permission, and timestamp.
**Priority:** Critical

### TC-SA-14-04-024 — A permission change (the scope, the limit updated, or the permission revoked) is recorded (the new scope, the new limit, the time); it is auditable
**Type:** Positive
**Covers:** 4.3 → Rule: a permission change (the scope, the limit updated, or the permission revoked) is recorded (the new scope, the new limit, the time); it is auditable
**Preconditions:** A permission is granted to an affiliate.
**Steps:**
1. Change the permission (the new scope, the new limit, the time).
2. Verify the permission is updated.
3. Verify the change is recorded and auditable.
**Expected Result:** The permission change is recorded (the new scope, the new limit, the time) — it is auditable.
**Priority:** High

### TC-SA-14-04-025 — The affiliate permissions are visible (the affiliates, the permissions, the scopes, the limits); the capabilities are managed
**Type:** Positive
**Covers:** 4.3 → Rule: the affiliate permissions are visible (the affiliates, the permissions, the scopes, the limits); the capabilities are managed
**Preconditions:** Multiple affiliate permissions are defined.
**Steps:**
1. Open the affiliate permissions view.
2. Verify the affiliates, the permissions, the scopes, and the limits are visible.
3. Verify the capabilities are managed.
**Expected Result:** The affiliate permissions are visible — the affiliates, the permissions, the scopes, and the limits are shown.
**Priority:** Medium
