# 3. Recurring Billing — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: recurring_billing.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 Recurring Billing for Subscriptions | Recurring charge: the charge (the recurring charge, the amount) | TC-SA-15-03-001 |
| 3.1 Recurring Billing for Subscriptions | Billing period: the period (the period of the billing, e.g., the monthly, the annual) | TC-SA-15-03-002 |
| 3.1 Recurring Billing for Subscriptions | Charge date: the date (the date of the charge, e.g., the 1st of the month) | TC-SA-15-03-003 |
| 3.1 Recurring Billing for Subscriptions | Billing configuration: the configuration (the subscription, the period, the amount, the date) | TC-SA-15-03-004 |
| 3.1 Recurring Billing for Subscriptions | Billing execution: the execution (the charge is made per the configuration) | TC-SA-15-03-005 |
| 3.1 Recurring Billing for Subscriptions | Billing record: the record (the subscription, the charge, the period, the date) | TC-SA-15-03-006 |
| 3.1 Recurring Billing for Subscriptions | Audit logging of the billing configuration and the executions | TC-SA-15-03-007 |
| 3.1 Recurring Billing for Subscriptions | Rule: the recurring charge is the amount (the recurring charge, the amount); the charge is the value | TC-SA-15-03-001 |
| 3.1 Recurring Billing for Subscriptions | Rule: the billing period is the frequency (the period of the billing, e.g., the monthly, the annual); the period is the schedule | TC-SA-15-03-002 |
| 3.1 Recurring Billing for Subscriptions | Rule: the charge date is the timing (the date of the charge, e.g., the 1st of the month); the date is the control | TC-SA-15-03-003 |
| 3.1 Recurring Billing for Subscriptions | Rule: a billing change (the period, the amount, the date updated) is recorded (the new period, the new amount, the new date, the time); it is auditable | TC-SA-15-03-007 |
| 3.1 Recurring Billing for Subscriptions | Rule: the recurring billing is visible (the subscriptions, the charges, the periods, the dates); the billing is managed | TC-SA-15-03-004 |
| 3.1 Recurring Billing for Subscriptions | Rule: billing configuration and executions are audit-logged with the subscription, charge, and timestamp | TC-SA-15-03-007 |
| 3.2 Auto-Renewal Processing | Auto-renewal configuration: the configuration (the renewal, the charge, the notification, the failure handling) | TC-SA-15-03-008 |
| 3.2 Auto-Renewal Processing | Renewal processing: the processing (the renewal is processed, the charge is made) | TC-SA-15-03-009 |
| 3.2 Auto-Renewal Processing | Renewal notification: the notification (the notification to the user, the renewal) | TC-SA-15-03-010 |
| 3.2 Auto-Renewal Processing | Failure handling: the handling (the handling of the failed renewal, e.g., the retry, the grace period) | TC-SA-15-03-011 |
| 3.2 Auto-Renewal Processing | Renewal record: the record (the subscription, the renewal, the charge, the date) | TC-SA-15-03-012 |
| 3.2 Auto-Renewal Processing | Renewal view: the view (the renewals, the period) | TC-SA-15-03-013 |
| 3.2 Auto-Renewal Processing | Audit logging of the auto-renewal configuration and the processing | TC-SA-15-03-014 |
| 3.2 Auto-Renewal Processing | Rule: the auto-renewal configuration is the control (the renewal, the charge, the notification, the failure handling); the configuration is the logic | TC-SA-15-03-008 |
| 3.2 Auto-Renewal Processing | Rule: the renewal processing is the action (the renewal is processed, the charge is made); the processing is the execution | TC-SA-15-03-009 |
| 3.2 Auto-Renewal Processing | Rule: the renewal notification is the communication (the notification to the user, the renewal); the notification is the message | TC-SA-15-03-010 |
| 3.2 Auto-Renewal Processing | Rule: a configuration change (the charge, the notification, the failure handling updated) is recorded (the new charge, the new notification, the new failure handling, the time); it is auditable | TC-SA-15-03-014 |
| 3.2 Auto-Renewal Processing | Rule: the auto-renewals are visible (the renewals, the period); the processing is managed | TC-SA-15-03-013 |
| 3.2 Auto-Renewal Processing | Rule: auto-renewal configuration and processing are audit-logged with the subscription, renewal, and timestamp | TC-SA-15-03-014 |
| 3.3 Subscription Renewal and Upgrade Billing | Renewal billing: the billing (the billing for the renewal, the amount) | TC-SA-15-03-015 |
| 3.3 Subscription Renewal and Upgrade Billing | Upgrade billing: the billing (the billing for the upgrade, the amount, the proration) | TC-SA-15-03-016 |
| 3.3 Subscription Renewal and Upgrade Billing | Proration: the proration (the proration of the upgrade, the remaining period) | TC-SA-15-03-017 |
| 3.3 Subscription Renewal and Upgrade Billing | Billing configuration: the configuration (the renewal, the upgrade, the proration, the charge) | TC-SA-15-03-018 |
| 3.3 Subscription Renewal and Upgrade Billing | Billing execution: the execution (the billing is made per the configuration) | TC-SA-15-03-019 |
| 3.3 Subscription Renewal and Upgrade Billing | Billing record: the record (the subscription, the billing, the amount, the date) | TC-SA-15-03-020 |
| 3.3 Subscription Renewal and Upgrade Billing | Audit logging of the billing configuration and the executions | TC-SA-15-03-021 |
| 3.3 Subscription Renewal and Upgrade Billing | Rule: the renewal billing is the charge (the billing for the renewal, the amount); the billing is the value | TC-SA-15-03-015 |
| 3.3 Subscription Renewal and Upgrade Billing | Rule: the upgrade billing is the charge (the billing for the upgrade, the amount, the proration); the billing is the value | TC-SA-15-03-016 |
| 3.3 Subscription Renewal and Upgrade Billing | Rule: the proration is the fairness (the proration of the upgrade, the remaining period); the proration is the control | TC-SA-15-03-017 |
| 3.3 Subscription Renewal and Upgrade Billing | Rule: a billing change (the amount, the proration updated) is recorded (the new amount, the new proration, the time); it is auditable | TC-SA-15-03-021 |
| 3.3 Subscription Renewal and Upgrade Billing | Rule: the renewal and upgrade billing is visible (the subscriptions, the billings, the amounts, the dates); the billing is managed | TC-SA-15-03-018 |
| 3.3 Subscription Renewal and Upgrade Billing | Rule: billing configuration and executions are audit-logged with the subscription, billing, and timestamp | TC-SA-15-03-021 |

