# 7. Bulk Operations — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: bulk_operations.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 |
|---------|--------------------|----------|
| 7.1 Bulk Activation, Suspension, and Updates | Select a set via directory filters or explicit selection | TC-SA-03-07-001 |
| 7.1 Bulk Activation, Suspension, and Updates | Bulk actions: activate, suspend, deactivate, profile update (e.g., institute re-link, field update) | TC-SA-03-07-002 |
| 7.1 Bulk Activation, Suspension, and Updates | Pre-commit preview: the exact affected accounts, the action, and the reason | TC-SA-03-07-003 |
| 7.1 Bulk Activation, Suspension, and Updates | Per-account result report: succeeded, failed with the specific reason per failure | TC-SA-03-07-004 |
| 7.1 Bulk Activation, Suspension, and Updates | Reason recording for the operation | TC-SA-03-07-005 |
| 7.1 Bulk Activation, Suspension, and Updates | Audit logging with the set, action, reason, and result counts | TC-SA-03-07-006 |
| 7.1 Bulk Activation, Suspension, and Updates | Rule: a bulk operation is never silent: the preview shows the exact set and action before commit | TC-SA-03-07-003 |
| 7.1 Bulk Activation, Suspension, and Updates | Rule: per-account failures do not stop the operation; they are reported with reasons | TC-SA-03-07-007 |
| 7.1 Bulk Activation, Suspension, and Updates | Rule: a reason is required and recorded for every bulk operation | TC-SA-03-07-005 |
| 7.1 Bulk Activation, Suspension, and Updates | Rule: legal holds and other blockers are respected per account (a blocked account fails with a reason, not silently skipped) | TC-SA-03-07-008 |
| 7.1 Bulk Activation, Suspension, and Updates | Rule: the result report is the record; it is retained with the audit entry | TC-SA-03-07-004 |
| 7.1 Bulk Activation, Suspension, and Updates | Rule: the operation is audit-logged as a single event with the set, action, reason, and result counts | TC-SA-03-07-006 |
| 7.2 Bulk Assignment of Courses to Student Groups | Select a student group (by institute, class/grade, cohort, or explicit selection) | TC-SA-03-07-009 |
| 7.2 Bulk Assignment of Courses to Student Groups | Assign one or more courses to the group | TC-SA-03-07-010 |
| 7.2 Bulk Assignment of Courses to Student Groups | Per-student eligibility check (membership active, seat valid, age/consent where required) | TC-SA-03-07-011 |
| 7.2 Bulk Assignment of Courses to Student Groups | Pre-commit preview: the group, the courses, and the expected enrollment count | TC-SA-03-07-012 |
| 7.2 Bulk Assignment of Courses to Student Groups | Per-student result report: enrolled, skipped with the specific reason | TC-SA-03-07-013 |
| 7.2 Bulk Assignment of Courses to Student Groups | Duplicate handling: already-enrolled students are not double-enrolled | TC-SA-03-07-014 |
| 7.2 Bulk Assignment of Courses to Student Groups | Audit logging with the group, courses, and result counts | TC-SA-03-07-015 |
| 7.2 Bulk Assignment of Courses to Student Groups | Rule: the preview shows the expected enrollment count and the eligibility summary before commit | TC-SA-03-07-012 |
| 7.2 Bulk Assignment of Courses to Student Groups | Rule: per-student eligibility is checked; ineligible students are skipped with a reason, not force-enrolled | TC-SA-03-07-011 |
| 7.2 Bulk Assignment of Courses to Student Groups | Rule: duplicate enrollments are prevented; an already-enrolled student is not double-enrolled | TC-SA-03-07-014 |
| 7.2 Bulk Assignment of Courses to Student Groups | Rule: a skip does not stop the operation; it is reported for follow-up | TC-SA-03-07-016 |
| 7.2 Bulk Assignment of Courses to Student Groups | Rule: course constraints (capacity, prerequisites) are respected per course; a constraint failure is a per-student skip with a reason | TC-SA-03-07-017 |
| 7.2 Bulk Assignment of Courses to Student Groups | Rule: the operation is audit-logged with the group, the courses, and the result counts | TC-SA-03-07-015 |
| 7.3 Bulk Operation Safety and Audit | Mandatory pre-commit preview for every bulk operation (set, action, reason) | TC-SA-03-07-018 |
| 7.3 Bulk Operation Safety and Audit | Reason recording for every bulk operation | TC-SA-03-07-019 |
| 7.3 Bulk Operation Safety and Audit | Per-item result reporting (succeeded/failed/skipped with reasons) | TC-SA-03-07-020 |
| 7.3 Bulk Operation Safety and Audit | Blocker respect: legal holds, eligibility, and constraints are enforced per item | TC-SA-03-07-021 |
| 7.3 Bulk Operation Safety and Audit | Operation size guardrails: unusually large operations prompt extra confirmation | TC-SA-03-07-022 |
| 7.3 Bulk Operation Safety and Audit | Complete audit record: set reference, action, reason, result counts, and the result report | TC-SA-03-07-023 |
| 7.3 Bulk Operation Safety and Audit | Reversibility guidance: where reversible, the reverse path is indicated | TC-SA-03-07-024 |
| 7.3 Bulk Operation Safety and Audit | Rule: no bulk operation commits without a preview and a recorded reason | TC-SA-03-07-018 |
| 7.3 Bulk Operation Safety and Audit | Rule: per-item blockers are respected: a legal hold or eligibility failure is a reported skip/failure, not a silent omission | TC-SA-03-07-021 |
| 7.3 Bulk Operation Safety and Audit | Rule: unusually large operations trigger extra confirmation (a threshold defined by the platform) | TC-SA-03-07-022 |
| 7.3 Bulk Operation Safety and Audit | Rule: irreversible bulk actions state the consequences explicitly in the confirmation | TC-SA-03-07-025 |
| 7.3 Bulk Operation Safety and Audit | Rule: every bulk operation has a complete audit record; the result report is retained | TC-SA-03-07-023 |
| 7.3 Bulk Operation Safety and Audit | Rule: the bulk-operation log is reviewable, so mass changes are always explainable | TC-SA-03-07-026 |

