# 2. SIS Sync — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: sis_sync.md — every feature, sub-feature, and rule covered

## Test Execution Policy

- Zero tolerance: any deviation from the documented behavior is a defect.
- Every failed test is logged with a Bug ID, the feature, the sub-feature, the expected vs actual result, and the severity; 100% of bugs are fixed before the group passes.
- 100% pass rate is required for the group to be marked complete.

## Coverage Matrix

| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 2.1 Automatic Enrollment | Enrollment trigger (new record, batch, manual) | TC-SA-INT-10-001 |
| 2.1 Automatic Enrollment | Enrollment scope (institutions, grade bands, programs) | TC-SA-INT-10-002 |
| 2.1 Automatic Enrollment | Plan/course mapping rules | TC-SA-INT-10-003 |
| 2.1 Automatic Enrollment | Confirmation and notification | TC-SA-INT-10-004 |
| 2.1 Automatic Enrollment | Rule: no matching mapping → default plan or held | TC-SA-INT-10-005 |
| 2.1 Automatic Enrollment | Rule: no duplicate enrollment | TC-SA-INT-10-006 |
| 2.1 Automatic Enrollment | Rule: failure logged and retried | TC-SA-INT-10-007 |
| 2.1 Automatic Enrollment | Rule: deactivated SIS record deactivates enrollment | TC-SA-INT-10-008 |
| 2.1 Automatic Enrollment | Audit logging of automatic enrollment | TC-SA-INT-10-009 |
| 2.2 Demographic Data Import | Demographic fields imported | TC-SA-INT-11-001 |
| 2.2 Demographic Data Import | Field mapping (SIS to platform) | TC-SA-INT-11-002 |
| 2.2 Demographic Data Import | Import scope (students, parents, guardians) | TC-SA-INT-11-003 |
| 2.2 Demographic Data Import | Import log (imported, updated, skipped) | TC-SA-INT-11-004 |
| 2.2 Demographic Data Import | Rule: missing required field → skipped and flagged | TC-SA-INT-11-005 |
| 2.2 Demographic Data Import | Rule: mapping conflict rejected | TC-SA-INT-11-006 |
| 2.2 Demographic Data Import | Rule: failure leaves existing data intact | TC-SA-INT-11-007 |
| 2.2 Demographic Data Import | Rule: changed demographic updates, not duplicates | TC-SA-INT-11-008 |
| 2.2 Demographic Data Import | Audit logging of demographic data import | TC-SA-INT-11-009 |
| 2.3 Schedule Integration | Schedule scope (periods, timetables, exam schedules) | TC-SA-INT-12-001 |
| 2.3 Schedule Integration | Schedule mapping (SIS period to platform slot) | TC-SA-INT-12-002 |
| 2.3 Schedule Integration | Sync frequency | TC-SA-INT-12-003 |
| 2.3 Schedule Integration | Conflict detection (overlapping periods) | TC-SA-INT-12-004 |
| 2.3 Schedule Integration | Rule: overlap flagged, not merged | TC-SA-INT-12-005 |
| 2.3 Schedule Integration | Rule: change updates and notifies | TC-SA-INT-12-006 |
| 2.3 Schedule Integration | Rule: failure leaves last good schedule | TC-SA-INT-12-007 |
| 2.3 Schedule Integration | Rule: unmapped period skipped and flagged | TC-SA-INT-12-008 |
| 2.3 Schedule Integration | Audit logging of schedule integration | TC-SA-INT-12-009 |
| 2.4 Report Card Integration | Direction (SIS → platform, platform → SIS, both) | TC-SA-INT-13-001 |
| 2.4 Report Card Integration | Report card fields (grades, comments, attendance, GPA) | TC-SA-INT-13-002 |
| 2.4 Report Card Integration | Term/period mapping | TC-SA-INT-13-003 |
| 2.4 Report Card Integration | Sync log | TC-SA-INT-13-004 |
| 2.4 Report Card Integration | Rule: unmapped term not synced, flagged | TC-SA-INT-13-005 |
| 2.4 Report Card Integration | Rule: grade conflict resolved by source of truth | TC-SA-INT-13-006 |
| 2.4 Report Card Integration | Rule: failure logged and retried | TC-SA-INT-13-007 |
| 2.4 Report Card Integration | Rule: finalized card not overwritten without re-open | TC-SA-INT-13-008 |
| 2.4 Report Card Integration | Audit logging of report card integration | TC-SA-INT-13-009 |
| 2.5 Sync Frequency, Field Mapping & Conflict Resolution | Global sync frequency | TC-SA-INT-14-001 |
| 2.5 Sync Frequency, Field Mapping & Conflict Resolution | Central field mapping registry | TC-SA-INT-14-002 |
| 2.5 Sync Frequency, Field Mapping & Conflict Resolution | Conflict resolution policy | TC-SA-INT-14-003 |
| 2.5 Sync Frequency, Field Mapping & Conflict Resolution | Sync health summary | TC-SA-INT-14-004 |
| 2.5 Sync Frequency, Field Mapping & Conflict Resolution | Rule: manual review queued, not auto-resolved | TC-SA-INT-14-005 |
| 2.5 Sync Frequency, Field Mapping & Conflict Resolution | Rule: mapping change effective next run | TC-SA-INT-14-006 |
| 2.5 Sync Frequency, Field Mapping & Conflict Resolution | Rule: real-time requires SIS push support | TC-SA-INT-14-007 |
| 2.5 Sync Frequency, Field Mapping & Conflict Resolution | Rule: repeated failure raises alert | TC-SA-INT-14-008 |
| 2.5 Sync Frequency, Field Mapping & Conflict Resolution | Audit logging of sync settings | TC-SA-INT-14-009 |

