# 6. Resource Lifecycle — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: resource_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 |
|---------|--------------------|----------|
| 6.1 Upload, Edit, and Delete Resources | Resource upload: the resource file uploaded to the library | TC-SA-09-06-001 |
| 6.1 Upload, Edit, and Delete Resources | Upload validation: the format and size checked on upload | TC-SA-09-06-002 |
| 6.1 Upload, Edit, and Delete Resources | Resource edit: the resource's content/metadata updated | TC-SA-09-06-003 |
| 6.1 Upload, Edit, and Delete Resources | Resource delete: the resource removed (with the dependency check) | TC-SA-09-06-004 |
| 6.1 Upload, Edit, and Delete Resources | Dependency check: the resource's references (the videos/topics it is assigned to) checked before delete | TC-SA-09-06-005 |
| 6.1 Upload, Edit, and Delete Resources | Resource list: the resources with their status and metadata | TC-SA-09-06-006 |
| 6.1 Upload, Edit, and Delete Resources | Audit logging of upload/edit/delete | TC-SA-09-06-007 |
| 6.1 Upload, Edit, and Delete Resources | Rule: the upload is validated (format, size); a failing file is rejected with the specific reason, not silently accepted | TC-SA-09-06-002 |
| 6.1 Upload, Edit, and Delete Resources | Rule: an edit preserves the resource's identity (the assignment is not lost); only the content/metadata changes | TC-SA-09-06-003 |
| 6.1 Upload, Edit, and Delete Resources | Rule: the delete is guarded by the dependency check; a resource with references is not deleted cleanly | TC-SA-09-06-004 |
| 6.1 Upload, Edit, and Delete Resources | Rule: a blocked delete is resolved (unassign first, or archive); the dependency is handled, not ignored | TC-SA-09-06-008 |
| 6.1 Upload, Edit, and Delete Resources | Rule: the resource list shows the status per resource; the library state is visible | TC-SA-09-06-006 |
| 6.1 Upload, Edit, and Delete Resources | Rule: upload/edit/delete is audit-logged with the resource, actor, and timestamp | TC-SA-09-06-007 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Resource assignment: a resource assigned to a video, topic, and subject | TC-SA-09-06-009 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Multi-level assignment: the resource placed at the video, topic, and subject level as appropriate | TC-SA-09-06-010 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Assignment validation: the target nodes exist and are active | TC-SA-09-06-011 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Coverage view: the resources per video/topic/subject, so gaps are visible | TC-SA-09-06-012 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Reassignment: moving a resource to the correct node where misplaced | TC-SA-09-06-013 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Unassignment: removing a resource from a node (with the impact reviewed) | TC-SA-09-06-014 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Audit logging of assignment changes | TC-SA-09-06-015 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Rule: a resource is assigned to videos, topics, and subjects; the assignment places it in the learning structure | TC-SA-09-06-009 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Rule: the target nodes must exist and be active; an invalid node cannot be assigned | TC-SA-09-06-011 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Rule: the coverage view shows resources per node; a gap (a topic with no resource) is visible, not silent | TC-SA-09-06-012 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Rule: a reassignment moves the resource to the correct node; the change is recorded | TC-SA-09-06-013 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Rule: an unassignment is reviewed for impact (learners who had the resource) before it is done | TC-SA-09-06-014 |
| 6.2 Assign Resources to Videos, Topics, and Subjects | Rule: assignment changes are audit-logged with the resource, nodes, and timestamp | TC-SA-09-06-015 |
| 6.3 Version Control for Resources | Version creation: a new version recorded when the resource changes significantly | TC-SA-09-06-016 |
| 6.3 Version Control for Resources | Version record: the version's content, the change, the actor, and the timestamp | TC-SA-09-06-017 |
| 6.3 Version Control for Resources | Version list: the versions of a resource in order | TC-SA-09-06-018 |
| 6.3 Version Control for Resources | Version comparison: reviewing what changed between versions | TC-SA-09-06-019 |
| 6.3 Version Control for Resources | Restore: reverting a resource to a prior version | TC-SA-09-06-020 |
| 6.3 Version Control for Resources | Current version: the learners always see the current (latest) version | TC-SA-09-06-021 |
| 6.3 Version Control for Resources | Audit logging of version create/restore | TC-SA-09-06-022 |
| 6.3 Version Control for Resources | Rule: a version is recorded on a significant change; the version captures the change, the actor, and the timestamp | TC-SA-09-06-016 |
| 6.3 Version Control for Resources | Rule: a restore reverts to a prior version but is itself recorded (the history is append-only, not destroyed) | TC-SA-09-06-020 |
| 6.3 Version Control for Resources | Rule: the learners always see the current (latest) version; a stale version is not shown | TC-SA-09-06-021 |
| 6.3 Version Control for Resources | Rule: version comparison shows what changed between versions; it supports a confident restore | TC-SA-09-06-019 |
| 6.3 Version Control for Resources | Rule: the retention is per the platform's policy; older versions are available for the retention period | TC-SA-09-06-023 |
| 6.3 Version Control for Resources | Rule: version create/restore is audit-logged with the resource, version, and timestamp | TC-SA-09-06-022 |

