Attendance & Timesheets Module
The Attendance module (src/features/attendance/) manages daily work logs, weekly timesheets, manager approvals, and attendance policies.
Routes & Access
| Route | Component | Required Permissions | Purpose |
|---|---|---|---|
/attendance | AttendancePage | Authenticated | Timesheets dashboard with My(individual/personal), Team, and All tabs |
/attendance/:id | TimesheetDetail | Authenticated | Detailed daily breakdown and approval controls for a timesheet |
/admin/attendance-policies/new | AttendancePolicyWizardPage | ATTENDANCE_POLICY_CREATE | Multi-step attendance policy creation wizard |
/admin/attendance-policies/:id/edit | AttendancePolicyWizardPage | ATTENDANCE_POLICY_UPDATE | Edit existing policy rules & working hour thresholds |
/admin/attendance-policies/:id/summary | AttendancePolicySummaryPage | ATTENDANCE_POLICY_READ | Policy assignment & affected employees overview |
Timesheet Lifecycle & State Machine
┌──────────────┐
│ DRAFT │ ◄── (Reopened by Manager)
└──────┬───────┘
│ (Employee submits timesheet)
▼
┌──────────────┐
│ SUBMITTED │
└───┬──────┬───┘
│ │
(Approve) │ │ (Reject / Decline)
▼ ▼
┌────────────┐ ┌────────────┐
│ APPROVED │ │ REJECTED │
└────────────┘ └────────────┘
Timesheet Status Definitions
| Status | Color Badge | Description |
|---|---|---|
DRAFT | Amber (#825b01 / #fcedc8) | Editable by employee; entries can be added or updated |
SUBMITTED | Info Blue (#0088ff) | Locked for editing; pending manager review |
APPROVED | Green (#2d9a6b) | Finalized and counted toward payroll / records |
REJECTED | Red (#ff383c) | Returned to employee with reviewer comments for correction |
Clock-In / Clock-Out Flow
- Located directly in
MyTimesheets.tsx. - Checks current date and timestamp.
- Invokes
attendanceService.clockIn()/attendanceService.clockOut(). - Updates the active timesheet day log and recomputes total weekly working hours dynamically.
Attendance Policies Wizard (AttendancePolicyWizardPage.tsx)
Admins configure site-wide and departmental attendance expectations:
- Work Schedules: Standard daily working hours (e.g. 8h/day, 40h/week).
- Core Hours & Break Durations: Required presence windows and unpaid lunch deductions.
- Overtime & Thresholds: Overtime multiplier rules and missing clock-out tolerances.
- Employee Assignment: Bulk assignment to specific departments or office sites.