## 2.1 Automatic Enrollment

### TC-SA-INT-10-001 — Enrollment trigger (new record, batch, manual)
**Type:** Positive
**Covers:** 2.1 → Enrollment trigger
**Preconditions:** A Super Admin account is active; the SIS is connected.
**Steps:**
1. As a Super Admin, open Integrations & APIs → SIS Sync → Automatic Enrollment and set the enrollment trigger (new SIS record, scheduled batch, manual).
2. Create a new SIS record and verify the student is auto-enrolled.
**Expected Result:** Enrollment trigger — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-10-002 — Enrollment scope (institutions, grade bands, programs)
**Type:** Positive
**Covers:** 2.1 → Enrollment scope
**Preconditions:** Automatic enrollment is configured.
**Steps:**
1. Set the enrollment scope to specific institutions/grade bands/programs.
2. Create SIS records in and out of scope and verify only in-scope students are enrolled.
**Expected Result:** Enrollment scope — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-10-003 — Plan/course mapping rules
**Type:** Positive
**Covers:** 2.1 → Plan/course mapping
**Preconditions:** Automatic enrollment is configured.
**Steps:**
1. Define the plan/course mapping rules.
2. Enroll a student and verify they are placed in the mapped plan/course.
**Expected Result:** Plan/course mapping rules — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-10-004 — Confirmation and notification
**Type:** Positive
**Covers:** 2.1 → Confirmation and notification
**Preconditions:** Automatic enrollment is configured.
**Steps:**
1. Enable the enrollment confirmation and notification.
2. Enroll a student and verify the confirmation and notification are sent.
**Expected Result:** Enrollment confirmation and notification — delivered exactly as documented.
**Priority:** Medium

### TC-SA-INT-10-005 — Rule: no matching mapping → default plan or held
**Type:** Negative
**Covers:** 2.1 → Rule: no mapping
**Preconditions:** A student has no matching plan mapping.
**Steps:**
1. Trigger the enrollment for the student.
2. Verify the student is enrolled into the default plan or held (per configuration).
**Expected Result:** A student with no matching plan mapping is enrolled into the default plan or held — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-10-006 — Rule: no duplicate enrollment
**Type:** Negative
**Covers:** 2.1 → Rule: deduplication
**Preconditions:** A student is already enrolled in a plan.
**Steps:**
1. Trigger the enrollment again for the same student and plan.
2. Verify no duplicate enrollment is created.
**Expected Result:** A duplicate enrollment (same student, same plan) is not created twice — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-10-007 — Rule: failure logged and retried
**Type:** Negative
**Covers:** 2.1 → Rule: retry
**Preconditions:** The enrollment process encounters a failure.
**Steps:**
1. Trigger an enrollment that fails.
2. Verify the failure is logged and retried per the retry policy.
**Expected Result:** An enrollment failure is logged and retried per the retry policy — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-10-008 — Rule: deactivated SIS record deactivates enrollment
**Type:** Negative
**Covers:** 2.1 → Rule: deactivation
**Preconditions:** A student's SIS record is deactivated.
**Steps:**
1. Sync the deactivated record.
2. Verify the platform enrollment is deactivated.
**Expected Result:** A deactivated SIS record deactivates the platform enrollment — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-10-009 — Audit logging of automatic enrollment
**Type:** Positive
**Covers:** 2.1 → Audit logging
**Preconditions:** Automatic enrollment configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by automatic enrollment.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of automatic enrollment — delivered exactly as documented.
**Priority:** Critical

## 2.2 Demographic Data Import

### TC-SA-INT-11-001 — Demographic fields imported
**Type:** Positive
**Covers:** 2.2 → Fields imported
**Preconditions:** A Super Admin is configuring demographic import.
**Steps:**
1. Set the demographic fields imported (name, DOB, grade, contact, address).
2. Run an import and verify the configured fields are imported.
**Expected Result:** Demographic fields imported — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-11-002 — Field mapping (SIS to platform)
**Type:** Positive
**Covers:** 2.2 → Field mapping
**Preconditions:** Demographic import is configured.
**Steps:**
1. Map the SIS fields to platform fields.
2. Run an import and verify values land in the mapped platform fields.
**Expected Result:** Field mapping — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-11-003 — Import scope (students, parents, guardians)
**Type:** Positive
**Covers:** 2.2 → Import scope
**Preconditions:** Demographic import is configured.
**Steps:**
1. Set the import scope to students, parents, and guardians.
2. Run an import and verify each scope is imported.
**Expected Result:** Import scope — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-11-004 — Import log (imported, updated, skipped)
**Type:** Positive
**Covers:** 2.2 → Import log
**Preconditions:** Demographic imports have run.
**Steps:**
1. Open the import log.
2. Verify it shows records imported, updated, and skipped.
**Expected Result:** Import log — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-11-005 — Rule: missing required field → skipped and flagged
**Type:** Negative
**Covers:** 2.2 → Rule: missing field
**Preconditions:** A record is missing a required field.
**Steps:**
1. Run the import.
2. Verify the record is skipped and flagged.
**Expected Result:** A record with a missing required field is skipped and flagged — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-11-006 — Rule: mapping conflict rejected
**Type:** Negative
**Covers:** 2.2 → Rule: mapping conflict
**Preconditions:** Two SIS fields are mapped to one platform field.
**Steps:**
1. Save the field mapping.
2. Verify the conflict is rejected.
**Expected Result:** A field mapping conflict (two SIS fields to one platform field) is rejected — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-11-007 — Rule: failure leaves existing data intact
**Type:** Negative
**Covers:** 2.2 → Rule: failure safety
**Preconditions:** The import encounters a failure mid-run.
**Steps:**
1. Run an import that fails.
2. Verify existing data is intact and the failure is logged.
**Expected Result:** An import failure leaves existing data intact and is logged — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-11-008 — Rule: changed demographic updates, not duplicates
**Type:** Negative
**Covers:** 2.2 → Rule: update vs duplicate
**Preconditions:** A student's demographic changes in the SIS.
**Steps:**
1. Run the import.
2. Verify the existing record is updated (not a duplicate created).
**Expected Result:** A changed demographic updates the existing record (not a duplicate) — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-11-009 — Audit logging of demographic data import
**Type:** Positive
**Covers:** 2.2 → Audit logging
**Preconditions:** Demographic import configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by demographic data import.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of demographic data import — delivered exactly as documented.
**Priority:** Critical

## 2.3 Schedule Integration

