type
Data Model
title
Attendance
description
One attendance row per class per date, listing exactly which of its students were present.
tags
attendance, presence, classes
status
stable
stale_after
Fri Apr 30 2027 02:00:00 GMT+0200 (Central European Summer Time)
generated
techwriter/mimo-v2.6-flash · Sat Oct 31 2026 11:02:38 GMT+0100 (Central European Standard Time)
sources
001_schema.sql → internal/infrastructure/sqlite/migrations/001_schema.sql; svc → internal/application/school/attendance_service.go

Attendance

A class register: one header row per (class, date), and a child row per student who was present. Absence is the absence of a row — the header's roster minus its attendance_students.

Table Columns (keys) Notes
attendance id PK · class_id FK · date · created_by · created_at · UNIQUE(class_id, date) the uniqueness constraint is the "one register per class per day" rule; re-taking attendance edits the same header
attendance_students id PK · attendance_id FK (ON DELETE CASCADE) · student_id FK · UNIQUE(attendance_id, student_id) present-only rows; deleting the header cascades them away

Relationships

classes 1 —< attendance 1 —< attendance_students >— students.

Access

Teachers write attendance for their own classes (scope assigned); the all-attendance monitor (GET /attendance) is gated attendance read but has a scope guard inside the handler so only unrestricted roles see every class. A parent at scope own sees only their children's rows. The attendance summary report aggregates the same two tables.

Rendered from simple-lms/data-model/attendance.md · OKF bundle · regenerate with npm run render