Skip to main content

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.

The Analytics module transforms raw activity data into actionable workforce intelligence. Each role receives a purpose-built dashboard that surfaces the metrics most relevant to their responsibilities, all backed by the same underlying data pipeline of attendance sessions, time logs, daily statistics, and performance metrics. Reports can be pulled on-demand for any date range, and team performance data is exportable to CSV.

Admin Dashboard

The Admin dashboard gives org-wide visibility across all active employees, projects, and operational exceptions. It is served by two endpoints: GET /dashboard/admin returns live headcount KPIs, and GET /dashboard/admin/analytics returns the full analytics view powered by AdminDashboardService.

Summary KPIs

Workforce Headcount

Total users, active users, employees checked in today, WFH vs. office split, and pending approvals count.

Open Alerts

Count of unresolved system alerts (AlertStatus.OPEN) surfaced directly on the dashboard for immediate action.

Active Projects

Count of projects with ACTIVE or APPROVED status, alongside the org-wide overdue task count.

Analytics View (/dashboard/admin/analytics)

The full analytics payload (AdminAnalyticsDashboard) bundles:
FieldDescription
kpistotal_employees, total_projects, pending_approvals, attendance_rate, checked_in_today, late_today, wfh_today
attendance_trendDaily series of checked_in, late, and absent counts
task_statisticsBreakdown by status: total, completed, in_progress, on_hold, pending, rejected
project_statisticsBreakdown by status: total, approved, pending, rejected, active
department_comparisonPer-department employee_count, attendance_rate, completed_tasks, pending_approvals
people_exceptionsEmployees flagged for missing check-ins, overdue tasks, or attendance anomalies
recent_activityTimestamped activity log entries for audit-trail awareness

Additional Admin Analytics Tabs

EndpointSchemaScope
GET /dashboard/admin/users-analyticsUsersAnalyticsDashboardEmployee roster, role/dept distribution, performance metrics
GET /dashboard/admin/communication-analyticsCommunicationAnalyticsDashboardUnread messages, meeting counts, support tickets
GET /dashboard/admin/projects-tasks-analyticsProjectsTasksAnalyticsDashboardProject progress, task status distribution
All admin analytics endpoints require the admin or hr_operations role. The base /dashboard/admin requires admin only.

Risk Visibility

The people_exceptions list in the analytics response flags employees with persistent low utilization, missing checkouts, or overdue tasks. Top performers (by productivity score) are surfaced alongside employees needing attention, giving Admins a balanced view without manually filtering.

Data Sources and Aggregation

All dashboard and report data originates from four primary sources:

DailyStats

A summary table updated asynchronously by the Celery worker. Aggregates total minutes, tasks, and breaks per user per day. Used for trend charts and performance scoring.

Attendance Sessions

Raw presence data. Each session records check_in_at, check_out_at, work_mode, and session_status. Used for the attendance feed, WFH/office split, and correction workflows.

Time Logs

Timer-based productive time. Each log has started_at, duration_minutes, a status (ACTIVE or completed), and a log_type (timer vs. manual). Feeds the productive_time_today KPI.

Performance Metrics

A dedicated scoring engine computes Utilization, Consistency, and Output scores from weighted combinations of the sources above. Exposed via the analytics endpoints documented below.

Reports

The Reports API generates date-range aggregations across individuals and teams.

Report Endpoints

EndpointAuthDescription
GET /reports/employee?start_date=&end_date=All usersPersonal WeeklyReportRead for the authenticated user
GET /reports/manager?start_date=&end_date=Manager / Admin / HRWeeklyReportRead for each direct report
GET /reports/team-performanceManager / Admin / HRPaginated TeamPerformanceResponse with filtering
GET /reports/team-performance/exportManager / Admin / HRCSV download of team performance data
GET /reports/hr?start_date=&end_date=HR / AdminOrg-wide WeeklyReportRead list
GET /reports/admin?start_date=&end_date=Admin onlyOrg-wide WeeklyReportRead list

Team Performance Report

The GET /reports/team-performance endpoint supports rich filtering:
GET /reports/team-performance
  ?period=weekly
  &date=2025-01-13
  &department_id=<uuid>
  &role=employee
  &search=alice
  &page=1
  &page_size=50
The CSV export (GET /reports/team-performance/export) produces columns for Employee Name, Email, Role, Department, Designation, Hours, Tasks Worked On, Completed Tasks, Late/Early/WFH/Absence counts, and EOD Status.

Analytics Endpoints

EndpointPermissionResponse
GET /analytics/best-performersanalytics.view_orgTop performers ranked by score, completed tasks, and attendance consistency
GET /analytics/workload-balanceanalytics.view_org or analytics.view_teamPer-user active task count and overload flag
GET /analytics/burnout-risksanalytics.view_orgUsers with high consecutive-high-hour-day streaks and a risk level label
GET /analytics/productivity-trend/{user_id}Authenticated + access checkDaily productivity score series for a specific user

Leave and Correction Impact on Reporting

Approved leave directly affects how “Expected Hours” is calculated in reports. An employee on approved leave is never flagged as under-utilized for that period. When an attendance correction is approved, the corresponding DailyStats row and performance scores are automatically recalculated by the background worker, ensuring historical reports remain accurate.

Known Limitations

Aggregation lag: DailyStats entries are processed asynchronously by the Celery worker. Stats for the current day may be up to 5 minutes behind real-time activity. Metrics for in-progress sessions are labelled “Estimated” until the session is closed.
Manual entry bias: Performance scoring distinguishes between timer logs and manual logs. Manual time entries are weighted lower to discourage unverified hours. Reports reflect this distinction in the output score.
Incomplete sessions: If an employee forgets to check out, their session remains open. total_time_today is based on the closed session duration; an unclosed session shows check_out_at: null and duration_minutes: null.

Build docs developers (and LLMs) love