## 6.1 Upload, Edit, and Delete Resources

### TC-SA-09-06-001 — Resource upload: the resource file uploaded to the library
**Type:** Positive
**Covers:** 6.1 → Resource upload: the resource file uploaded to the library
**Preconditions:** A resource file is prepared (valid format and size).
**Steps:**
1. Upload the resource file to the library.
2. Verify the upload succeeds and the resource appears in the library.
**Expected Result:** The resource file is uploaded to the library.
**Priority:** Critical

### TC-SA-09-06-002 — Upload validation: the format and size checked on upload; a failing file is rejected with the specific reason, not silently accepted
**Type:** Negative
**Covers:** 6.1 → Upload validation: the format and size checked on upload; Rule: the upload is validated (format, size); a failing file is rejected with the specific reason, not silently accepted
**Preconditions:** A resource file has an invalid format (or exceeds the size limit).
**Steps:**
1. Attempt to upload the file with the invalid format (or oversized file).
2. Verify the upload is rejected with the specific reason (the format is not supported / the size exceeds the limit).
3. Verify the file is not silently accepted.
**Expected Result:** The upload is validated (format, size) — the failing file is rejected with the specific reason, not silently accepted.
**Priority:** Critical

### TC-SA-09-06-003 — Resource edit: the resource's content/metadata updated; an edit preserves the resource's identity (the assignment is not lost)
**Type:** Negative
**Covers:** 6.1 → Resource edit: the resource's content/metadata updated; Rule: an edit preserves the resource's identity (the assignment is not lost); only the content/metadata changes
**Preconditions:** A resource is uploaded and assigned to a video/topic.
**Steps:**
1. Edit the resource's content/metadata (update the title, description, or file).
2. Verify the edit is saved.
3. Verify the resource's identity is preserved (the assignment is not lost) — only the content/metadata changes.
**Expected Result:** The resource's content/metadata is updated — the edit preserves the resource's identity (the assignment is not lost).
**Priority:** Critical

### TC-SA-09-06-004 — Resource delete: the resource removed (with the dependency check); a resource with references is not deleted cleanly
**Type:** Negative
**Covers:** 6.1 → Resource delete: the resource removed (with the dependency check); Rule: the delete is guarded by the dependency check; a resource with references is not deleted cleanly
**Preconditions:** A resource is assigned to a video/topic (it has references).
**Steps:**
1. Attempt to delete the resource (which has references).
2. Verify the delete is blocked by the dependency check (the resource has references).
3. Verify the resource is not deleted cleanly.
**Expected Result:** The delete is guarded by the dependency check — the resource with references is not deleted cleanly.
**Priority:** Critical

