# 5. Content Lifecycle — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: content_lifecycle.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 |
|---------|--------------------|----------|
| 5.1 Publish, Unpublish, and Archive Content | Content statuses: published (live), unpublished (offline), archived (retired) | TC-SA-07-05-001 |
| 5.1 Publish, Unpublish, and Archive Content | Publish: the content made available to learners (in its assigned context) | TC-SA-07-05-002 |
| 5.1 Publish, Unpublish, and Archive Content | Unpublish: the content taken offline (not available), without losing its data | TC-SA-07-05-003 |
| 5.1 Publish, Unpublish, and Archive Content | Archive: the content retired (no longer in active use), preserved for history | TC-SA-07-05-004 |
| 5.1 Publish, Unpublish, and Archive Content | Status transition: the moves between the statuses, with the impact reviewed | TC-SA-07-05-005 |
| 5.1 Publish, Unpublish, and Archive Content | Reversibility: an unpublished/archived content can be re-published | TC-SA-07-05-006 |
| 5.1 Publish, Unpublish, and Archive Content | Learner impact: learners with the content in their progress handled on unpublish/archive | TC-SA-07-05-007 |
| 5.1 Publish, Unpublish, and Archive Content | Audit logging of status transitions | TC-SA-07-05-008 |
| 5.1 Publish, Unpublish, and Archive Content | Rule: a published content item is live and available in its assigned context; an unpublished one is offline (data preserved) | TC-SA-07-05-003 |
| 5.1 Publish, Unpublish, and Archive Content | Rule: an archived content item is retired (not in active use) but preserved for history; it is not deleted | TC-SA-07-05-004 |
| 5.1 Publish, Unpublish, and Archive Content | Rule: transitions are reversible where sensible: unpublished → published, archived → published | TC-SA-07-05-006 |
| 5.1 Publish, Unpublish, and Archive Content | Rule: the learner impact is reviewed on unpublish/archive; learners' state is handled, not silently broken | TC-SA-07-05-007 |
| 5.1 Publish, Unpublish, and Archive Content | Rule: a status transition is a single, recorded event; there is no ambiguous intermediate state | TC-SA-07-05-009 |
| 5.1 Publish, Unpublish, and Archive Content | Rule: status transitions are audit-logged with the content, from/to status, and timestamp | TC-SA-07-05-008 |
| 5.2 Content Deletion | Content deletion: the permanent removal of a content item | TC-SA-07-05-010 |
| 5.2 Content Deletion | Dependency check: the content's references (courses, topics, learner progress) checked before delete | TC-SA-07-05-011 |
| 5.2 Content Deletion | Impact review: the learners affected by the deletion reviewed | TC-SA-07-05-012 |
| 5.2 Content Deletion | Deletion guard: deletion blocked where dependencies exist (with the reason) | TC-SA-07-05-013 |
| 5.2 Content Deletion | Irreversibility: a deletion is permanent (the content is not recoverable) | TC-SA-07-05-014 |
| 5.2 Content Deletion | Distinction from archive: delete removes; archive preserves | TC-SA-07-05-015 |
| 5.2 Content Deletion | Audit logging of deletion (the content, the actor, the timestamp) | TC-SA-07-05-016 |
| 5.2 Content Deletion | Rule: deletion is permanent and irreversible; the content is not recoverable once deleted | TC-SA-07-05-014 |
| 5.2 Content Deletion | Rule: the dependency check runs before delete and blocks it where references exist (with the specific reason) | TC-SA-07-05-013 |
| 5.2 Content Deletion | Rule: deletion is a last resort; archive is the default for retiring content (it preserves history) | TC-SA-07-05-015 |
| 5.2 Content Deletion | Rule: the impact (affected learners) is reviewed before a delete is confirmed | TC-SA-07-05-012 |
| 5.2 Content Deletion | Rule: a deletion is a single, recorded event; it is auditable | TC-SA-07-05-016 |
| 5.2 Content Deletion | Rule: deletion is audit-logged with the content, actor, and timestamp | TC-SA-07-05-016 |

## 5.1 Publish, Unpublish, and Archive Content

### TC-SA-07-05-001 — Content statuses: published (live), unpublished (offline), archived (retired)
**Type:** Positive
**Covers:** 5.1 → Content statuses: published (live), unpublished (offline), archived (retired)
**Preconditions:** Content items exist in each status.
**Steps:**
1. Verify the three content statuses exist: published (live), unpublished (offline), archived (retired).
2. Verify each content item has exactly one status at a time.
**Expected Result:** The content statuses (published, unpublished, archived) are available; each content item has exactly one status.
**Priority:** Critical

### TC-SA-07-05-002 — Publish: the content made available to learners (in its assigned context)
**Type:** Positive
**Covers:** 5.1 → Publish: the content made available to learners (in its assigned context)
**Preconditions:** A content item is ready (uploaded, organized, metadata set).
**Steps:**
1. Publish the content item.
2. Verify it becomes available to the learners in its assigned context.
**Expected Result:** The content is published — it is live and available to the learners in its assigned context.
**Priority:** Critical

### TC-SA-07-05-003 — Unpublish: the content taken offline (not available), without losing its data; data preserved
**Type:** Negative
**Covers:** 5.1 → Unpublish: the content taken offline (not available), without losing its data; Rule: a published content item is live and available in its assigned context; an unpublished one is offline (data preserved)
**Preconditions:** A published content item needs a correction but should not be seen in its current state.
**Steps:**
1. Unpublish the content item.
2. Verify it is taken offline (not available to learners).
3. Verify its data and placement are preserved (not lost).
**Expected Result:** The content is unpublished — it is offline (not available), but its data and placement are preserved.
**Priority:** Critical

### TC-SA-07-05-004 — Archive: the content retired (no longer in active use), preserved for history; it is not deleted
**Type:** Positive
**Covers:** 5.1 → Archive: the content retired (no longer in active use), preserved for history; Rule: an archived content item is retired (not in active use) but preserved for history; it is not deleted
**Preconditions:** A content item is retired (a topic no longer taught).
**Steps:**
1. Archive the content item.
2. Verify it is no longer in active use.
3. Verify it is preserved for history (not deleted).
**Expected Result:** The content is archived — it is retired (not in active use) but preserved for history; it is not deleted.
**Priority:** Critical

### TC-SA-07-05-005 — Status transition: the moves between the statuses, with the impact reviewed
**Type:** Positive
**Covers:** 5.1 → Status transition: the moves between the statuses, with the impact reviewed
**Preconditions:** A content item is published; it needs to move through statuses.
**Steps:**
1. Transition the content published → unpublished.
2. Transition the content unpublished → archived.
3. Verify each transition is valid and the impact is reviewed.
**Expected Result:** The status transitions work — the moves between the statuses are valid, with the impact reviewed.
**Priority:** Critical

### TC-SA-07-05-006 — Reversibility: an unpublished/archived content can be re-published
**Type:** Edge
**Covers:** 5.1 → Reversibility: an unpublished/archived content can be re-published; Rule: transitions are reversible where sensible: unpublished → published, archived → published
**Preconditions:** Content A is unpublished (a correction is made); Content B is archived (a topic is revived).
**Steps:**
1. Re-publish Content A (unpublished → published) and verify it is available again.
2. Re-publish Content B (archived → published) and verify the archive is reversible.
**Expected Result:** The transitions are reversible where sensible — unpublished → published and archived → published both work.
**Priority:** High

### TC-SA-07-05-007 — Learner impact: learners with the content in their progress handled on unpublish/archive; learners' state is handled, not silently broken
**Type:** Negative
**Covers:** 5.1 → Learner impact: learners with the content in their progress handled on unpublish/archive; Rule: the learner impact is reviewed on unpublish/archive; learners' state is handled, not silently broken
**Preconditions:** Learners have the content in their progress; the content is unpublished/archived.
**Steps:**
1. Unpublish the content and verify the learner impact is reviewed.
2. Verify learners' state is handled (the content is unavailable to them until re-published).
3. Re-publish the content and verify the learners' access is restored.
**Expected Result:** The learner impact is reviewed on unpublish/archive — learners' state is handled, not silently broken.
**Priority:** Critical

### TC-SA-07-05-008 — Status transitions are audit-logged with the content, from/to status, and timestamp
**Type:** Positive
**Covers:** 5.1 → Audit logging of status transitions; Rule: status transitions are audit-logged with the content, from/to status, and timestamp
**Preconditions:** Content items have undergone status transitions.
**Steps:**
1. Open the audit trail and filter by "content status".
2. Verify entries for each transition show the content, the from/to status, and the timestamp.
**Expected Result:** Each status transition is audit-logged with the content, from/to status, and timestamp.
**Priority:** Critical

### TC-SA-07-05-009 — A status transition is a single, recorded event; there is no ambiguous intermediate state
**Type:** Edge
**Covers:** 5.1 → Rule: a status transition is a single, recorded event; there is no ambiguous intermediate state
**Preconditions:** A content item is transitioning from published to unpublished.
**Steps:**
1. Run the unpublish action.
2. Verify the transition is a single, recorded event (no ambiguous intermediate state).
3. Verify the content's status is unambiguously "unpublished" after the transition.
**Expected Result:** The status transition is a single, recorded event — there is no ambiguous intermediate state.
**Priority:** High