## 3.1 Recurring Billing for Subscriptions

### TC-SA-15-03-001 — Recurring charge: the charge (the recurring charge, the amount); the charge is the value
**Type:** Positive
**Covers:** 3.1 → Recurring charge: the charge (the recurring charge, the amount); Rule: the recurring charge is the amount (the recurring charge, the amount); the charge is the value
**Preconditions:** Super Admin is configuring recurring billing.
**Steps:**
1. Set the recurring charge: the charge (the recurring charge, the amount).
2. Verify the charge is the amount and is saved.
**Expected Result:** The recurring charge is set — the recurring charge and the amount are the value.
**Priority:** Critical

### TC-SA-15-03-002 — Billing period: the period (the period of the billing, e.g., the monthly, the annual); the period is the schedule
**Type:** Positive
**Covers:** 3.1 → Billing period: the period (the period of the billing, e.g., the monthly, the annual); Rule: the billing period is the frequency (the period of the billing, e.g., the monthly, the annual); the period is the schedule
**Preconditions:** Super Admin is configuring recurring billing.
**Steps:**
1. Set the billing period: the period (the period of the billing, e.g., the monthly, the annual).
2. Verify the period is the frequency and is saved.
**Expected Result:** The billing period is set — the period of the billing (e.g., the monthly, the annual) is the schedule.
**Priority:** High

### TC-SA-15-03-003 — Charge date: the date (the date of the charge, e.g., the 1st of the month); the date is the control
**Type:** Edge
**Covers:** 3.1 → Charge date: the date (the date of the charge, e.g., the 1st of the month); Rule: the charge date is the timing (the date of the charge, e.g., the 1st of the month); the date is the control
**Preconditions:** Super Admin is configuring recurring billing.
**Steps:**
1. Set the charge date: the date (the date of the charge, e.g., the 1st of the month).
2. Set a charge date for a month with 31 days (e.g., the 31st) and verify the behavior for months with fewer days (the charge is made on the last day of the month or per the configured rule).
3. Verify the date is the timing and is saved.
**Expected Result:** The charge date is set — the date of the charge is the timing, with the short-month edge case handled per the configured rule.
**Priority:** High