### TC-SA-09-06-005 — Dependency check: the resource's references (the videos/topics it is assigned to) checked before delete
**Type:** Positive
**Covers:** 6.1 → Dependency check: the resource's references (the videos/topics it is assigned to) checked before delete
**Preconditions:** A resource is assigned to multiple videos/topics.
**Steps:**
1. Initiate the delete of the resource.
2. Verify the dependency check runs (the resource's references — the videos/topics it is assigned to — are checked).
3. Verify the references are listed before the delete proceeds (or is blocked).
**Expected Result:** The dependency check runs — the resource's references (the videos/topics it is assigned to) are checked before delete.
**Priority:** Critical

### TC-SA-09-06-006 — Resource list: the resources with their status and metadata; the library state is visible
**Type:** Positive
**Covers:** 6.1 → Resource list: the resources with their status and metadata; Rule: the resource list shows the status per resource; the library state is visible
**Preconditions:** Multiple resources exist in the library.
**Steps:**
1. Open the resource list.
2. Verify the resources are shown with their status and metadata.
3. Verify the library state is visible.
**Expected Result:** The resource list shows the status per resource — the library state is visible.
**Priority:** High

### TC-SA-09-06-007 — Upload/edit/delete is audit-logged with the resource, the actor, and the timestamp
**Type:** Positive
**Covers:** 6.1 → Audit logging of upload/edit/delete; Rule: upload/edit/delete is audit-logged with the resource, actor, and timestamp
**Preconditions:** Upload, edit, and delete events have occurred.
**Steps:**
1. Open the audit trail and filter by "resource lifecycle".
2. Verify entries for upload/edit/delete show the resource, the actor, and the timestamp.
**Expected Result:** The upload/edit/delete is audit-logged with the resource, actor, and timestamp.
**Priority:** Critical

### TC-SA-09-06-008 — A blocked delete is resolved (unassign first, or archive); the dependency is handled, not ignored
**Type:** Negative
**Covers:** 6.1 → Rule: a blocked delete is resolved (unassign first, or archive); the dependency is handled, not ignored
**Preconditions:** A resource delete is blocked (the resource has references).
**Steps:**
1. Resolve the blocked delete: unassign the resource from the videos/topics first (or archive it).
2. Verify the dependency is handled (not ignored).
3. Verify the delete now proceeds (or the resource is archived).
**Expected Result:** The blocked delete is resolved (unassign first, or archive) — the dependency is handled, not ignored.
**Priority:** Critical

## 6.2 Assign Resources to Videos, Topics, and Subjects

### TC-SA-09-06-009 — Resource assignment: a resource assigned to a video, topic, and subject; the assignment places it in the learning structure
**Type:** Positive
**Covers:** 6.2 → Resource assignment: a resource assigned to a video, topic, and subject; Rule: a resource is assigned to videos, topics, and subjects; the assignment places it in the learning structure
**Preconditions:** A resource exists in the library; a video/topic/subject exists.
**Steps:**
1. Assign the resource to the video, topic, and subject.
2. Verify the assignment is saved.
3. Verify the resource is placed in the learning structure.
**Expected Result:** The resource is assigned to the video, topic, and subject — the assignment places it in the learning structure.
**Priority:** Critical

### TC-SA-09-06-010 — Multi-level assignment: the resource placed at the video, topic, and subject level as appropriate
**Type:** Positive
**Covers:** 6.2 → Multi-level assignment: the resource placed at the video, topic, and subject level as appropriate
**Preconditions:** A resource exists; multiple levels (video, topic, subject) exist.
**Steps:**
1. Assign the resource at the video level (for a specific video).
2. Assign the resource at the topic level (for a specific topic).
3. Assign the resource at the subject level (for a specific subject).
4. Verify the resource is placed at the appropriate level.
**Expected Result:** The resource is placed at the video, topic, and subject level as appropriate.
**Priority:** High

### TC-SA-09-06-011 — Assignment validation: the target nodes exist and are active; an invalid node cannot be assigned
**Type:** Negative
**Covers:** 6.2 → Assignment validation: the target nodes exist and are active; Rule: the target nodes must exist and be active; an invalid node cannot be assigned
**Preconditions:** A resource exists; a target node is inactive (or does not exist).
**Steps:**
1. Attempt to assign the resource to the inactive (or non-existent) node.
2. Verify the assignment is rejected (the target node must exist and be active).
3. Verify the invalid node cannot be assigned.
**Expected Result:** The assignment is validated — the target nodes must exist and be active; the invalid node cannot be assigned.
**Priority:** Critical

### TC-SA-09-06-012 — Coverage view: the resources per video/topic/subject, so gaps are visible; a gap (a topic with no resource) is visible, not silent
**Type:** Negative
**Covers:** 6.2 → Coverage view: the resources per video/topic/subject, so gaps are visible; Rule: the coverage view shows resources per node; a gap (a topic with no resource) is visible, not silent
**Preconditions:** A topic has no resource assigned.
**Steps:**
1. Open the coverage view: the resources per video/topic/subject.
2. Verify the gap (the topic with no resource) is visible (flagged in the coverage view).
3. Verify it is not silent.
**Expected Result:** The coverage view shows resources per node — the gap (a topic with no resource) is visible, not silent.
**Priority:** High

### TC-SA-09-06-013 — Reassignment: moving a resource to the correct node where misplaced; the change is recorded
**Type:** Negative
**Covers:** 6.2 → Reassignment: moving a resource to the correct node where misplaced; Rule: a reassignment moves the resource to the correct node; the change is recorded
**Preconditions:** A resource is assigned to the wrong node (misplaced).
**Steps:**
1. Identify the misplaced resource.
2. Reassign it to the correct node.
3. Verify the change is recorded.
**Expected Result:** The reassignment moves the resource to the correct node — the change is recorded.
**Priority:** High

### TC-SA-09-06-014 — Unassignment: removing a resource from a node (with the impact reviewed); an unassignment is reviewed for impact (learners who had the resource) before it is done
**Type:** Negative
**Covers:** 6.2 → Unassignment: removing a resource from a node (with the impact reviewed); Rule: an unassignment is reviewed for impact (learners who had the resource) before it is done
**Preconditions:** A resource is assigned to a node; learners have accessed the resource.
**Steps:**
1. Initiate the unassignment of the resource from the node.
2. Verify the impact is reviewed (the learners who had the resource are identified).
3. Verify the unassignment proceeds only after the impact review.
**Expected Result:** The unassignment is reviewed for impact (learners who had the resource) before it is done.
**Priority:** Critical

### TC-SA-09-06-015 — Assignment changes are audit-logged with the resource, the nodes, and the timestamp
**Type:** Positive
**Covers:** 6.2 → Audit logging of assignment changes; Rule: assignment changes are audit-logged with the resource, nodes, and timestamp
**Preconditions:** Assignment changes (assign, reassign, unassign) have occurred.
**Steps:**
1. Open the audit trail and filter by "resource assignment".
2. Verify entries show the resource, the nodes, and the timestamp.
**Expected Result:** The assignment changes are audit-logged with the resource, nodes, and timestamp.
**Priority:** Critical

## 6.3 Version Control for Resources

### TC-SA-09-06-016 — Version creation: a new version recorded when the resource changes significantly; the version captures the change, the actor, and the timestamp
**Type:** Positive
**Covers:** 6.3 → Version creation: a new version recorded when the resource changes significantly; Rule: a version is recorded on a significant change; the version captures the change, the actor, and the timestamp
**Preconditions:** A resource exists; a significant change is made to the resource.
**Steps:**
1. Make a significant change to the resource.
2. Verify a new version is recorded.
3. Verify the version captures the change, the actor, and the timestamp.
**Expected Result:** A new version is recorded on the significant change — the version captures the change, the actor, and the timestamp.
**Priority:** Critical

### TC-SA-09-06-017 — Version record: the version's content, the change, the actor, and the timestamp
**Type:** Positive
**Covers:** 6.3 → Version record: the version's content, the change, the actor, and the timestamp
**Preconditions:** A resource has multiple versions.
**Steps:**
1. Open a version record.
2. Verify it shows the version's content, the change, the actor, and the timestamp.
**Expected Result:** The version record shows the version's content, the change, the actor, and the timestamp.
**Priority:** High

### TC-SA-09-06-018 — Version list: the versions of a resource in order
**Type:** Positive
**Covers:** 6.3 → Version list: the versions of a resource in order
**Preconditions:** A resource has multiple versions.
**Steps:**
1. Open the version list for the resource.
2. Verify the versions are shown in order (chronological).
**Expected Result:** The version list shows the versions of the resource in order.
**Priority:** High

### TC-SA-09-06-019 — Version comparison: reviewing what changed between versions; it supports a confident restore
**Type:** Positive
**Covers:** 6.3 → Version comparison: reviewing what changed between versions; Rule: version comparison shows what changed between versions; it supports a confident restore
**Preconditions:** A resource has multiple versions.
**Steps:**
1. Compare two versions of the resource.
2. Verify the comparison shows what changed between the versions.
3. Verify the comparison supports a confident restore.
**Expected Result:** The version comparison shows what changed between versions — it supports a confident restore.
**Priority:** High

### TC-SA-09-06-020 — Restore: reverting a resource to a prior version; a restore reverts to a prior version but is itself recorded (the history is append-only, not destroyed)
**Type:** Negative
**Covers:** 6.3 → Restore: reverting a resource to a prior version; Rule: a restore reverts to a prior version but is itself recorded (the history is append-only, not destroyed)
**Preconditions:** A resource has multiple versions; a prior version is to be restored.
**Steps:**
1. Restore the resource to a prior version.
2. Verify the restore is itself recorded (the history is append-only, not destroyed).
3. Verify the current version is now the restored version.
**Expected Result:** The restore reverts to a prior version — it is itself recorded (the history is append-only, not destroyed).
**Priority:** Critical

### TC-SA-09-06-021 — Current version: the learners always see the current (latest) version; a stale version is not shown
**Type:** Negative
**Covers:** 6.3 → Current version: the learners always see the current (latest) version; Rule: the learners always see the current (latest) version; a stale version is not shown
**Preconditions:** A resource has multiple versions; a new version is created.
**Steps:**
1. Create a new version of the resource.
2. As a learner, view the resource.
3. Verify the learner sees the current (latest) version (a stale version is not shown).
**Expected Result:** The learners always see the current (latest) version — a stale version is not shown.
**Priority:** Critical

### TC-SA-09-06-022 — Version create/restore is audit-logged with the resource, the version, and the timestamp
**Type:** Positive
**Covers:** 6.3 → Audit logging of version create/restore; Rule: version create/restore is audit-logged with the resource, version, and timestamp
**Preconditions:** Version create/restore events have occurred.
**Steps:**
1. Open the audit trail and filter by "resource version".
2. Verify entries for create/restore show the resource, the version, and the timestamp.
**Expected Result:** The version create/restore is audit-logged with the resource, version, and timestamp.
**Priority:** Critical

### TC-SA-09-06-023 — The retention is per the platform's policy; older versions are available for the retention period
**Type:** Edge
**Covers:** 6.3 → Rule: the retention is per the platform's policy; older versions are available for the retention period
**Preconditions:** A resource has versions older than the retention period.
**Steps:**
1. Verify the retention is per the platform's policy.
2. Verify older versions are available for the retention period.
3. Verify versions older than the retention period are no longer available (per the policy).
**Expected Result:** The retention is per the platform's policy — older versions are available for the retention period.
**Priority:** Medium
