# 4. Professional Courses & Discounts — Test Cases

User Type: **Student**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: professional_courses_discounts.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 Professional Course Purchase | Browse Professional courses by category and sub-category | TC-ST-07-04-001 |
| 4.1 Professional Course Purchase | Course detail view (outline, duration, price) | TC-ST-07-04-002 |
| 4.1 Professional Course Purchase | Purchase a Professional course | TC-ST-07-04-003 |
| 4.1 Professional Course Purchase | Course added to the Student's library on purchase | TC-ST-07-04-004 |
| 4.1 Professional Course Purchase | Full access to a purchased course | TC-ST-07-04-005 |
| 4.1 Professional Course Purchase | Purchased courses list | TC-ST-07-04-006 |
| 4.1 Professional Course Purchase | Purchase event logging (viewed, purchased) | TC-ST-07-04-007 |
| 4.1 Professional Course Purchase | Audit logging of the professional course purchase | TC-ST-07-04-008 |
| 4.1 Professional Course Purchase | Rule: Professional courses are priced course-wise. | TC-ST-07-04-001 |
| 4.1 Professional Course Purchase | Rule: A purchase requires a successful payment. | TC-ST-07-04-002 |
| 4.1 Professional Course Purchase | Rule: A purchased course is added to the library with full access. | TC-ST-07-04-003 |
| 4.1 Professional Course Purchase | Rule: The purchased courses list shows all owned courses. | TC-ST-07-04-004 |
| 4.1 Professional Course Purchase | Rule: Purchase events (viewed, purchased) are logged with the course and the timestamp. | TC-ST-07-04-005 |
| 4.1 Professional Course Purchase | Rule: The professional course purchase is audit-logged with the account, the course, and the timestamp. | TC-ST-07-04-006 |
| 4.2 Discount Codes and Promotions | Enter a discount code at checkout | TC-ST-07-04-009 |
| 4.2 Discount Codes and Promotions | Discount applied to the order total | TC-ST-07-04-010 |
| 4.2 Discount Codes and Promotions | Active promotions shown | TC-ST-07-04-011 |
| 4.2 Discount Codes and Promotions | Code validated for eligibility | TC-ST-07-04-012 |
| 4.2 Discount Codes and Promotions | Code validated for expiry | TC-ST-07-04-013 |
| 4.2 Discount Codes and Promotions | Code validated for usage limits (single-use, max uses) | TC-ST-07-04-014 |
| 4.2 Discount Codes and Promotions | Discount amount shown before confirming | TC-ST-07-04-015 |
| 4.2 Discount Codes and Promotions | Discount event logging (applied, rejected) | TC-ST-07-04-016 |
| 4.2 Discount Codes and Promotions | Audit logging of the discount codes and promotions | TC-ST-07-04-017 |
| 4.2 Discount Codes and Promotions | Rule: A discount code is validated for eligibility, expiry, and usage limits. | TC-ST-07-04-009 |
| 4.2 Discount Codes and Promotions | Rule: A single-use code cannot be reused. | TC-ST-07-04-010 |
| 4.2 Discount Codes and Promotions | Rule: The discount amount is shown before confirming. | TC-ST-07-04-011 |
| 4.2 Discount Codes and Promotions | Rule: An invalid or expired code is rejected with a message. | TC-ST-07-04-012 |
| 4.2 Discount Codes and Promotions | Rule: Discount events (applied, rejected) are logged with the code and the timestamp. | TC-ST-07-04-013 |
| 4.2 Discount Codes and Promotions | Rule: The discount codes and promotions is audit-logged with the account, the code, and the timestamp. | TC-ST-07-04-014 |
| 4.3 Subscription Status and Access | Current subscription status (active, expiring, lapsed) | TC-ST-07-04-018 |
| 4.3 Subscription Status and Access | Active plan and its expiry date | TC-ST-07-04-019 |
| 4.3 Subscription Status and Access | Included subjects and courses listed | TC-ST-07-04-020 |
| 4.3 Subscription Status and Access | Locked content indicated (requires upgrade/purchase) | TC-ST-07-04-021 |
| 4.3 Subscription Status and Access | Access restored on renewal | TC-ST-07-04-022 |
| 4.3 Subscription Status and Access | Status available on web and mobile | TC-ST-07-04-023 |
| 4.3 Subscription Status and Access | Status event logging (viewed) | TC-ST-07-04-024 |
| 4.3 Subscription Status and Access | Audit logging of the subscription status and access | TC-ST-07-04-025 |
| 4.3 Subscription Status and Access | Rule: The status is active, expiring, or lapsed. | TC-ST-07-04-018 |
| 4.3 Subscription Status and Access | Rule: Included subjects and courses are listed per the plan. | TC-ST-07-04-019 |
| 4.3 Subscription Status and Access | Rule: Locked content requires an upgrade or purchase to access. | TC-ST-07-04-020 |
| 4.3 Subscription Status and Access | Rule: Access is restored on renewal. | TC-ST-07-04-021 |
| 4.3 Subscription Status and Access | Rule: Status events (viewed) are logged with the subscription and the timestamp. | TC-ST-07-04-022 |
| 4.3 Subscription Status and Access | Rule: The subscription status and access is audit-logged with the account, the subscription, and the timestamp. | TC-ST-07-04-023 |