### TC-SA-15-03-004 — Billing configuration: the configuration (the subscription, the period, the amount, the date); the billing is managed
**Type:** Positive
**Covers:** 3.1 → Billing configuration: the configuration (the subscription, the period, the amount, the date); Rule: the recurring billing is visible (the subscriptions, the charges, the periods, the dates); the billing is managed
**Preconditions:** Super Admin is logged in.
**Steps:**
1. Configure the recurring billing: the subscription (the subscription, the plan), the period (the period of the billing, e.g., the monthly, the annual), the amount (the amount of the charge), and the charge date (the date of the charge, e.g., the 1st of the month).
2. Save; verify the recurring billing is live and the subscriptions are billed (the charge is recurring).
3. View the recurring billing — verify the subscriptions, the charges, the periods, and the dates are visible.
**Expected Result:** The billing configuration is saved — the subscription, the period, the amount, and the date are configured and visible.
**Priority:** Critical

### TC-SA-15-03-005 — Billing execution: the execution (the charge is made per the configuration); the billing is recorded
**Type:** Positive
**Covers:** 3.1 → Billing execution: the execution (the charge is made per the configuration)
**Preconditions:** Recurring billing is configured and live; the charge date arrives.
**Steps:**
1. The charge date arrives; verify the billing is executed (the charge is made, the amount is charged, the subscription is renewed).
2. Verify the billing is recorded.
**Expected Result:** The billing execution works — the charge is made per the configuration and the subscription is renewed.
**Priority:** Critical

### TC-SA-15-03-006 — Billing record: the record (the subscription, the charge, the period, the date); the record is the proof
**Type:** Positive
**Covers:** 3.1 → Billing record: the record (the subscription, the charge, the period, the date)
**Preconditions:** A recurring billing execution has occurred.
**Steps:**
1. Open the billing record.
2. Verify it shows the subscription, the charge, the period, and the date.
**Expected Result:** The billing is recorded — the subscription, the charge, the period, and the date are shown.
**Priority:** High

### TC-SA-15-03-007 — Billing configuration and executions are audit-logged with the subscription, charge, and timestamp
**Type:** Positive
**Covers:** 3.1 → Audit logging of the billing configuration and the executions; Rule: a billing change (the period, the amount, the date updated) is recorded (the new period, the new amount, the new date, the time); it is auditable; Rule: billing configuration and executions are audit-logged with the subscription, charge, and timestamp
**Preconditions:** Recurring billing has been configured, changed, and executed.
**Steps:**
1. Open the audit trail and filter by "recurring billing".
2. Verify entries show the subscription, the charge, and the timestamp for the configuration and executions.
3. Verify the billing change (the new period, the new amount, the new date, the time) is recorded and auditable.
**Expected Result:** The billing configuration and the executions are audit-logged with the subscription, charge, and timestamp.
**Priority:** Critical

## 3.2 Auto-Renewal Processing

### TC-SA-15-03-008 — Auto-renewal configuration: the configuration (the renewal, the charge, the notification, the failure handling); the configuration is the logic
**Type:** Positive
**Covers:** 3.2 → Auto-renewal configuration: the configuration (the renewal, the charge, the notification, the failure handling); Rule: the auto-renewal configuration is the control (the renewal, the charge, the notification, the failure handling); the configuration is the logic
**Preconditions:** Super Admin is logged in.
**Steps:**
1. Configure the auto-renewal: the renewal (the renewal of the subscription), the charge (the charge for the renewal), the notification (the notification to the user, the renewal), and the failure handling (the handling of the failed renewal, e.g., the retry, the grace period).
2. Save; verify the auto-renewal is live and the subscriptions are renewed automatically.
**Expected Result:** The auto-renewal configuration is saved — the renewal, the charge, the notification, and the failure handling are configured and live.
**Priority:** Critical

### TC-SA-15-03-009 — Renewal processing: the processing (the renewal is processed, the charge is made); the processing is the execution
**Type:** Positive
**Covers:** 3.2 → Renewal processing: the processing (the renewal is processed, the charge is made); Rule: the renewal processing is the action (the renewal is processed, the charge is made); the processing is the execution
**Preconditions:** Auto-renewal is configured and live; the renewal date arrives.
**Steps:**
1. The renewal date arrives; verify the auto-renewal is processed (the renewal is made, the charge is charged, the user is notified).
2. Verify the renewal is recorded.
**Expected Result:** The renewal processing works — the renewal is processed, the charge is made, and the renewal is recorded.
**Priority:** Critical

