SKOLE-ATND | Version: 1.0 | Status: ActivProducts: Parent App (read-only) · Teacher App (mark/edit) · Web App (report)
1. Overview
Scope In
- Parent: view attendance records per child per month/date range
- Teacher: mark present/absent/late, update existing records, view class attendance
- Web Admin: view school-wide attendance, filter by grade/date
Scope Out
- SMS/FCM notification on absence (planned, not implemented)
- Bulk import from external timetabling system
2. Requirements
Functional Requirements (FR)
What the module must DO — actions, behaviors, and outcomes.- SKOLE-ATND-FR001: The module shall allow parents to view attendance history for their child by roll number for the current month.
- SKOLE-ATND-FR002: The module shall display attendance details including date, status (present, absent, late, excused), and check-in/check-out times.
- SKOLE-ATND-FR003: The module shall enable teachers to mark or update attendance records for individual students.
- SKOLE-ATND-FR004: The module shall allow teachers to filter attendance records by grade and date.
- SKOLE-ATND-FR005: The module shall scope all attendance records and queries strictly to the
skole_id. - SKOLE-ATND-FR006: The module shall allow web admins to view an attendance summary per student across the school.
Non-Functional Requirements (NFR)
How well the module must do it — performance, security, and reliability.- SKOLE-ATND-NFR001: The module shall behave securely by enforcing data isolation, ensuring parents can only read their own child’s attendance via JWT verification.
- SKOLE-ATND-NFR002: The module shall perform authentication checks requiring a valid JWT for every attendance-related query.
Constraints
Rules and boundaries — tech choices and platform restrictions.- C001: We must use a relational database (PostgreSQL) because attendance records are strictly linked to the
studentsandschoolstables. - C002: We must maintain the
skole_idas the primary multi-tenancy key in thestudent_attendancetable to ensure data separation.
3. Sub-modules / Backlog
4. Logical Implementation
Attendance Status State Machine
attendance_status (present/absent/late/excused), availability_status (in-school/away), checkedIn_at, CheckedOut_at
Parent API Flow
Teacher API Flow
Error Handling
5. UI Requirements
Parent App — AttendanceScreen
UI States:
- Loading: skeleton calendar
- Empty: “No attendance records for this month”
- Error: retry button with error toast
Teacher App — AttendanceScreen
Key Components:
Web App — Attendance Page
6. Conditional Expressions
7. Internal Module Connections
8. External Connections
9. Database Tables
student_attendance Schema
10. API Endpoints Summary
- Pagination limit: max 100 records
PARENT-01: List Child’s Attendance
Section 1: Endpoint Summary
Returns paginated list of attendance records for a parent’s child, with filtering by date range and status.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/parent-app/attendance - Authentication: JWT Bearer Token (Parent)
- Rate Limit: 100 requests per minute
Section 4: Query Parameters
Section 5: Request Body Schema
Empty (GET request)Section 6: Response Schema (Success - 200)
Section 7: Error Responses
401 - UnauthorizedSection 8: Implementation Examples
JavaScript:Section 9: Database Context
Tables:- student_attendance (primary)
- students (join for validation)
Section 10: Business Logic & Validations
- Parent_id from JWT must own the student
- Date range max: 90 days
- Status enum validation
- Pagination limit: max 100 records
Section 11: Related Endpoints
- GET
/parent-app/attendance/:studentId- Individual detail - GET
/parent-app/attendance/reports/summary- Summary stats - GET
/parent-app/attendance/reports/monthly- Monthly view
Section 12: Response Summary Table
PARENT-02: Get Child’s Attendance Detail
Section 1: Endpoint Summary
Get detailed attendance record for a specific date including check-in/out times.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/parent-app/attendance/:studentId - Authentication: JWT (Parent)
Section 3: Path Parameters
Section 4: Query Parameters
Section 6: Response Schema (Success - 200)
Section 7: Error Responses
404 - No RecordSection 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
PARENT-03: Attendance Summary Report
Section 1: Endpoint Summary
Returns monthly/yearly attendance summary with statistics like percentage, present/absent counts.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/parent-app/attendance/reports/summary - Authentication: JWT (Parent)
Section 4: Query Parameters
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
PARENT-04: Monthly Attendance Report
Section 1: Endpoint Summary
Returns calendar view of attendance data for the full month.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/parent-app/attendance/reports/monthly - Authentication: JWT (Parent)
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACH-01: Mark Attendance
Section 1: Endpoint Summary
Teacher marks attendance for students in their class. Supports single or batch marking with status and timestamps.Section 2: HTTP Details
- HTTP Method: POST
- Endpoint URL:
/teachers-app/attendance - Authentication: JWT Bearer Token (Staff)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 201)
Section 7: Error Responses
400 - Invalid StatusSection 8: Implementation Examples
JavaScript:Section 9: Database Context
Tables:- student_attendance (insert new records)
- staff_student (verify assignment)
Section 10: Business Logic & Validations
Validation:- Status from enum: present, absent, late, excused
- Student must be in teacher’s class (staff_student check)
- Date must be school day (not weekend/holiday)
- No duplicate records for same student+date
Section 11: Related Endpoints
- PUT
/teachers-app/attendance/:id- Edit record - GET
/teachers-app/attendance- View records - POST
/teachers-app/attendance/bulk-upload- Bulk import
Section 12: Response Summary Table
TEACH-02: Edit Attendance Record
Section 1: Endpoint Summary
Teacher updates an individual attendance record (status, times, notes).Section 2: HTTP Details
- HTTP Method: PUT
- Endpoint URL:
/teachers-app/attendance/:id - Authentication: JWT (Staff)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACH-03: List Class Attendance
Section 1: Endpoint Summary
Teacher retrieves attendance records for their assigned class with filtering by date.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/teachers-app/attendance - Authentication: JWT (Staff)
Section 4: Query Parameters
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACH-04: Bulk Upload Attendance
Section 1: Endpoint Summary
Import attendance records from CSV/Excel file for entire class in one operation.Section 2: HTTP Details
- HTTP Method: POST
- Endpoint URL:
/teachers-app/attendance/bulk-upload - Content-Type:
multipart/form-data - Authentication: JWT (Staff)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACH-05: Attendance Reports
Section 1: Endpoint Summary
Teacher views attendance reports for their class with statistics and trends.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/teachers-app/attendance/reports - Authentication: JWT (Staff)
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
ADMIN-01: Create Attendance Record (Web App)
Section 1: Endpoint Summary
Admin creates attendance records with all details. Supports editing historical records.Section 2: HTTP Details
- HTTP Method: POST
- Endpoint URL:
/web-app/attendance - Authentication: JWT (Admin)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 201)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
ADMIN-02: List Attendance (Web App)
Section 1: Endpoint Summary
Admin views all attendance records for entire school with advanced filtering.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/web-app/attendance - Authentication: JWT (Admin)
Section 4: Query Parameters
Section 6: Response Schema (Success - 200)
Section 12: Response Summary Table
ADMIN-03: Update Attendance Record (Web App)
Section 1: Endpoint Summary
Admin updates attendance record details.Section 2: HTTP Details
- HTTP Method: PUT
- Endpoint URL:
/web-app/attendance/:id - Authentication: JWT (Admin)
Section 6: Response Schema (Success - 200)
Section 12: Response Summary Table
ADMIN-04: Bulk Upload Attendance (Web App)
Section 1: Endpoint Summary
Admin bulk uploads attendance from CSV/Excel file for entire school.Section 2: HTTP Details
- HTTP Method: POST
- Endpoint URL:
/web-app/attendance/bulk-upload - Content-Type:
multipart/form-data - Authentication: JWT (Admin)
Section 6: Response Schema (Success - 200)
Section 12: Response Summary Table
ADMIN-05: Attendance Reports (Web App)
Section 1: Endpoint Summary
Admin views school-wide attendance reports with statistics and analysis.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/web-app/attendance/reports - Authentication: JWT (Admin)