## 4.1 Professional Course Purchase

### TC-ST-07-04-001 — Browse Professional courses by category and sub-category
**Type:** Positive
**Covers:** 4.1 → Browse Professional courses by category and sub-category; Rule: Professional courses are priced course-wise.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Browse Professional courses by category and sub-category.
2. Observe the result and verify the full behavior: Browse Professional courses by category and sub-category.
**Expected Result:** Browse Professional courses by category and sub-category — delivered exactly as documented.
**Priority:** Critical

### TC-ST-07-04-002 — Course detail view (outline, duration, price)
**Type:** Positive
**Covers:** 4.1 → Course detail view (outline, duration, price); Rule: A purchase requires a successful payment.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Course detail view (outline.
2. Observe the result and verify the full behavior: Course detail view (outline, duration, price).
**Expected Result:** Course detail view (outline, duration, price) — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-003 — Purchase a Professional course
**Type:** Positive
**Covers:** 4.1 → Purchase a Professional course; Rule: A purchased course is added to the library with full access.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Purchase a Professional course.
2. Observe the result and verify the full behavior: Purchase a Professional course.
**Expected Result:** Purchase a Professional course — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-004 — Course added to the Student's library on purchase
**Type:** Positive
**Covers:** 4.1 → Course added to the Student's library on purchase; Rule: The purchased courses list shows all owned courses.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Course added to the Student's library on purchase.
2. Observe the result and verify the full behavior: Course added to the Student's library on purchase.
**Expected Result:** Course added to the Student's library on purchase — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-005 — Full access to a purchased course
**Type:** Positive
**Covers:** 4.1 → Full access to a purchased course; Rule: Purchase events (viewed, purchased) are logged with the course and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Full access to a purchased course.
2. Observe the result and verify the full behavior: Full access to a purchased course.
**Expected Result:** Full access to a purchased course — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-006 — Purchased courses list
**Type:** Positive
**Covers:** 4.1 → Purchased courses list; Rule: The professional course purchase is audit-logged with the account, the course, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Purchased courses list.
2. Observe the result and verify the full behavior: Purchased courses list.
**Expected Result:** Purchased courses list — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-007 — Purchase event logging (viewed, purchased)
**Type:** Positive
**Covers:** 4.1 → Purchase event logging (viewed, purchased)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Purchase event logging (viewed.
2. Observe the result and verify the full behavior: Purchase event logging (viewed, purchased).
**Expected Result:** Purchase event logging (viewed, purchased) — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-008 — Audit logging of the professional course purchase
**Type:** Positive
**Covers:** 4.1 → Audit logging of the professional course purchase
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the professional course purchase.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical

## 4.2 Discount Codes and Promotions

### TC-ST-07-04-009 — Enter a discount code at checkout
**Type:** Positive
**Covers:** 4.2 → Enter a discount code at checkout; Rule: A discount code is validated for eligibility, expiry, and usage limits.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Enter a discount code at checkout.
2. Observe the result and verify the full behavior: Enter a discount code at checkout.
**Expected Result:** Enter a discount code at checkout — delivered exactly as documented.
**Priority:** Critical

### TC-ST-07-04-010 — Discount applied to the order total
**Type:** Positive
**Covers:** 4.2 → Discount applied to the order total; Rule: A single-use code cannot be reused.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Discount applied to the order total.
2. Observe the result and verify the full behavior: Discount applied to the order total.
**Expected Result:** Discount applied to the order total — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-011 — Active promotions shown
**Type:** Positive
**Covers:** 4.2 → Active promotions shown; Rule: The discount amount is shown before confirming.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Active promotions shown.
2. Observe the result and verify the full behavior: Active promotions shown.
**Expected Result:** Active promotions shown — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-012 — Code validated for eligibility
**Type:** Positive
**Covers:** 4.2 → Code validated for eligibility; Rule: An invalid or expired code is rejected with a message.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Code validated for eligibility.
2. Observe the result and verify the full behavior: Code validated for eligibility.
**Expected Result:** Code validated for eligibility — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-013 — Code validated for expiry
**Type:** Edge
**Covers:** 4.2 → Code validated for expiry; Rule: Discount events (applied, rejected) are logged with the code and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Code validated for expiry.
2. Observe the result and verify the full behavior: Code validated for expiry.
**Expected Result:** Code validated for expiry — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-014 — Code validated for usage limits (single-use, max uses)
**Type:** Edge
**Covers:** 4.2 → Code validated for usage limits (single-use, max uses); Rule: The discount codes and promotions is audit-logged with the account, the code, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Code validated for usage limits (single-use.
2. Observe the result and verify the full behavior: Code validated for usage limits (single-use, max uses).
**Expected Result:** Code validated for usage limits (single-use, max uses) — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-015 — Discount amount shown before confirming
**Type:** Positive
**Covers:** 4.2 → Discount amount shown before confirming
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Discount amount shown before confirming.
2. Observe the result and verify the full behavior: Discount amount shown before confirming.
**Expected Result:** Discount amount shown before confirming — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-016 — Discount event logging (applied, rejected)
**Type:** Edge
**Covers:** 4.2 → Discount event logging (applied, rejected)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Discount event logging (applied.
2. Observe the result and verify the full behavior: Discount event logging (applied, rejected).
**Expected Result:** Discount event logging (applied, rejected) — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-017 — Audit logging of the discount codes and promotions
**Type:** Positive
**Covers:** 4.2 → Audit logging of the discount codes and promotions
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the discount codes and promotions.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical

## 4.3 Subscription Status and Access

### TC-ST-07-04-018 — Current subscription status (active, expiring, lapsed)
**Type:** Edge
**Covers:** 4.3 → Current subscription status (active, expiring, lapsed); Rule: The status is active, expiring, or lapsed.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Current subscription status (active.
2. Observe the result and verify the full behavior: Current subscription status (active, expiring, lapsed).
**Expected Result:** Current subscription status (active, expiring, lapsed) — delivered exactly as documented.
**Priority:** Critical

### TC-ST-07-04-019 — Active plan and its expiry date
**Type:** Edge
**Covers:** 4.3 → Active plan and its expiry date; Rule: Included subjects and courses are listed per the plan.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Active plan and its expiry date.
2. Observe the result and verify the full behavior: Active plan and its expiry date.
**Expected Result:** Active plan and its expiry date — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-020 — Included subjects and courses listed
**Type:** Positive
**Covers:** 4.3 → Included subjects and courses listed; Rule: Locked content requires an upgrade or purchase to access.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Included subjects and courses listed.
2. Observe the result and verify the full behavior: Included subjects and courses listed.
**Expected Result:** Included subjects and courses listed — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-021 — Locked content indicated (requires upgrade/purchase)
**Type:** Positive
**Covers:** 4.3 → Locked content indicated (requires upgrade/purchase); Rule: Access is restored on renewal.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Locked content indicated (requires upgrade/purchase).
2. Observe the result and verify the full behavior: Locked content indicated (requires upgrade/purchase).
**Expected Result:** Locked content indicated (requires upgrade/purchase) — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-022 — Access restored on renewal
**Type:** Positive
**Covers:** 4.3 → Access restored on renewal; Rule: Status events (viewed) are logged with the subscription and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Access restored on renewal.
2. Observe the result and verify the full behavior: Access restored on renewal.
**Expected Result:** Access restored on renewal — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-023 — Status available on web and mobile
**Type:** Positive
**Covers:** 4.3 → Status available on web and mobile; Rule: The subscription status and access is audit-logged with the account, the subscription, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Status available on web and mobile.
2. Observe the result and verify the full behavior: Status available on web and mobile.
**Expected Result:** Status available on web and mobile — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-024 — Status event logging (viewed)
**Type:** Positive
**Covers:** 4.3 → Status event logging (viewed)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Status event logging (viewed).
2. Observe the result and verify the full behavior: Status event logging (viewed).
**Expected Result:** Status event logging (viewed) — delivered exactly as documented.
**Priority:** High

### TC-ST-07-04-025 — Audit logging of the subscription status and access
**Type:** Positive
**Covers:** 4.3 → Audit logging of the subscription status and access
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the subscription status and access.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical
