The Attendance module is the operational heartbeat of the platform. Every working day begins with a check-in that opens a session and ends with a check-out that closes it, calculating worked minutes and automatically classifying the day. Managers gain real-time visibility through team views, and employees can request corrections when timestamps are wrong — all without leaving the dashboard.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Paramount-Intelligence/HR_Monitoring_System/llms.txt
Use this file to discover all available pages before exploring further.
Shift Configuration
The platform ships with a single standard shift definition. All comparisons between check-in/out times and shift boundaries use Asia/Karachi (PKT) as the reference timezone, even though every timestamp is stored in UTC.| Field | Value |
|---|---|
| Shift start | 5:00 PM PKT |
| Shift end | 2:00 AM PKT (next calendar day) |
| Duration | 9 hours |
| Timezone | Asia/Karachi (UTC+5) |
All dashboard views, reports, and duration labels must render times in PKT. Durations display as
HH:mm (e.g., 08:45), not raw minutes. Internal UUIDs are never shown — use the employee’s full name and the shift name instead.Work Modes
When an employee checks in, they declare one of two work modes:| Enum value | Meaning |
|---|---|
office | Employee is physically present at the office |
wfh | Employee is working from home |
work_mode field is recorded on the session and influences reporting filters — it does not change session classification or flag logic.
Check-In Flow
Employee triggers check-in
The employee selects a work mode and submits the request. The system captures
check_in_at at the precise instant the request is processed.Active-session guard
If the employee already has a session in status
active, the API rejects the request. Only one active session is permitted per user at any time.Example Check-In Request
Check-In Response Fields (selected)
Unique session identifier (internal use only — not displayed in the UI).
Human-readable name of the employee shown in all views.
office or wfh as declared at check-in time.active, completed, incomplete, or corrected.true when check-in occurred after the shift start time in PKT.The expected start boundary for this session’s shift, returned in UTC.
Check-Out Flow
Employee triggers check-out
The employee submits the check-out request. An optional body can carry
early_checkout_reason or after-shift justification fields.Metrics calculated
check_out_at is recorded. The system computes worked_minutes, duration_minutes, and total_hours. The is_early_logout flag is set if check-out is before 2:00 AM PKT.Breaks auto-closed
Any break with status
active at the time of check-out is automatically closed with ended_at = check_out_at.Checkout Request Body (optional fields)
Short reason code for post-shift checkout (e.g.,
overtime, forgot_checkout).Free-text note elaborating on why the session ran past shift end.
Reason when checking out before the shift end time.
Session Classification
After checkout the platform automatically assigns one of the following classifications to every session.attendance_classification | Rule |
|---|---|
active | Session is still open; employee has not checked out yet |
full_day | worked_minutes ≥ 540 (9 hours) |
half_day | worked_minutes ≥ 270 and < 540 (4.5 – 9 hours) |
short_leave | worked_minutes < 270 (under 4.5 hours) |
insufficient | Duration recorded but falls below the half-day threshold |
full_leave / leave | No check-in, but an approved leave record covers the day |
Operational Flags
| Flag | Condition |
|---|---|
is_late_login | Check-in after shift start (5 PM PKT) |
is_early_logout | Check-out before shift end (2 AM PKT) |
is_overtime | Session duration significantly exceeds 9 hours |
is_corrected | Session was updated via an approved correction request |
Break Tracking
Employees can log mid-session breaks without losing credit for paid work time. All breaks are classified as paid — break duration is not deducted fromworked_minutes.
Break Types
break_type | Description |
|---|---|
dinner | Standard meal break |
prayer | Daily prayer time |
other | Coffee, rest, or any miscellaneous short break |
Break Rules
- A break can only be started while an
activeattendance session exists. - Only one active break is allowed at a time. Starting a second break while one is open is rejected.
- If the employee checks out while a break is still active, the system sets
ended_at = check_out_atautomatically. - Break durations are stored on the session in dedicated columns:
dinner_break_minutes,prayer_break_minutes, andother_break_minutes.
Break Endpoints
- Start Break
- End Break
- Current Break
- Session Breaks
Break Response Fields
dinner, prayer, or other.Timestamp when the break began.
Timestamp when the break ended.
null if the break is still active.Calculated on break completion.
null while the break is in progress.Always
true — all recorded breaks count as paid time.Auto-Close and Incomplete Sessions
Theincomplete status signals that the session could not be classified normally and requires either a manual correction or manager intervention.
Attendance Correction Flow
Employees occasionally forget to check out or check in with the wrong timestamp. The correction workflow provides a structured, auditable remedy.Employee submits correction request
PATCH /api/v1/attendance/{session_id}/correction-request with requested_check_in_at, requested_check_out_at, and a mandatory reason. The session flag correction_requested is set to true.Manager reviews pending corrections
GET /api/v1/attendance/corrections/pending returns all sessions in the manager’s team scope that have pending correction requests.Manager resolves the correction
PATCH /api/v1/attendance/{session_id}/resolve-correction with an action of approve, reject, or clarify. On approval, the system applies the corrected timestamps and recalculates all metrics from scratch.Correction Request Fields
The corrected check-in timestamp the employee is requesting (UTC).
The corrected check-out timestamp the employee is requesting (UTC).
Mandatory human-readable explanation for the correction.
Correction Resolve Fields
One of
approve, reject, or clarify.Manager-confirmed corrected check-in (may differ from the employee’s request).
Manager-confirmed corrected check-out.
Optional comment explaining the decision.
Role-Based Access Summary
| Endpoint | Employee | Manager / Team Lead | Admin / HR Ops |
|---|---|---|---|
POST /check-in | ✅ Own session | ✅ | ✅ |
POST /check-out | ✅ Own session | ✅ | ✅ |
GET /me | ✅ Own history | ✅ | ✅ |
GET /team | ❌ | ✅ Team scope | ✅ All |
PATCH /{id}/correction-request | ✅ Own session | ✅ | ✅ |
GET /corrections/pending | ❌ | ✅ Team scope | ✅ All |
PATCH /{id}/resolve-correction | ❌ | ✅ Team scope | ✅ All |
Overnight Session Handling
The standard shift crosses midnight: it starts at 5:00 PM on day N and ends at 2:00 AM on day N+1. The system correctly attributes a 1:30 AM check-out to the session that opened at 5:00 PM the previous calendar day, so daily summaries are never split across two date buckets incorrectly.
