# 3. Subscription Health — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: subscription_health.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 |
|---------|--------------------|----------|
| 3.1 Active, Expiring, and Lapsed Subscriptions | Active subscription: the subscription (the active subscription, the user, the plan, the amount, the date) | TC-SA-17-03-001 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Expiring subscription: the subscription (the expiring subscription, the user, the plan, the amount, the date) | TC-SA-17-03-002 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Lapsed subscription: the subscription (the lapsed subscription, the user, the plan, the amount, the date) | TC-SA-17-03-003 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Subscription state: the state (the active, the expiring, the lapsed) | TC-SA-17-03-004 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Subscription count: the count (the count of the subscriptions by state) | TC-SA-17-03-005 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Subscription period: the period (the period of the subscriptions, e.g., the monthly, the quarterly) | TC-SA-17-03-006 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Subscription view: the view (the subscriptions, the states, the counts, the period) | TC-SA-17-03-007 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Audit logging of the subscription state viewing | TC-SA-17-03-008 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Rule: the active subscription is the ongoing (the active subscription, the user, the plan, the amount, the date); the subscription is the state | TC-SA-17-03-001 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Rule: the expiring subscription is the soon-ending (the expiring subscription, the user, the plan, the amount, the date); the subscription is the state | TC-SA-17-03-002 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Rule: the lapsed subscription is the ended (the lapsed subscription, the user, the plan, the amount, the date); the subscription is the state | TC-SA-17-03-003 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Rule: the subscription state is the control (the active, the expiring, the lapsed); the state is the gate | TC-SA-17-03-004 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Rule: the subscriptions are visible (the subscriptions, the states, the counts, the period); the viewing is managed | TC-SA-17-03-007 |
| 3.1 Active, Expiring, and Lapsed Subscriptions | Rule: subscription state viewing is audit-logged with the subscription, state, and timestamp | TC-SA-17-03-008 |
| 3.2 Renewal Rates | Renewal rate: the rate (the rate of the renewals, the percentage) | TC-SA-17-03-009 |
| 3.2 Renewal Rates | Renewed count: the count (the count of the renewed subscriptions) | TC-SA-17-03-010 |
| 3.2 Renewal Rates | Total count: the count (the count of the total subscriptions) | TC-SA-17-03-011 |
| 3.2 Renewal Rates | Renewal period: the period (the period of the renewals, e.g., the monthly, the quarterly) | TC-SA-17-03-012 |
| 3.2 Renewal Rates | Renewal trend: the trend (the trend of the renewals, the period, the change) | TC-SA-17-03-013 |
| 3.2 Renewal Rates | Renewal comparison: the comparison (the comparison of the renewals, the periods) | TC-SA-17-03-014 |
| 3.2 Renewal Rates | Renewal view: the view (the rate, the renewed, the total, the period) | TC-SA-17-03-015 |
| 3.2 Renewal Rates | Audit logging of the renewal rate viewing | TC-SA-17-03-016 |
| 3.2 Renewal Rates | Rule: the renewal rate is the measure (the rate of the renewals, the percentage); the rate is the value | TC-SA-17-03-009 |
| 3.2 Renewal Rates | Rule: the renewed count is the volume (the count of the renewed subscriptions); the count is the measure | TC-SA-17-03-010 |
| 3.2 Renewal Rates | Rule: the total count is the base (the count of the total subscriptions); the count is the denominator | TC-SA-17-03-011 |
| 3.2 Renewal Rates | Rule: the renewal trend is the direction (the trend of the renewals, the period, the change); the trend is the insight | TC-SA-17-03-013 |
| 3.2 Renewal Rates | Rule: the renewals are visible (the rate, the renewed, the total, the period); the viewing is managed | TC-SA-17-03-015 |
| 3.2 Renewal Rates | Rule: renewal rate viewing is audit-logged with the rate, period, and timestamp | TC-SA-17-03-016 |
| 3.3 Upgrade and Downgrade Activity | Upgrade: the upgrade (the upgrade, the user, the from-plan, the to-plan, the amount, the date) | TC-SA-17-03-017 |
| 3.3 Upgrade and Downgrade Activity | Downgrade: the downgrade (the downgrade, the user, the from-plan, the to-plan, the amount, the date) | TC-SA-17-03-018 |
| 3.3 Upgrade and Downgrade Activity | Activity count: the count (the count of the upgrades and downgrades) | TC-SA-17-03-019 |
| 3.3 Upgrade and Downgrade Activity | Activity amount: the amount (the amount of the upgrades and downgrades) | TC-SA-17-03-020 |
| 3.3 Upgrade and Downgrade Activity | Activity period: the period (the period of the activity, e.g., the monthly, the quarterly) | TC-SA-17-03-021 |
| 3.3 Upgrade and Downgrade Activity | Activity view: the view (the upgrades, the downgrades, the users, the period) | TC-SA-17-03-022 |
| 3.3 Upgrade and Downgrade Activity | Activity export: the export (the activity, the format, the period) | TC-SA-17-03-023 |
| 3.3 Upgrade and Downgrade Activity | Audit logging of the upgrade and downgrade activity viewing | TC-SA-17-03-024 |
| 3.3 Upgrade and Downgrade Activity | Rule: the upgrade is the move-up (the upgrade, the user, the from-plan, the to-plan, the amount, the date); the upgrade is the change | TC-SA-17-03-017 |
| 3.3 Upgrade and Downgrade Activity | Rule: the downgrade is the move-down (the downgrade, the user, the from-plan, the to-plan, the amount, the date); the downgrade is the change | TC-SA-17-03-018 |
| 3.3 Upgrade and Downgrade Activity | Rule: the activity count is the measure (the count of the upgrades and downgrades); the count is the volume | TC-SA-17-03-019 |
| 3.3 Upgrade and Downgrade Activity | Rule: the activity amount is the value (the amount of the upgrades and downgrades); the amount is the measure | TC-SA-17-03-020 |
| 3.3 Upgrade and Downgrade Activity | Rule: the activity is visible (the upgrades, the downgrades, the users, the period); the viewing is managed | TC-SA-17-03-022 |
| 3.3 Upgrade and Downgrade Activity | Rule: upgrade and downgrade activity viewing is audit-logged with the activity, period, and timestamp | TC-SA-17-03-024 |