### TC-SA-INT-12-001 — Schedule scope (periods, timetables, exam schedules)
**Type:** Positive
**Covers:** 2.3 → Schedule scope
**Preconditions:** A Super Admin is configuring schedule integration.
**Steps:**
1. Set the schedule scope (class periods, timetables, exam schedules).
2. Run a sync and verify the configured scope is integrated.
**Expected Result:** Schedule scope — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-12-002 — Schedule mapping (SIS period to platform slot)
**Type:** Positive
**Covers:** 2.3 → Schedule mapping
**Preconditions:** Schedule integration is configured.
**Steps:**
1. Map the SIS periods to platform slots.
2. Run a sync and verify periods appear in the mapped slots.
**Expected Result:** Schedule mapping — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-12-003 — Sync frequency
**Type:** Positive
**Covers:** 2.3 → Sync frequency
**Preconditions:** Schedule integration is configured.
**Steps:**
1. Set the schedule sync frequency.
2. Verify schedule syncs run per the frequency.
**Expected Result:** Schedule sync frequency — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-12-004 — Conflict detection (overlapping periods)
**Type:** Positive
**Covers:** 2.3 → Conflict detection
**Preconditions:** Schedule integration is configured.
**Steps:**
1. Sync a schedule containing overlapping periods.
2. Verify the overlaps are detected and reported.
**Expected Result:** Conflict detection — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-12-005 — Rule: overlap flagged, not merged
**Type:** Negative
**Covers:** 2.3 → Rule: overlap handling
**Preconditions:** Two periods overlap in the SIS.
**Steps:**
1. Run the schedule sync.
2. Verify the overlap is flagged as a conflict, not silently merged.
**Expected Result:** An overlapping period is flagged as a conflict, not silently merged — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-12-006 — Rule: change updates and notifies
**Type:** Negative
**Covers:** 2.3 → Rule: change propagation
**Preconditions:** A period changes in the SIS.
**Steps:**
1. Run the schedule sync.
2. Verify the platform schedule is updated and affected users are notified.
**Expected Result:** A schedule change updates the platform schedule and notifies affected users — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-12-007 — Rule: failure leaves last good schedule
**Type:** Negative
**Covers:** 2.3 → Rule: failure safety
**Preconditions:** The schedule sync fails.
**Steps:**
1. Run a sync that fails.
2. Verify the last good schedule is intact.
**Expected Result:** A sync failure leaves the last good schedule intact — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-12-008 — Rule: unmapped period skipped and flagged
**Type:** Negative
**Covers:** 2.3 → Rule: unmapped period
**Preconditions:** A period has no platform mapping.
**Steps:**
1. Run the schedule sync.
2. Verify the period is skipped and flagged.
**Expected Result:** A period with no platform mapping is skipped and flagged — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-12-009 — Audit logging of schedule integration
**Type:** Positive
**Covers:** 2.3 → Audit logging
**Preconditions:** Schedule integration configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by schedule integration.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of schedule integration — delivered exactly as documented.
**Priority:** Critical

## 2.4 Report Card Integration

### TC-SA-INT-13-001 — Direction (SIS → platform, platform → SIS, both)
**Type:** Positive
**Covers:** 2.4 → Direction
**Preconditions:** A Super Admin is configuring report card integration.
**Steps:**
1. Set the report card direction to SIS → platform and verify report cards flow one way.
2. Set it to both and verify report cards flow both ways.
**Expected Result:** Report card direction — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-13-002 — Report card fields (grades, comments, attendance, GPA)
**Type:** Positive
**Covers:** 2.4 → Fields
**Preconditions:** Report card integration is configured.
**Steps:**
1. Set the report card fields (grades, comments, attendance, GPA).
2. Sync a report card and verify the configured fields are transferred.
**Expected Result:** Report card fields — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-13-003 — Term/period mapping
**Type:** Positive
**Covers:** 2.4 → Term/period mapping
**Preconditions:** Report card integration is configured.
**Steps:**
1. Map the terms/periods between the SIS and platform.
2. Sync a report card and verify it lands in the mapped term.
**Expected Result:** Term/period mapping — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-13-004 — Sync log
**Type:** Positive
**Covers:** 2.4 → Sync log
**Preconditions:** Report card syncs have run.
**Steps:**
1. Open the report card sync log.
2. Verify entries show the sync, the records, and the result.
**Expected Result:** Report card sync log — delivered exactly as documented.
**Priority:** Medium