### TC-SA-15-03-010 — Renewal notification: the notification (the notification to the user, the renewal); the notification is the message
**Type:** Positive
**Covers:** 3.2 → Renewal notification: the notification (the notification to the user, the renewal); Rule: the renewal notification is the communication (the notification to the user, the renewal); the notification is the message
**Preconditions:** Auto-renewal is configured with the notification enabled; the renewal date arrives.
**Steps:**
1. The auto-renewal is processed — verify the user is notified of the renewal.
2. Verify the notification shows the renewal details (the subscription, the charge, the date).
**Expected Result:** The renewal notification is sent — the user is notified of the renewal.
**Priority:** High

### TC-SA-15-03-011 — Failure handling: the handling (the handling of the failed renewal, e.g., the retry, the grace period); the handling is the recovery
**Type:** Edge
**Covers:** 3.2 → Failure handling: the handling (the handling of the failed renewal, e.g., the retry, the grace period)
**Preconditions:** Auto-renewal is configured with failure handling (the retry, the grace period); a renewal charge fails.
**Steps:**
1. A renewal charge fails — verify the failure handling is triggered (the retry is made per the configuration).
2. Verify the grace period is applied (the subscription is not immediately cancelled during the grace period).
3. Verify the failed renewal and the handling are recorded.
**Expected Result:** The failure handling works — the failed renewal is retried and the grace period is applied per the configuration.
**Priority:** Critical

### TC-SA-15-03-012 — Renewal record: the record (the subscription, the renewal, the charge, the date); the record is the proof
**Type:** Positive
**Covers:** 3.2 → Renewal record: the record (the subscription, the renewal, the charge, the date)
**Preconditions:** An auto-renewal has been processed.
**Steps:**
1. Open the renewal record.
2. Verify it shows the subscription, the renewal, the charge, and the date.
**Expected Result:** The renewal is recorded — the subscription, the renewal, the charge, and the date are shown.
**Priority:** High

### TC-SA-15-03-013 — Renewal view: the view (the renewals, the period); the processing is managed
**Type:** Positive
**Covers:** 3.2 → Renewal view: the view (the renewals, the period); Rule: the auto-renewals are visible (the renewals, the period); the processing is managed
**Preconditions:** Auto-renewals have been processed across a period.
**Steps:**
1. View the renewals: the renewals, the period — verify the auto-renewals are visible.
2. Verify the view is complete for the period.
**Expected Result:** The renewal view works — the renewals for the period are visible.
**Priority:** High

### TC-SA-15-03-014 — Auto-renewal configuration and processing are audit-logged with the subscription, renewal, and timestamp
**Type:** Positive
**Covers:** 3.2 → Audit logging of the auto-renewal configuration and the processing; Rule: a configuration change (the charge, the notification, the failure handling updated) is recorded (the new charge, the new notification, the new failure handling, the time); it is auditable; Rule: auto-renewal configuration and processing are audit-logged with the subscription, renewal, and timestamp
**Preconditions:** Auto-renewal has been configured, changed, and processed.
**Steps:**
1. Open the audit trail and filter by "auto-renewal".
2. Verify entries show the subscription, the renewal, and the timestamp for the configuration and processing.
3. Verify the configuration change (the new charge, the new notification, the new failure handling, the time) is recorded and auditable.
**Expected Result:** The auto-renewal configuration and the processing are audit-logged with the subscription, renewal, and timestamp.
**Priority:** Critical

## 3.3 Subscription Renewal and Upgrade Billing

### TC-SA-15-03-015 — Renewal billing: the billing (the billing for the renewal, the amount); the billing is the value
**Type:** Positive
**Covers:** 3.3 → Renewal billing: the billing (the billing for the renewal, the amount); Rule: the renewal billing is the charge (the billing for the renewal, the amount); the billing is the value
**Preconditions:** Super Admin is configuring renewal and upgrade billing.
**Steps:**
1. Set the renewal billing: the billing (the billing for the renewal, the amount).
2. Verify the billing is the charge and is saved.
**Expected Result:** The renewal billing is set — the billing for the renewal and the amount are the value.
**Priority:** Critical