## 3.1 Active, Expiring, and Lapsed Subscriptions

### TC-SA-17-03-001 — Active subscription: the subscription (the active subscription, the user, the plan, the amount, the date); the subscription is the state
**Type:** Positive
**Covers:** 3.1 → Active subscription: the subscription (the active subscription, the user, the plan, the amount, the date); Rule: the active subscription is the ongoing (the active subscription, the user, the plan, the amount, the date); the subscription is the state
**Preconditions:** Super Admin is logged in; active subscriptions exist.
**Steps:**
1. Open the Subscription Health view.
2. View the active subscriptions: the subscription (the active subscription, the user, the plan, the amount, the date) — verify the subscription is the ongoing.
3. Verify each active subscription shows the user, the plan, the amount, and the date.
**Expected Result:** The active subscriptions are shown — the active subscription, the user, the plan, the amount, and the date are the state.
**Priority:** Critical

### TC-SA-17-03-002 — Expiring subscription: the subscription (the expiring subscription, the user, the plan, the amount, the date); the subscription is the state
**Type:** Positive
**Covers:** 3.1 → Expiring subscription: the subscription (the expiring subscription, the user, the plan, the amount, the date); Rule: the expiring subscription is the soon-ending (the expiring subscription, the user, the plan, the amount, the date); the subscription is the state
**Preconditions:** Subscriptions are expiring within the defined window.
**Steps:**
1. View the expiring subscriptions: the subscription (the expiring subscription, the user, the plan, the amount, the date) — verify the subscription is the soon-ending.
2. Verify each expiring subscription shows the user, the plan, the amount, and the date.
3. Verify only subscriptions within the expiring window are shown.
**Expected Result:** The expiring subscriptions are shown — the expiring subscription, the user, the plan, the amount, and the date are the state.
**Priority:** Critical

