Attendance
Overview
Tracks daily student and employee attendance. Supports bulk marking, monthly reports, and leave integration.
Attendance Status
| Status | Code | Description |
|---|---|---|
| Present | PRESENT | Student/employee attended |
| Absent | ABSENT | Did not attend |
| Late | LATE | Arrived after scheduled time |
| On Leave | LEAVE | Approved leave for the day |
| Holiday | HOLIDAY | Scheduled holiday |
Marking Attendance
School Admin — Bulk Mark
POST /school-admin/attendance/mark
{
"data": {
"date": "2024-04-01",
"classId": "uuid",
"divisionId": "uuid", // optional
"records": [
{ "studentId": "uuid1", "status": "PRESENT" },
{ "studentId": "uuid2", "status": "ABSENT" },
{ "studentId": "uuid3", "status": "LATE" }
]
}
}
Teacher — Mark Own Class
POST /teacher/attendance/mark
{
"data": {
"date": "2024-04-01",
"classId": "uuid",
"divisionId": "uuid",
"records": [
{ "studentId": "uuid", "status": "PRESENT" }
]
}
}
Driver — Bus Attendance
Bus attendance is separate from academic attendance. Tracked via Trip Student Mark.
Attendance Report
GET /school-admin/attendance/report
{
"data": {
"classId": "uuid",
"month": "2024-04",
"summary": {
"totalDays": 22,
"present": 18,
"absent": 2,
"late": 1,
"leave": 1,
"holiday": 0
},
"students": [
{
"studentId": "uuid",
"name": "John Doe",
"rollNo": "101",
"records": [
{ "date": "2024-04-01", "status": "PRESENT" },
{ "date": "2024-04-02", "status": "ABSENT" }
]
}
]
}
}
Summary View
GET /school-admin/attendance/summary?classId=uuid&month=2024-04
Shows % attendance per student and class average.
Integration with Leave
When a leave application is APPROVED, the corresponding day is automatically marked as LEAVE in the attendance table:
// LeaveService
async approveLeave(leaveId: string) {
const leave = await this.leaveRepo.findById(leaveId);
await this.attendanceService.markStatus({
studentId: leave.studentId,
date: leave.fromDate,
status: 'LEAVE',
markedBy: leave.approvedBy,
});
}