# QA Checklist

Use this checklist after importing `schema.sql` and all migrations.

## Authentication

- [ ] Admin login succeeds with a valid active admin account.
- [ ] Viewer login succeeds with a valid active viewer account.
- [ ] Invalid login shows a safe error message.
- [ ] Admin logout destroys the session and returns to login.
- [ ] Viewer cannot access add, edit, update, or delete action pages.
- [ ] Cameraman login succeeds with a valid active cameraman account.
- [ ] Cameraman logout clears cameraman session variables.

## Teachers

- [ ] Admin can add a teacher.
- [ ] Name is required.
- [ ] Optional email must be valid.
- [ ] Duplicate email is blocked.
- [ ] Admin can edit and update a teacher.
- [ ] Admin can delete an unlinked teacher.
- [ ] Deletion is blocked when linked to active batches or schedules.
- [ ] Viewer can view and search teachers only.

## Cameramen

- [ ] Admin can add a cameraman.
- [ ] Username is required and unique.
- [ ] Password is hashed.
- [ ] Admin can edit cameraman details.
- [ ] Optional password update works.
- [ ] Admin can delete an unlinked cameraman.
- [ ] Deletion is blocked for active operational schedules.
- [ ] Viewer can view and search cameramen only.

## Cameras

- [ ] Admin can add a camera.
- [ ] Model is required and duplicate model is blocked.
- [ ] Status is limited to Available, Assigned, Maintenance.
- [ ] Admin can edit camera status.
- [ ] Maintenance camera is excluded from scheduling/resource lookup.
- [ ] Admin can delete an unlinked camera.
- [ ] Deletion is blocked for active operational schedules.
- [ ] Viewer can view and search cameras only.

## Rooms

- [ ] Admin can add a room.
- [ ] Room name is required and unique.
- [ ] Capacity accepts only positive integers or blank.
- [ ] Type is limited to Classroom, Studio, Lab, Hall, Other.
- [ ] Admin can edit and delete unlinked rooms.
- [ ] Deletion is blocked for active operational schedules.
- [ ] Viewer can view and search rooms only.

## Batches

- [ ] Admin can add a batch.
- [ ] Name, course, teacher, dates, timing, days, mode, and status are validated.
- [ ] End date cannot be before start date.
- [ ] Duplicate batch name for same course and teacher is blocked.
- [ ] Admin can edit and delete unlinked batches.
- [ ] Deletion is blocked for active operational schedules.
- [ ] Viewer can view and search batches only.

## Schedule

- [ ] Admin can create a schedule.
- [ ] Required schedule fields are validated.
- [ ] Schedule overlap prevention blocks active overlaps.
- [ ] Active overlap statuses are Scheduled, Started, Unscheduled, Issue Reported.
- [ ] Completed and Cancelled records are ignored by overlap checks.
- [ ] Started schedule sets cameraman to Busy and camera to Assigned.
- [ ] Completed schedule sets cameraman and camera to Available.
- [ ] Cancelled schedule sets cameraman and camera to Available.
- [ ] Camera Issue sets camera to Maintenance.
- [ ] Mark Free sets cameraman to Available.
- [ ] Room availability is based on schedule overlaps only.
- [ ] Viewer can view schedules only.
- [ ] Cameraman can start, complete, cancel, or report issue only for own assigned schedules.

## Unscheduled Recording

- [ ] Admin can create an unscheduled recording.
- [ ] Overlap prevention runs for unscheduled recordings.
- [ ] Unscheduled recording appears in reports, calendar, dashboard stats, alerts, and activity timeline.

## Cameraman Portal And Attendance

- [ ] Cameraman sees only assigned schedule records.
- [ ] Scheduled records show Start, Cancel, and Report Issue actions.
- [ ] Started records show Complete and Report Issue actions.
- [ ] Completed and Cancelled records show no action buttons.
- [ ] Check-in creates only one attendance record per day.
- [ ] Duplicate check-in is blocked.
- [ ] Check-out requires check-in.
- [ ] Duplicate check-out is blocked.
- [ ] Attendance history displays check-in, check-out, status, and issue report.

## Resource Tools

- [ ] Resource Lookup returns free cameramen, cameras, and rooms.
- [ ] Free Slots displays planning windows for selected date, week, or month.
- [ ] Cameras in Maintenance do not appear as available.
- [ ] Cameramen on Leave or Inactive do not appear as available.
- [ ] Rooms are free only when no active overlapping schedule exists.

## Reports And Exports

- [ ] Resource Status report loads.
- [ ] Free Resources report uses selected date/time filters.
- [ ] Conflicts report detects overlapping cameraman, camera, and room schedules.
- [ ] Daily Schedule report loads and exports Excel/Print/PDF fallback correctly.
- [ ] Weekly Schedule report loads and exports Excel/Print/PDF fallback correctly.
- [ ] Monthly Schedule report loads and exports Excel/Print/PDF fallback correctly.
- [ ] Cameraman Utilization report loads and exports Excel.
- [ ] Camera Usage report loads and exports Excel.
- [ ] Room Usage report loads and exports Excel.
- [ ] Issues report loads and exports Excel.

## Calendar And Leave

- [ ] Calendar month, week, day, and list views load events.
- [ ] Calendar event modal shows event details.
- [ ] Admin can add teacher leave.
- [ ] Approved teacher leave creates calendar event.
- [ ] Affected schedules are shown for approved teacher leave.
- [ ] Admin can cancel affected schedules and release resources.
- [ ] Viewer can view calendar and resource planner but cannot edit events or teacher leave.

## Enterprise Operations

- [ ] Notifications are created for schedule start, completion, cancellation, issues, camera maintenance, teacher leave, unscheduled recordings, conflicts, and missed check-ins.
- [ ] Notification inbox filters by status, type, and search text.
- [ ] Admin can clear notifications.
- [ ] Admin/viewer can mark own notifications as read.
- [ ] Activity timeline shows schedule actions, attendance actions, issue actions, resource changes, and login/logout actions.
- [ ] Activity timeline filters by actor type and date range.
- [ ] Alerts page shows active conflicts, open issues, maintenance cameras, leave/inactive cameramen, unstarted recordings, teacher leaves, unscheduled recordings, and not checked-in cameramen.
- [ ] Settings page is read-only for viewer.
- [ ] Admin can update settings and automation rules.

## Dashboard

- [ ] Dashboard KPI cards display correct counts.
- [ ] Today's schedule table loads.
- [ ] Currently started recordings table loads.
- [ ] Open issues table shows latest open issues.
- [ ] Available resources now uses current date/time window.
- [ ] Sidebar links point to existing modules.