## 7.1 Bulk Activation, Suspension, and Updates

### TC-SA-03-07-001 — A set can be selected via directory filters or explicit selection
**Type:** Positive
**Covers:** 7.1 → Select a set via directory filters or explicit selection
**Preconditions:** The directory contains 500 accounts; 120 match a filter (institute = X, status = active).
**Steps:**
1. Apply the filter (institute = X, status = active) and select the resulting set.
2. For a second operation, explicitly tick 15 accounts.
**Expected Result:** Both selection methods work — the filter selects the 120 matching accounts; the explicit selection picks exactly the 15 ticked accounts.
**Priority:** High

### TC-SA-03-07-002 — Bulk actions: activate, suspend, deactivate, and profile update
**Type:** Positive
**Covers:** 7.1 → Bulk actions: activate, suspend, deactivate, profile update (e.g., institute re-link, field update)
**Preconditions:** Four sets of accounts are prepared for the four actions.
**Steps:**
1. Bulk-activate a set of suspended accounts.
2. Bulk-suspend a set of active accounts.
3. Bulk-deactivate a set of accounts.
4. Bulk-update a set (re-link institute, update a field).
**Expected Result:** All four bulk actions execute — activate, suspend, deactivate, and profile update all work on a set.
**Priority:** Critical

### TC-SA-03-07-003 — Pre-commit preview shows the exact affected accounts, the action, and the reason; no operation is silent
**Type:** Positive
**Covers:** 7.1 → Pre-commit preview: the exact affected accounts, the action, and the reason; Rule: a bulk operation is never silent: the preview shows the exact set and action before commit
**Preconditions:** A set of 120 accounts is selected for bulk suspension.
**Steps:**
1. Choose "Suspend" and enter the reason.
2. Review the pre-commit preview.
3. Verify the preview lists the exact 120 accounts, the action (suspend), and the reason.
**Expected Result:** The preview shows the exact affected accounts (120), the action, and the reason — the operation is never silent.
**Priority:** Critical

### TC-SA-03-07-004 — Per-account result report: succeeded, failed with the specific reason per failure; retained with the audit entry
**Type:** Positive
**Covers:** 7.1 → Per-account result report: succeeded, failed with the specific reason per failure; Rule: the result report is the record; it is retained with the audit entry
**Preconditions:** A bulk operation on 120 accounts completes with 118 successes and 2 failures.
**Steps:**
1. Open the per-account result report.
2. Verify the 118 successes and the 2 failures with their specific reasons.
3. Verify the report is retained with the audit entry.
**Expected Result:** The report shows 118 succeeded and 2 failed with the specific reason per failure; the report is retained with the audit entry.
**Priority:** Critical

### TC-SA-03-07-005 — A reason is required and recorded for every bulk operation
**Type:** Positive
**Covers:** 7.1 → Reason recording for the operation; Rule: a reason is required and recorded for every bulk operation
**Preconditions:** A bulk operation is being prepared.
**Steps:**
1. Attempt to commit the operation without a reason.
2. Enter the reason and commit.
3. Verify the reason is recorded.
**Expected Result:** The operation is blocked without a reason; with the reason, it commits and the reason is recorded.
**Priority:** Critical

### TC-SA-03-07-006 — The operation is audit-logged as a single event with the set, action, reason, and result counts
**Type:** Positive
**Covers:** 7.1 → Audit logging with the set, action, reason, and result counts; Rule: the operation is audit-logged as a single event with the set, action, reason, and result counts
**Preconditions:** A bulk operation has completed.
**Steps:**
1. Open the audit trail and locate the bulk-operation entry.
2. Verify it is a single event with the set reference, action, reason, and result counts.
**Expected Result:** The operation is audit-logged as a single event with the set, action, reason, and result counts.
**Priority:** Critical

### TC-SA-03-07-007 — Per-account failures do not stop the operation; they are reported with reasons
**Type:** Negative
**Covers:** 7.1 → Rule: per-account failures do not stop the operation; they are reported with reasons
**Preconditions:** A bulk activation of 100 accounts; 3 accounts have a validation error (missing email).
**Steps:**
1. Commit the bulk activation.
2. Verify the operation continues past the 3 failures.
3. Verify the 97 successes and the 3 failures with reasons.
**Expected Result:** The 3 failures do not stop the operation — 97 succeed, and the 3 failures are reported with the specific reason (missing email).
**Priority:** High

### TC-SA-03-07-008 — Legal holds and other blockers are respected per account; a blocked account fails with a reason, not silently skipped
**Type:** Negative
**Covers:** 7.1 → Rule: legal holds and other blockers are respected per account: a blocked account fails with a reason, not silently skipped
**Preconditions:** A bulk deactivation of 50 accounts; 2 accounts are under legal hold.
**Steps:**
1. Commit the bulk deactivation.
2. Verify the 2 legal-hold accounts are not deactivated.
3. Verify they appear in the result report as failures with the reason "legal hold".
**Expected Result:** The 2 legal-hold accounts are not deactivated; they fail with the reason "legal hold" — not silently skipped.
**Priority:** Critical

## 7.2 Bulk Assignment of Courses to Student Groups

### TC-SA-03-07-009 — A student group can be selected by institute, class/grade, cohort, or explicit selection
**Type:** Positive
**Covers:** 7.2 → Select a student group (by institute, class/grade, cohort, or explicit selection)
**Preconditions:** Students exist across institutes, classes, and cohorts.
**Steps:**
1. Select a group by institute (Institute X).
2. Select a group by class/grade (Grade 10).
3. Select a group by cohort (Cohort 2026).
4. Select a group by explicit selection (20 ticked students).
**Expected Result:** All four group-selection methods work — each selects the correct set of students.
**Priority:** High

### TC-SA-03-07-010 — One or more courses can be assigned to the group
**Type:** Positive
**Covers:** 7.2 → Assign one or more courses to the group
**Preconditions:** A student group is selected; three courses are available.
**Steps:**
1. Assign all three courses to the group.
2. Verify the assignment is applied.
**Expected Result:** All three courses are assigned to the group — multiple courses can be assigned in one operation.
**Priority:** High

### TC-SA-03-07-011 — Per-student eligibility check: membership active, seat valid, age/consent where required; ineligible students are skipped with a reason
**Type:** Negative
**Covers:** 7.2 → Per-student eligibility check (membership active, seat valid, age/consent where required); Rule: per-student eligibility is checked; ineligible students are skipped with a reason, not force-enrolled
**Preconditions:** A group of 100 students: 95 eligible, 3 with lapsed membership, 2 with no valid seat.
**Steps:**
1. Assign a course to the group.
2. Verify the 95 eligible students are enrolled.
3. Verify the 5 ineligible students are skipped with the specific reason (lapsed membership / no valid seat).
**Expected Result:** The 95 eligible students are enrolled; the 5 ineligible students are skipped with the specific reason — none is force-enrolled.
**Priority:** Critical