### TC-SA-17-03-003 — Lapsed subscription: the subscription (the lapsed subscription, the user, the plan, the amount, the date); the subscription is the state
**Type:** Negative
**Covers:** 3.1 → Lapsed subscription: the subscription (the lapsed subscription, the user, the plan, the amount, the date); Rule: the lapsed subscription is the ended (the lapsed subscription, the user, the plan, the amount, the date); the subscription is the state
**Preconditions:** Lapsed subscriptions exist (expired without renewal).
**Steps:**
1. View the lapsed subscriptions: the subscription (the lapsed subscription, the user, the plan, the amount, the date) — verify the subscription is the ended.
2. Verify each lapsed subscription shows the user, the plan, the amount, and the date.
3. Verify only lapsed subscriptions are shown (no active or expiring).
**Expected Result:** The lapsed subscriptions are shown — the lapsed subscription, the user, the plan, the amount, and the date are the state.
**Priority:** Critical

### TC-SA-17-03-004 — Subscription state: the state (the active, the expiring, the lapsed); the state is the gate
**Type:** Edge
**Covers:** 3.1 → Subscription state: the state (the active, the expiring, the lapsed); Rule: the subscription state is the control (the active, the expiring, the lapsed); the state is the gate
**Preconditions:** Subscriptions exist in all three states.
**Steps:**
1. View the subscriptions by state: the state (the active, the expiring, the lapsed) — verify the state is the control.
2. Verify each state segment shows only subscriptions with that state.
3. Verify a subscription with no state recorded is not shown in any segment (no orphan).
**Expected Result:** The subscription state is shown — the active, the expiring, or the lapsed state is the gate for each segment.
**Priority:** High

### TC-SA-17-03-005 — Subscription count: the count (the count of the subscriptions by state); the count is the measure
**Type:** Positive
**Covers:** 3.1 → Subscription count: the count (the count of the subscriptions by state)
**Preconditions:** Subscriptions exist in all three states.
**Steps:**
1. View the subscription count by state: the count (the count of the subscriptions by state) — verify the count is the measure.
2. Verify the count for each state matches the actual number of subscriptions in that state.
3. Verify the total across states matches the overall subscription count.
**Expected Result:** The subscription count is shown — the count of the subscriptions by state is the measure.
**Priority:** High

### TC-SA-17-03-006 — Subscription period: the period (the period of the subscriptions, e.g., the monthly, the quarterly); the period is the scope
**Type:** Positive
**Covers:** 3.1 → Subscription period: the period (the period of the subscriptions, e.g., the monthly, the quarterly)
**Preconditions:** Subscriptions exist across monthly and quarterly periods.
**Steps:**
1. Set the subscription period: the period (the period of the subscriptions, e.g., the monthly, the quarterly) — verify the period is the scope.
2. View the subscriptions by state for a monthly period and a quarterly period — verify each covers the correct period.
**Expected Result:** The subscription period is set — the period of the subscriptions (the monthly, the quarterly) is the scope.
**Priority:** High

### TC-SA-17-03-007 — Subscription view: the view (the subscriptions, the states, the counts, the period); the viewing is managed
**Type:** Positive
**Covers:** 3.1 → Subscription view: the view (the subscriptions, the states, the counts, the period); Rule: the subscriptions are visible (the subscriptions, the states, the counts, the period); the viewing is managed
**Preconditions:** Subscriptions exist across a period.
**Steps:**
1. View the subscriptions: the view (the subscriptions, the states, the counts, the period) — verify the subscriptions are visible.
2. Verify the view is complete for the period.
**Expected Result:** The subscription view works — the subscriptions, the states, the counts, and the period are visible.
**Priority:** High