### TC-SA-15-03-016 — Upgrade billing: the billing (the billing for the upgrade, the amount, the proration); the billing is the value
**Type:** Positive
**Covers:** 3.3 → Upgrade billing: the billing (the billing for the upgrade, the amount, the proration); Rule: the upgrade billing is the charge (the billing for the upgrade, the amount, the proration); the billing is the value
**Preconditions:** Super Admin is configuring renewal and upgrade billing.
**Steps:**
1. Set the upgrade billing: the billing (the billing for the upgrade, the amount, the proration).
2. Verify the billing is the charge and is saved.
**Expected Result:** The upgrade billing is set — the billing for the upgrade, the amount, and the proration are the value.
**Priority:** Critical

### TC-SA-15-03-017 — Proration: the proration (the proration of the upgrade, the remaining period); the proration is the control
**Type:** Edge
**Covers:** 3.3 → Proration: the proration (the proration of the upgrade, the remaining period); Rule: the proration is the fairness (the proration of the upgrade, the remaining period); the proration is the control
**Preconditions:** A subscription is mid-period (e.g., 15 days remaining of a 30-day period) and is upgraded.
**Steps:**
1. Upgrade the subscription mid-period — verify the proration is applied (the remaining period is credited).
2. Verify the upgrade charge is the difference between the new plan and the prorated remaining value of the old plan.
3. Verify the proration is the fairness and is recorded.
**Expected Result:** The proration is applied — the remaining period is credited and the upgrade charge is the prorated difference.
**Priority:** Critical

### TC-SA-15-03-018 — Billing configuration: the configuration (the renewal, the upgrade, the proration, the charge); the billing is managed
**Type:** Positive
**Covers:** 3.3 → Billing configuration: the configuration (the renewal, the upgrade, the proration, the charge); Rule: the renewal and upgrade billing is visible (the subscriptions, the billings, the amounts, the dates); the billing is managed
**Preconditions:** Super Admin is logged in.
**Steps:**
1. Configure the renewal and upgrade billing: the renewal (the renewal of the subscription), the upgrade (the upgrade of the subscription), the proration (the proration of the upgrade, the remaining period), and the charge (the charge for the billing).
2. Save; verify the renewal and upgrade billing is live and the renewals and upgrades are billed.
3. View the billing — verify the subscriptions, the billings, the amounts, and the dates are visible.
**Expected Result:** The billing configuration is saved — the renewal, the upgrade, the proration, and the charge are configured and visible.
**Priority:** Critical

### TC-SA-15-03-019 — Billing execution: the execution (the billing is made per the configuration); the billing is recorded
**Type:** Positive
**Covers:** 3.3 → Billing execution: the execution (the billing is made per the configuration)
**Preconditions:** Renewal and upgrade billing is configured and live; a subscription is renewed or upgraded.
**Steps:**
1. A subscription is renewed or upgraded; verify the billing is executed (the billing is made, the charge is charged, the proration is applied).
2. Verify the billing is recorded.
**Expected Result:** The billing execution works — the billing is made per the configuration and the proration is applied.
**Priority:** Critical

### TC-SA-15-03-020 — Billing record: the record (the subscription, the billing, the amount, the date); the record is the proof
**Type:** Positive
**Covers:** 3.3 → Billing record: the record (the subscription, the billing, the amount, the date)
**Preconditions:** A renewal or upgrade billing execution has occurred.
**Steps:**
1. Open the billing record.
2. Verify it shows the subscription, the billing, the amount, and the date.
**Expected Result:** The billing is recorded — the subscription, the billing, the amount, and the date are shown.
**Priority:** High

### TC-SA-15-03-021 — Billing configuration and executions are audit-logged with the subscription, billing, and timestamp
**Type:** Positive
**Covers:** 3.3 → Audit logging of the billing configuration and the executions; Rule: a billing change (the amount, the proration updated) is recorded (the new amount, the new proration, the time); it is auditable; Rule: billing configuration and executions are audit-logged with the subscription, billing, and timestamp
**Preconditions:** Renewal and upgrade billing has been configured, changed, and executed.
**Steps:**
1. Open the audit trail and filter by "renewal and upgrade billing".
2. Verify entries show the subscription, the billing, and the timestamp for the configuration and executions.
3. Verify the billing change (the new amount, the new proration, the time) is recorded and auditable.
**Expected Result:** The billing configuration and the executions are audit-logged with the subscription, billing, and timestamp.
**Priority:** Critical