### TC-SA-INT-13-005 — Rule: unmapped term not synced, flagged
**Type:** Negative
**Covers:** 2.4 → Rule: unmapped term
**Preconditions:** A report card belongs to an unmapped term.
**Steps:**
1. Run the report card sync.
2. Verify the report card is not synced and is flagged.
**Expected Result:** A report card for an unmapped term is not synced and is flagged — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-13-006 — Rule: grade conflict resolved by source of truth
**Type:** Negative
**Covers:** 2.4 → Rule: grade conflict
**Preconditions:** The platform and SIS have different grades for the same student/term.
**Steps:**
1. Run the report card sync.
2. Verify the conflict is resolved by the configured source of truth.
**Expected Result:** A grade conflict is resolved by the configured source of truth — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-13-007 — Rule: failure logged and retried
**Type:** Negative
**Covers:** 2.4 → Rule: retry
**Preconditions:** The report card sync fails.
**Steps:**
1. Run a sync that fails.
2. Verify the failure is logged and retried.
**Expected Result:** A report card sync failure is logged and retried — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-13-008 — Rule: finalized card not overwritten without re-open
**Type:** Negative
**Covers:** 2.4 → Rule: finalization
**Preconditions:** A report card is finalized.
**Steps:**
1. Run a sync that would update the finalized card.
2. Verify the card is not overwritten without an explicit re-open.
**Expected Result:** A finalized report card is not overwritten without an explicit re-open — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-13-009 — Audit logging of report card integration
**Type:** Positive
**Covers:** 2.4 → Audit logging
**Preconditions:** Report card integration configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by report card integration.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of report card integration — delivered exactly as documented.
**Priority:** Critical

## 2.5 Sync Frequency, Field Mapping & Conflict Resolution

### TC-SA-INT-14-001 — Global sync frequency
**Type:** Positive
**Covers:** 2.5 → Global sync frequency
**Preconditions:** A Super Admin is configuring SIS sync settings.
**Steps:**
1. Set the global sync frequency (real-time, hourly, daily, manual).
2. Verify syncs run per the frequency.
**Expected Result:** Global sync frequency — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-14-002 — Central field mapping registry
**Type:** Positive
**Covers:** 2.5 → Field mapping registry
**Preconditions:** SIS sync settings are being configured.
**Steps:**
1. Review and edit the central field mapping registry (SIS to platform).
2. Verify the registry is applied across sync operations.
**Expected Result:** Central field mapping registry — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-14-003 — Conflict resolution policy
**Type:** Positive
**Covers:** 2.5 → Conflict resolution policy
**Preconditions:** SIS sync settings are being configured.
**Steps:**
1. Set the conflict resolution policy (SIS wins, platform wins, manual review).
2. Create a conflict and verify it is resolved per the policy.
**Expected Result:** Conflict resolution policy — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-14-004 — Sync health summary
**Type:** Positive
**Covers:** 2.5 → Sync health summary
**Preconditions:** SIS syncs have run.
**Steps:**
1. Open the sync health summary.
2. Verify it shows the last run and success/failure counts.
**Expected Result:** Sync health summary — delivered exactly as documented.
**Priority:** Medium

### TC-SA-INT-14-005 — Rule: manual review queued, not auto-resolved
**Type:** Negative
**Covers:** 2.5 → Rule: manual review
**Preconditions:** The conflict policy is manual review; a conflict occurs.
**Steps:**
1. Run the sync with the conflict.
2. Verify the conflict is queued for review, not auto-resolved.
**Expected Result:** A conflict with policy "manual review" is queued for review, not auto-resolved — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-14-006 — Rule: mapping change effective next run
**Type:** Edge
**Covers:** 2.5 → Rule: mapping timing
**Preconditions:** A field mapping is changed mid-cycle.
**Steps:**
1. Change a field mapping.
2. Verify the change takes effect on the next sync run (not mid-run).
**Expected Result:** A field mapping change takes effect on the next sync run — delivered exactly as documented.
**Priority:** Medium

### TC-SA-INT-14-007 — Rule: real-time requires SIS push support
**Type:** Negative
**Covers:** 2.5 → Rule: real-time requirement
**Preconditions:** The SIS does not support push events.
**Steps:**
1. Attempt to set the sync frequency to real-time.
2. Verify it is rejected (real-time requires SIS push support).
**Expected Result:** A sync frequency of real-time requires the SIS to support push events — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-14-008 — Rule: repeated failure raises alert
**Type:** Negative
**Covers:** 2.5 → Rule: failure alerting
**Preconditions:** Syncs fail repeatedly.
**Steps:**
1. Let syncs fail repeatedly.
2. Verify an alert is raised per the monitoring rules.
**Expected Result:** A repeated sync failure raises an alert per the monitoring rules — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-14-009 — Audit logging of sync settings
**Type:** Positive
**Covers:** 2.5 → Audit logging
**Preconditions:** SIS sync setting changes have been made.
**Steps:**
1. Open the audit trail and filter by sync frequency, field mapping & conflict resolution.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of sync frequency, field mapping & conflict resolution — delivered exactly as documented.
**Priority:** Critical
