# 4. Session & Account Management — Test Cases

User Type: **Affiliate**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: session_account_management.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 |
|---------|--------------------|----------|
| 4.1 | List of active sessions | TC-AF-1-04-001 |
| 4.1 | Device and location per session | TC-AF-1-04-002 |
| 4.1 | Last activity time per session | TC-AF-1-04-003 |
| 4.1 | Sign out of an individual session | TC-AF-1-04-004 |
| 4.1 | Sign out of all other sessions | TC-AF-1-04-005 |
| 4.1 | Current session indicator | TC-AF-1-04-006 |
| 4.1 | Sessions available on web and mobile | TC-AF-1-04-007 |
| 4.1 | Session event logging (viewed, signed out) | TC-AF-1-04-008 |
| 4.1 | Audit logging of the active sessions and sign out | TC-AF-1-04-009 |
| 4.1 | Rule: The sessions show device, location, and last activity. | TC-AF-1-04-001 |
| 4.1 | Rule: An individual session can be signed out. | TC-AF-1-04-002 |
| 4.1 | Rule: All other sessions can be signed out. | TC-AF-1-04-003 |
| 4.1 | Rule: Session events (viewed, signed out) are logged with the account and the timestamp. | TC-AF-1-04-004 |
| 4.1 | Rule: The active sessions and sign out is audit-logged with the account and the timestamp. | TC-AF-1-04-005 |
| 4.2 | Update name and contact details | TC-AF-1-04-010 |
| 4.2 | Upload an avatar | TC-AF-1-04-011 |
| 4.2 | Edit public affiliate details | TC-AF-1-04-012 |
| 4.2 | Profile save confirmation | TC-AF-1-04-013 |
| 4.2 | Public details shown on referral pages | TC-AF-1-04-014 |
| 4.2 | Profile available on web and mobile | TC-AF-1-04-015 |
| 4.2 | Profile event logging (updated) | TC-AF-1-04-016 |
| 4.2 | Audit logging of the affiliate profile management | TC-AF-1-04-017 |
| 4.2 | Rule: The profile includes name, contact, avatar, and public details. | TC-AF-1-04-010 |
| 4.2 | Rule: A save confirmation is shown. | TC-AF-1-04-011 |
| 4.2 | Rule: The public details are shown on the referral pages. | TC-AF-1-04-012 |
| 4.2 | Rule: Profile events (updated) are logged with the account and the timestamp. | TC-AF-1-04-013 |
| 4.2 | Rule: The affiliate profile management is audit-logged with the account and the timestamp. | TC-AF-1-04-014 |
| 4.3 | Initiate the account deactivation | TC-AF-1-04-018 |
| 4.3 | Review the deactivation consequences | TC-AF-1-04-019 |
| 4.3 | Pending commission handling on deactivation | TC-AF-1-04-020 |
| 4.3 | Deactivation confirmation | TC-AF-1-04-021 |
| 4.3 | Account deactivated and signed out | TC-AF-1-04-022 |
| 4.3 | Deactivation available on web and mobile | TC-AF-1-04-023 |
| 4.3 | Deactivation event logging (initiated, confirmed) | TC-AF-1-04-024 |
| 4.3 | Audit logging of the account deactivation | TC-AF-1-04-025 |
| 4.3 | Rule: The deactivation is initiated by the Affiliate. | TC-AF-1-04-018 |
| 4.3 | Rule: The consequences are reviewed before confirmation. | TC-AF-1-04-019 |
| 4.3 | Rule: The pending commission is handled on deactivation. | TC-AF-1-04-020 |
| 4.3 | Rule: Deactivation events (initiated, confirmed) are logged with the account and the timestamp. | TC-AF-1-04-021 |
| 4.3 | Rule: The account deactivation is audit-logged with the account and the timestamp. | TC-AF-1-04-022 |

## 4.1 Active Sessions and Sign Out

### TC-AF-1-04-001 — List of active sessions
**Type:** Positive
**Covers:** 4.1 → List of active sessions; Rule: The sessions show device, location, and last activity.
**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: List of active sessions.
2. Observe the result and verify the full behavior: List of active sessions.
**Expected Result:** List of active sessions — delivered exactly as documented.
**Priority:** Critical

### TC-AF-1-04-002 — Device and location per session
**Type:** Positive
**Covers:** 4.1 → Device and location per session; Rule: An individual session can be signed out.
**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: Device and location per session.
2. Observe the result and verify the full behavior: Device and location per session.
**Expected Result:** Device and location per session — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-003 — Last activity time per session
**Type:** Positive
**Covers:** 4.1 → Last activity time per session; Rule: All other sessions can be signed out.
**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: Last activity time per session.
2. Observe the result and verify the full behavior: Last activity time per session.
**Expected Result:** Last activity time per session — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-004 — Sign out of an individual session
**Type:** Positive
**Covers:** 4.1 → Sign out of an individual session; Rule: Session events (viewed, signed out) 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: Sign out of an individual session.
2. Observe the result and verify the full behavior: Sign out of an individual session.
**Expected Result:** Sign out of an individual session — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-005 — Sign out of all other sessions
**Type:** Positive
**Covers:** 4.1 → Sign out of all other sessions; Rule: The active sessions and sign out 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: Sign out of all other sessions.
2. Observe the result and verify the full behavior: Sign out of all other sessions.
**Expected Result:** Sign out of all other sessions — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-006 — Current session indicator
**Type:** Positive
**Covers:** 4.1 → Current session indicator
**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 session indicator.
2. Observe the result and verify the full behavior: Current session indicator.
**Expected Result:** Current session indicator — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-007 — Sessions available on web and mobile
**Type:** Positive
**Covers:** 4.1 → Sessions 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: Sessions available on web and mobile.
2. Observe the result and verify the full behavior: Sessions available on web and mobile.
**Expected Result:** Sessions available on web and mobile — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-008 — Session event logging (viewed, signed out)
**Type:** Positive
**Covers:** 4.1 → Session event logging (viewed, signed out)
**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: Session event logging (viewed, signed out).
2. Observe the result and verify the full behavior: Session event logging (viewed, signed out).
**Expected Result:** Session event logging (viewed, signed out) — delivered exactly as documented.
**Priority:** High

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