### TC-SA-03-07-012 — Pre-commit preview shows the group, the courses, and the expected enrollment count with the eligibility summary
**Type:** Positive
**Covers:** 7.2 → Pre-commit preview: the group, the courses, and the expected enrollment count; Rule: the preview shows the expected enrollment count and the eligibility summary before commit
**Preconditions:** A group of 100 students is selected for a course assignment.
**Steps:**
1. Choose the course and review the pre-commit preview.
2. Verify the preview shows the group, the courses, the expected enrollment count, and the eligibility summary.
**Expected Result:** The preview shows the group, the courses, the expected enrollment count, and the eligibility summary — before commit.
**Priority:** Critical

### TC-SA-03-07-013 — Per-student result report: enrolled, skipped with the specific reason
**Type:** Positive
**Covers:** 7.2 → Per-student result report: enrolled, skipped with the specific reason
**Preconditions:** A course assignment to 100 students completes with 95 enrolled and 5 skipped.
**Steps:**
1. Open the per-student result report.
2. Verify the 95 enrolled and the 5 skipped with their specific reasons.
**Expected Result:** The report shows 95 enrolled and 5 skipped with the specific reason per skip.
**Priority:** High

### TC-SA-03-07-014 — Duplicate handling: already-enrolled students are not double-enrolled
**Type:** Negative
**Covers:** 7.2 → Duplicate handling: already-enrolled students are not double-enrolled; Rule: duplicate enrollments are prevented; an already-enrolled student is not double-enrolled
**Preconditions:** A group of 100 students; 10 are already enrolled in the course.
**Steps:**
1. Assign the course to the group.
2. Verify the 10 already-enrolled students are not double-enrolled.
3. Verify the 90 new students are enrolled.
**Expected Result:** The 10 already-enrolled students are not double-enrolled (reported as duplicates); the 90 new students are enrolled.
**Priority:** Critical

### TC-SA-03-07-015 — The operation is audit-logged with the group, the courses, and the result counts
**Type:** Positive
**Covers:** 7.2 → Audit logging with the group, courses, and result counts; Rule: the operation is audit-logged with the group, the courses, and the result counts
**Preconditions:** A course assignment has completed.
**Steps:**
1. Open the audit trail and locate the bulk-assignment entry.
2. Verify the group, the courses, and the result counts.
**Expected Result:** The operation is audit-logged with the group, the courses, and the result counts.
**Priority:** Critical

### TC-SA-03-07-016 — A skip does not stop the operation; it is reported for follow-up
**Type:** Negative
**Covers:** 7.2 → Rule: a skip does not stop the operation; it is reported for follow-up
**Preconditions:** A course assignment to 100 students; 5 are ineligible.
**Steps:**
1. Commit the assignment.
2. Verify the operation continues past the 5 skips.
3. Verify the 95 enrollments and the 5 skips are reported.
**Expected Result:** The 5 skips do not stop the operation — 95 students are enrolled, and the 5 skips are reported for follow-up.
**Priority:** High

### TC-SA-03-07-017 — Course constraints (capacity, prerequisites) are respected per course; a constraint failure is a per-student skip with a reason
**Type:** Negative
**Covers:** 7.2 → Rule: course constraints (capacity, prerequisites) are respected per course; a constraint failure is a per-student skip with a reason
**Preconditions:** A course with a capacity of 90 is assigned to a group of 100 students; 10 students lack the prerequisite.
**Steps:**
1. Assign the course to the group.
2. Verify the 10 students lacking the prerequisite are skipped with the reason "prerequisite not met".
3. Verify the capacity constraint is respected (no more than 90 enrolled).
**Expected Result:** The 10 students lacking the prerequisite are skipped with the reason; the capacity constraint is respected — no over-enrollment.
**Priority:** Critical

## 7.3 Bulk Operation Safety and Audit

### TC-SA-03-07-018 — No bulk operation commits without a preview and a recorded reason
**Type:** Negative
**Covers:** 7.3 → Mandatory pre-commit preview for every bulk operation (set, action, reason); Rule: no bulk operation commits without a preview and a recorded reason
**Preconditions:** A bulk operation is being prepared.
**Steps:**
1. Attempt to commit the operation without reviewing the preview.
2. Attempt to commit without a recorded reason.
**Expected Result:** Both attempts are blocked — no bulk operation commits without a preview and a recorded reason.
**Priority:** Critical