### TC-SA-17-03-008 — Subscription state viewing is audit-logged with the subscription, state, and timestamp
**Type:** Positive
**Covers:** 3.1 → Audit logging of the subscription state viewing; Rule: subscription state viewing is audit-logged with the subscription, state, and timestamp
**Preconditions:** Super Admin has viewed the subscriptions by state.
**Steps:**
1. Open the audit trail and filter by "subscription state".
2. Verify entries show the subscription, the state, and the timestamp.
**Expected Result:** The subscription state viewing is audit-logged with the subscription, state, and timestamp.
**Priority:** Critical

## 3.2 Renewal Rates

### TC-SA-17-03-009 — Renewal rate: the rate (the rate of the renewals, the percentage); the rate is the value
**Type:** Positive
**Covers:** 3.2 → Renewal rate: the rate (the rate of the renewals, the percentage); Rule: the renewal rate is the measure (the rate of the renewals, the percentage); the rate is the value
**Preconditions:** Renewals have occurred across a period.
**Steps:**
1. View the renewal rate: the rate (the rate of the renewals, the percentage) — verify the rate is the measure.
2. Verify the rate is calculated correctly (renewed / total × 100).
3. Verify the rate is shown as a percentage.
**Expected Result:** The renewal rate is shown — the rate of the renewals and the percentage are the value.
**Priority:** Critical

### TC-SA-17-03-010 — Renewed count: the count (the count of the renewed subscriptions); the count is the measure
**Type:** Positive
**Covers:** 3.2 → Renewed count: the count (the count of the renewed subscriptions); Rule: the renewed count is the volume (the count of the renewed subscriptions); the count is the measure
**Preconditions:** Renewals have occurred.
**Steps:**
1. View the renewed count: the count (the count of the renewed subscriptions) — verify the count is the volume.
2. Verify the count matches the actual number of renewed subscriptions.
**Expected Result:** The renewed count is shown — the count of the renewed subscriptions is the measure.
**Priority:** High

### TC-SA-17-03-011 — Total count: the count (the count of the total subscriptions); the count is the denominator
**Type:** Edge
**Covers:** 3.2 → Total count: the count (the count of the total subscriptions); Rule: the total count is the base (the count of the total subscriptions); the count is the denominator
**Preconditions:** Subscriptions exist; a period with zero total subscriptions also exists.
**Steps:**
1. View the total count: the count (the count of the total subscriptions) — verify the count is the base.
2. Verify the count matches the actual total number of subscriptions.
3. View a period with zero total subscriptions — verify the renewal rate shows 0% or N/A (no division-by-zero error).
**Expected Result:** The total count is shown — the count of the total subscriptions is the denominator; a zero-total period is handled.
**Priority:** High

### TC-SA-17-03-012 — Renewal period: the period (the period of the renewals, e.g., the monthly, the quarterly); the period is the scope
**Type:** Positive
**Covers:** 3.2 → Renewal period: the period (the period of the renewals, e.g., the monthly, the quarterly)
**Preconditions:** Renewals have occurred across monthly and quarterly periods.
**Steps:**
1. Set the renewal period: the period (the period of the renewals, e.g., the monthly, the quarterly) — verify the period is the scope.
2. View the renewal rate for a monthly period and a quarterly period — verify each covers the correct period.
**Expected Result:** The renewal period is set — the period of the renewals (the monthly, the quarterly) is the scope.
**Priority:** High

### TC-SA-17-03-013 — Renewal trend: the trend (the trend of the renewals, the period, the change); the trend is the insight
**Type:** Positive
**Covers:** 3.2 → Renewal trend: the trend (the trend of the renewals, the period, the change); Rule: the renewal trend is the direction (the trend of the renewals, the period, the change); the trend is the insight
**Preconditions:** Renewals have occurred across multiple periods with an upward or downward trend.
**Steps:**
1. View the renewal trend: the trend (the trend of the renewals, the period, the change) — verify the trend is the direction.
2. Verify the trend shows the change over the periods.
3. Verify the trend direction matches the actual data.
**Expected Result:** The renewal trend is shown — the trend of the renewals, the period, and the change are the insight.
**Priority:** Medium