## 4.2 Affiliate Profile Management

### TC-AF-1-04-010 — Update name and contact details
**Type:** Positive
**Covers:** 4.2 → Update name and contact details; Rule: The profile includes name, contact, avatar, and public details.
**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: Update name and contact details.
2. Observe the result and verify the full behavior: Update name and contact details.
**Expected Result:** Update name and contact details — delivered exactly as documented.
**Priority:** Critical

### TC-AF-1-04-011 — Upload an avatar
**Type:** Positive
**Covers:** 4.2 → Upload an avatar; Rule: A save confirmation 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: Upload an avatar.
2. Observe the result and verify the full behavior: Upload an avatar.
**Expected Result:** Upload an avatar — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-012 — Edit public affiliate details
**Type:** Positive
**Covers:** 4.2 → Edit public affiliate details; Rule: The public details are shown on the referral pages.
**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: Edit public affiliate details.
2. Observe the result and verify the full behavior: Edit public affiliate details.
**Expected Result:** Edit public affiliate details — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-013 — Profile save confirmation
**Type:** Positive
**Covers:** 4.2 → Profile save confirmation; Rule: Profile events (updated) 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: Profile save confirmation.
2. Observe the result and verify the full behavior: Profile save confirmation.
**Expected Result:** Profile save confirmation — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-014 — Public details shown on referral pages
**Type:** Positive
**Covers:** 4.2 → Public details shown on referral pages; Rule: The affiliate profile management 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: Public details shown on referral pages.
2. Observe the result and verify the full behavior: Public details shown on referral pages.
**Expected Result:** Public details shown on referral pages — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-015 — Profile available on web and mobile
**Type:** Positive
**Covers:** 4.2 → Profile 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: Profile available on web and mobile.
2. Observe the result and verify the full behavior: Profile available on web and mobile.
**Expected Result:** Profile available on web and mobile — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-016 — Profile event logging (updated)
**Type:** Positive
**Covers:** 4.2 → Profile event logging (updated)
**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: Profile event logging (updated).
2. Observe the result and verify the full behavior: Profile event logging (updated).
**Expected Result:** Profile event logging (updated) — delivered exactly as documented.
**Priority:** High

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


## 4.3 Account Deactivation

### TC-AF-1-04-018 — Initiate the account deactivation
**Type:** Positive
**Covers:** 4.3 → Initiate the account deactivation; Rule: The deactivation is initiated by the Affiliate.
**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: Initiate the account deactivation.
2. Observe the result and verify the full behavior: Initiate the account deactivation.
**Expected Result:** Initiate the account deactivation — delivered exactly as documented.
**Priority:** Critical

### TC-AF-1-04-019 — Review the deactivation consequences
**Type:** Positive
**Covers:** 4.3 → Review the deactivation consequences; Rule: The consequences are reviewed before confirmation.
**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: Review the deactivation consequences.
2. Observe the result and verify the full behavior: Review the deactivation consequences.
**Expected Result:** Review the deactivation consequences — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-020 — Pending commission handling on deactivation
**Type:** Positive
**Covers:** 4.3 → Pending commission handling on deactivation; Rule: The pending commission is handled on deactivation.
**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: Pending commission handling on deactivation.
2. Observe the result and verify the full behavior: Pending commission handling on deactivation.
**Expected Result:** Pending commission handling on deactivation — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-021 — Deactivation confirmation
**Type:** Positive
**Covers:** 4.3 → Deactivation confirmation; Rule: Deactivation events (initiated, confirmed) 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: Deactivation confirmation.
2. Observe the result and verify the full behavior: Deactivation confirmation.
**Expected Result:** Deactivation confirmation — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-022 — Account deactivated and signed out
**Type:** Positive
**Covers:** 4.3 → Account deactivated and signed out; Rule: The account deactivation 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: Account deactivated and signed out.
2. Observe the result and verify the full behavior: Account deactivated and signed out.
**Expected Result:** Account deactivated and signed out — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-023 — Deactivation available on web and mobile
**Type:** Positive
**Covers:** 4.3 → Deactivation 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: Deactivation available on web and mobile.
2. Observe the result and verify the full behavior: Deactivation available on web and mobile.
**Expected Result:** Deactivation available on web and mobile — delivered exactly as documented.
**Priority:** High

### TC-AF-1-04-024 — Deactivation event logging (initiated, confirmed)
**Type:** Positive
**Covers:** 4.3 → Deactivation event logging (initiated, confirmed)
**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: Deactivation event logging (initiated, confirmed).
2. Observe the result and verify the full behavior: Deactivation event logging (initiated, confirmed).
**Expected Result:** Deactivation event logging (initiated, confirmed) — delivered exactly as documented.
**Priority:** High

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