## 5.2 Content Deletion

### TC-SA-07-05-010 — Content deletion: the permanent removal of a content item
**Type:** Positive
**Covers:** 5.2 → Content deletion: the permanent removal of a content item
**Preconditions:** A content item with no dependencies (an orphaned duplicate) is to be removed.
**Steps:**
1. Initiate the deletion of the content item.
2. Verify the dependency check passes (no dependencies).
3. Confirm the deletion and verify the content is removed permanently.
**Expected Result:** The content is deleted permanently — it is removed from the catalog.
**Priority:** Critical

### TC-SA-07-05-011 — Dependency check: the content's references (courses, topics, learner progress) checked before delete
**Type:** Positive
**Covers:** 5.2 → Dependency check: the content's references (courses, topics, learner progress) checked before delete
**Preconditions:** A content item is to be deleted; it has references (assigned to courses/topics, learner progress).
**Steps:**
1. Initiate the deletion of the content item.
2. Verify the platform runs the dependency check: the content's references (the courses/topics it is assigned to, any learner progress on it).
**Expected Result:** The dependency check runs before delete — the content's references (courses, topics, learner progress) are checked.
**Priority:** Critical

### TC-SA-07-05-012 — Impact review: the learners affected by the deletion reviewed; the impact is reviewed before a delete is confirmed
**Type:** Positive
**Covers:** 5.2 → Impact review: the learners affected by the deletion reviewed; Rule: the impact (affected learners) is reviewed before a delete is confirmed
**Preconditions:** A content item with no dependencies is to be deleted.
**Steps:**
1. Initiate the deletion.
2. Verify the impact (affected learners) is reviewed before the delete is confirmed.
3. Confirm the deletion.
**Expected Result:** The impact (affected learners) is reviewed before a delete is confirmed.
**Priority:** High

### TC-SA-07-05-013 — Deletion guard: deletion blocked where dependencies exist (with the reason); the dependency check blocks it where references exist (with the specific reason)
**Type:** Negative
**Covers:** 5.2 → Deletion guard: deletion blocked where dependencies exist (with the reason); Rule: the dependency check runs before delete and blocks it where references exist (with the specific reason)
**Preconditions:** A content item has dependencies (learners have progress, or it is assigned to a live course).
**Steps:**
1. Initiate the deletion of the content item.
2. Verify the deletion is blocked with the specific reason (dependencies exist).
3. Verify Super Admin must archive instead, or resolve the dependencies first.
**Expected Result:** The deletion is blocked where dependencies exist — with the specific reason.
**Priority:** Critical

### TC-SA-07-05-014 — Irreversibility: a deletion is permanent (the content is not recoverable)
**Type:** Edge
**Covers:** 5.2 → Irreversibility: a deletion is permanent (the content is not recoverable); Rule: deletion is permanent and irreversible; the content is not recoverable once deleted
**Preconditions:** A content item with no dependencies is deleted.
**Steps:**
1. Delete the content item.
2. Verify the content is removed from the catalog.
3. Verify the content is not recoverable (the deletion is permanent).
**Expected Result:** The deletion is permanent and irreversible — the content is not recoverable once deleted.
**Priority:** Critical

### TC-SA-07-05-015 — Distinction from archive: delete removes; archive preserves; deletion is a last resort, archive is the default for retiring content
**Type:** Negative
**Covers:** 5.2 → Distinction from archive: delete removes; archive preserves; Rule: deletion is a last resort; archive is the default for retiring content (it preserves history)
**Preconditions:** A content item should be kept for history (retired but not removed).
**Steps:**
1. Archive the content item instead of deleting it.
2. Verify the archive preserves it (it is kept for history).
3. Verify the distinction: delete removes, archive preserves.
**Expected Result:** The distinction holds — delete removes, archive preserves; archive is the default for retiring content.
**Priority:** High

### TC-SA-07-05-016 — Deletion is audit-logged with the content, actor, and timestamp; a deletion is a single, recorded event; it is auditable
**Type:** Positive
**Covers:** 5.2 → Audit logging of deletion (the content, the actor, the timestamp); Rule: a deletion is a single, recorded event; it is auditable; Rule: deletion is audit-logged with the content, actor, and timestamp
**Preconditions:** A content item has been deleted.
**Steps:**
1. Open the audit trail and filter by "deletion".
2. Verify the entry shows the content, the actor, and the timestamp.
3. Verify the deletion is a single, recorded event (auditable).
**Expected Result:** The deletion is audit-logged with the content, actor, and timestamp — it is a single, recorded event.
**Priority:** Critical