### TC-SA-17-03-014 — Renewal comparison: the comparison (the comparison of the renewals, the periods); the comparison is the analysis
**Type:** Positive
**Covers:** 3.2 → Renewal comparison: the comparison (the comparison of the renewals, the periods)
**Preconditions:** Renewals have occurred across multiple periods.
**Steps:**
1. Compare the renewals: the comparison (the comparison of the renewals, the periods) — verify the comparison is the analysis.
2. Verify the comparison shows the renewal rates across the selected periods.
3. Verify the comparison values are accurate.
**Expected Result:** The renewal comparison works — the comparison of the renewals across the periods is the analysis.
**Priority:** Medium

### TC-SA-17-03-015 — Renewal view: the view (the rate, the renewed, the total, the period); the viewing is managed
**Type:** Positive
**Covers:** 3.2 → Renewal view: the view (the rate, the renewed, the total, the period); Rule: the renewals are visible (the rate, the renewed, the total, the period); the viewing is managed
**Preconditions:** Renewals have occurred across a period.
**Steps:**
1. View the renewals: the view (the rate, the renewed, the total, the period) — verify the renewals are visible.
2. Verify the view is complete for the period.
**Expected Result:** The renewal view works — the rate, the renewed, the total, and the period are visible.
**Priority:** High

### TC-SA-17-03-016 — Renewal rate viewing is audit-logged with the rate, period, and timestamp
**Type:** Positive
**Covers:** 3.2 → Audit logging of the renewal rate viewing; Rule: renewal rate viewing is audit-logged with the rate, period, and timestamp
**Preconditions:** Super Admin has viewed the renewal rates.
**Steps:**
1. Open the audit trail and filter by "renewal rate".
2. Verify entries show the rate, the period, and the timestamp.
**Expected Result:** The renewal rate viewing is audit-logged with the rate, period, and timestamp.
**Priority:** Critical

## 3.3 Upgrade and Downgrade Activity

### TC-SA-17-03-017 — Upgrade: the upgrade (the upgrade, the user, the from-plan, the to-plan, the amount, the date); the upgrade is the change
**Type:** Positive
**Covers:** 3.3 → Upgrade: the upgrade (the upgrade, the user, the from-plan, the to-plan, the amount, the date); Rule: the upgrade is the move-up (the upgrade, the user, the from-plan, the to-plan, the amount, the date); the upgrade is the change
**Preconditions:** Upgrades have occurred.
**Steps:**
1. View the upgrades: the upgrade (the upgrade, the user, the from-plan, the to-plan, the amount, the date) — verify the upgrade is the move-up.
2. Verify each upgrade shows the user, the from-plan, the to-plan, the amount, and the date.
3. Verify the to-plan is a higher tier than the from-plan.
**Expected Result:** The upgrades are shown — the upgrade, the user, the from-plan, the to-plan, the amount, and the date are the change.
**Priority:** Critical

### TC-SA-17-03-018 — Downgrade: the downgrade (the downgrade, the user, the from-plan, the to-plan, the amount, the date); the downgrade is the change
**Type:** Negative
**Covers:** 3.3 → Downgrade: the downgrade (the downgrade, the user, the from-plan, the to-plan, the amount, the date); Rule: the downgrade is the move-down (the downgrade, the user, the from-plan, the to-plan, the amount, the date); the downgrade is the change
**Preconditions:** Downgrades have occurred.
**Steps:**
1. View the downgrades: the downgrade (the downgrade, the user, the from-plan, the to-plan, the amount, the date) — verify the downgrade is the move-down.
2. Verify each downgrade shows the user, the from-plan, the to-plan, the amount, and the date.
3. Verify the to-plan is a lower tier than the from-plan.
**Expected Result:** The downgrades are shown — the downgrade, the user, the from-plan, the to-plan, the amount, and the date are the change.
**Priority:** Critical