### TC-SA-03-07-019 — Reason recording is enforced for every bulk operation
**Type:** Positive
**Covers:** 7.3 → Reason recording for every bulk operation
**Preconditions:** Three bulk operations of different types are performed.
**Steps:**
1. Perform each operation with a reason.
2. Verify each reason is recorded in the audit trail.
**Expected Result:** All three operations have their reasons recorded — reason recording is enforced for every bulk operation.
**Priority:** High

### TC-SA-03-07-020 — Per-item result reporting shows succeeded/failed/skipped with reasons
**Type:** Positive
**Covers:** 7.3 → Per-item result reporting (succeeded/failed/skipped with reasons)
**Preconditions:** A bulk operation completes with 90 succeeded, 5 failed, and 5 skipped.
**Steps:**
1. Open the per-item result report.
2. Verify the 90 succeeded, 5 failed, and 5 skipped with their reasons.
**Expected Result:** The report shows all three outcomes (succeeded/failed/skipped) with the specific reason per item.
**Priority:** High

### TC-SA-03-07-021 — Per-item blockers are respected: legal holds, eligibility, and constraints are enforced per item
**Type:** Negative
**Covers:** 7.3 → Blocker respect: legal holds, eligibility, and constraints are enforced per item; Rule: per-item blockers are respected: a legal hold or eligibility failure is a reported skip/failure, not a silent omission
**Preconditions:** A bulk operation on 100 items; 3 have legal holds, 2 fail eligibility, 1 violates a constraint.
**Steps:**
1. Commit the operation.
2. Verify the 3 legal-hold items, 2 eligibility failures, and 1 constraint violation are all reported.
**Expected Result:** All 6 blocked items are reported with their specific reasons — no silent omissions.
**Priority:** Critical

### TC-SA-03-07-022 — Unusually large operations trigger extra confirmation (a threshold defined by the platform)
**Type:** Positive
**Covers:** 7.3 → Operation size guardrails: unusually large operations prompt extra confirmation; Rule: unusually large operations trigger extra confirmation (a threshold defined by the platform)
**Preconditions:** A bulk operation on 5,000 accounts (above the platform's size threshold).
**Steps:**
1. Initiate the bulk operation on 5,000 accounts.
2. Verify an extra confirmation prompt appears.
3. Confirm and commit.
**Expected Result:** The unusually large operation triggers an extra confirmation prompt before commit — the guardrail works.
**Priority:** High

### TC-SA-03-07-023 — Every bulk operation has a complete audit record; the result report is retained
**Type:** Positive
**Covers:** 7.3 → Complete audit record: set reference, action, reason, result counts, and the result report; Rule: every bulk operation has a complete audit record; the result report is retained
**Preconditions:** A bulk operation has completed.
**Steps:**
1. Open the audit record for the operation.
2. Verify the set reference, action, reason, result counts, and the retained result report.
**Expected Result:** The audit record is complete — set reference, action, reason, result counts, and the retained result report.
**Priority:** Critical

### TC-SA-03-07-024 — Where reversible, the reverse path is indicated
**Type:** Positive
**Covers:** 7.3 → Reversibility guidance: where reversible, the reverse path is indicated
**Preconditions:** A bulk suspension (reversible) has been performed.
**Steps:**
1. Open the operation's record.
2. Verify the reverse path (bulk activation) is indicated.
**Expected Result:** The reversible bulk suspension indicates the reverse path (bulk activation) — the operator knows how to undo it.
**Priority:** Medium

### TC-SA-03-07-025 — Irreversible bulk actions state the consequences explicitly in the confirmation
**Type:** Positive
**Covers:** 7.3 → Rule: irreversible bulk actions state the consequences explicitly in the confirmation
**Preconditions:** A bulk deactivation (irreversible without re-activation) is being confirmed.
**Steps:**
1. Review the confirmation for the bulk deactivation.
2. Verify the consequences are stated explicitly.
**Expected Result:** The confirmation states the consequences explicitly — the operator understands the action is irreversible without re-activation.
**Priority:** High

### TC-SA-03-07-026 — The bulk-operation log is reviewable, so mass changes are always explainable
**Type:** Positive
**Covers:** 7.3 → Rule: the bulk-operation log is reviewable, so mass changes are always explainable
**Preconditions:** Ten bulk operations have been performed over a month.
**Steps:**
1. Open the bulk-operation log.
2. Review each operation's set, action, reason, and result counts.
**Expected Result:** All ten bulk operations are reviewable in the log — every mass change is explainable with its set, action, reason, and results.
**Priority:** High