### TC-SA-17-03-019 — Activity count: the count (the count of the upgrades and downgrades); the count is the volume
**Type:** Positive
**Covers:** 3.3 → Activity count: the count (the count of the upgrades and downgrades); Rule: the activity count is the measure (the count of the upgrades and downgrades); the count is the volume
**Preconditions:** Upgrades and downgrades have occurred.
**Steps:**
1. View the activity count: the count (the count of the upgrades and downgrades) — verify the count is the measure.
2. Verify the count matches the actual number of upgrades and downgrades.
**Expected Result:** The activity count is shown — the count of the upgrades and downgrades is the volume.
**Priority:** High

### TC-SA-17-03-020 — Activity amount: the amount (the amount of the upgrades and downgrades); the amount is the measure
**Type:** Positive
**Covers:** 3.3 → Activity amount: the amount (the amount of the upgrades and downgrades); Rule: the activity amount is the value (the amount of the upgrades and downgrades); the amount is the measure
**Preconditions:** Upgrades and downgrades have occurred.
**Steps:**
1. View the activity amount: the amount (the amount of the upgrades and downgrades) — verify the amount is the value.
2. Verify the amount matches the sum of the upgrades and downgrades' amounts.
**Expected Result:** The activity amount is shown — the amount of the upgrades and downgrades is the measure.
**Priority:** High

### TC-SA-17-03-021 — Activity period: the period (the period of the activity, e.g., the monthly, the quarterly); the period is the scope
**Type:** Positive
**Covers:** 3.3 → Activity period: the period (the period of the activity, e.g., the monthly, the quarterly)
**Preconditions:** Upgrades and downgrades have occurred across monthly and quarterly periods.
**Steps:**
1. Set the activity period: the period (the period of the activity, e.g., the monthly, the quarterly) — verify the period is the scope.
2. View the activity for a monthly period and a quarterly period — verify each covers the correct period.
**Expected Result:** The activity period is set — the period of the activity (the monthly, the quarterly) is the scope.
**Priority:** High

### TC-SA-17-03-022 — Activity view: the view (the upgrades, the downgrades, the users, the period); the viewing is managed
**Type:** Positive
**Covers:** 3.3 → Activity view: the view (the upgrades, the downgrades, the users, the period); Rule: the activity is visible (the upgrades, the downgrades, the users, the period); the viewing is managed
**Preconditions:** Upgrades and downgrades have occurred across a period.
**Steps:**
1. View the activity: the view (the upgrades, the downgrades, the users, the period) — verify the activity is visible.
2. Verify the view is complete for the period.
**Expected Result:** The activity view works — the upgrades, the downgrades, the users, and the period are visible.
**Priority:** High

### TC-SA-17-03-023 — Activity export: the export (the activity, the format, the period); the export is the record
**Type:** Positive
**Covers:** 3.3 → Activity export: the export (the activity, the format, the period)
**Preconditions:** Upgrades and downgrades have occurred for a period.
**Steps:**
1. Export the activity: the export (the activity, the format, the period).
2. Verify the export is generated in the selected format.
3. Verify the exported data matches the activity view.
**Expected Result:** The activity is exported — the activity in the selected format for the period is generated.
**Priority:** Medium

### TC-SA-17-03-024 — Upgrade and downgrade activity viewing is audit-logged with the activity, period, and timestamp
**Type:** Positive
**Covers:** 3.3 → Audit logging of the upgrade and downgrade activity viewing; Rule: upgrade and downgrade activity viewing is audit-logged with the activity, period, and timestamp
**Preconditions:** Super Admin has viewed the upgrade and downgrade activity.
**Steps:**
1. Open the audit trail and filter by "activity viewing".
2. Verify entries show the activity, the period, and the timestamp.
**Expected Result:** The upgrade and downgrade activity viewing is audit-logged with the activity, period, and timestamp.
**Priority:** Critical
