This document describes the AI-powered features added to the Employee Management System for promotion prediction, performance tracking, and work-from-home management.
Location: /promotion-recommendations
What it does:
- Uses machine learning algorithm to predict which employees are eligible for promotion
- Analyzes multiple parameters to generate a promotion score (0-100)
- Employees with a score of 70+ are marked as "Eligible for Promotion"
Algorithm Factors:
- Performance Rating (35 points): Employee's performance rating out of 5
- Tenure/Years of Service (25 points): Time with company (max 5 years for full score)
- Projects Completed (20 points): Number of completed projects (max 10 for full score)
- Attendance (15 points): Attendance percentage (max 100%)
- Work-Life Balance Bonus (5 points): Bonus if employee works from home
Features:
- View all employees sorted by promotion score
- Filter by: All Employees, Eligible for Promotion, Not Yet Eligible
- Sort by: Promotion Score, Name, Tenure
- Visual progress bars showing breakdown of each score component
- Color-coded badges (Green=85+, Blue=70-84, Yellow=<70)
Backend Routes:
GET /api/ai/promotion-recommendations- Get all employees with promotion scores
Location: /performance-tracking
What it does:
- Comprehensive performance analytics for individual employees
- Team-wide performance metrics and trends
- Department comparison analysis
Three View Modes:
- Average team performance rating
- Team attendance statistics
- Average projects completed per person
- Number of promotions ready employees
- Monthly performance trends
- Projects completion trends
- Select any employee to view detailed metrics
- Performance rating and components
- Attendance details (current month and overall)
- Years of service calculation
- Promotion eligibility status
- Radar chart showing performance profile
- Historical attendance patterns
- Performance metrics by department
- Attendance comparison across departments
- Identify high-performing departments
Key Metrics Tracked:
- Performance Rating (1-5 scale)
- Projects Completed
- Attendance Percentage
- Tenure/Years of Service
- Promotion Score
- Work-from-home status
Backend Routes:
GET /api/ai/performance/:employeeId- Get individual performance metricsPUT /api/ai/performance/:employeeId- Update performance details
Location: /work-from-home
What it does:
- Monitor and track employees working from home
- Analyze work arrangement impact on performance
- Department-wise work arrangement distribution
Features:
-
Statistics dashboard showing:
- Total employees
- WFH employees and percentage
- Office-based employees and percentage
- Performance comparison
-
Visual representations:
- Pie chart of work arrangement distribution
- Stacked bar chart by department
- Performance comparison metrics
- Attendance comparison
-
Two view modes:
- Grid View: Cards showing each employee
- List View: Compact list format
-
Filtering options:
- All Employees
- Work From Home Only
- Office Based Only
Performance Insights:
- Average performance rating: WFH vs Office
- Attendance comparison
- Department-wise distribution
Backend Routes:
GET /api/ai/work-from-home- Get WFH statistics and employee list
{
performanceRating: {
type: Number,
min: 1,
max: 5,
default: 3,
},
workFromHome: {
type: Boolean,
default: false,
},
projectsCompleted: {
type: Number,
default: 0,
},
attendancePercentage: {
type: Number,
min: 0,
max: 100,
default: 100,
},
promotionEligible: {
type: Boolean,
default: false,
},
promotionScore: {
type: Number,
default: 0,
},
}| Method | Endpoint | Purpose |
|---|---|---|
| GET | /promotion-recommendations |
Get promotion recommendations for all employees |
| GET | /performance/:employeeId |
Get detailed performance metrics for an employee |
| GET | /work-from-home |
Get work-from-home statistics |
| PUT | /performance/:employeeId |
Update employee performance metrics |
To update an employee's performance metrics, you can use the API:
PUT /api/ai/performance/{employeeId}
Body:
{
"performanceRating": 4.5,
"projectsCompleted": 12,
"workFromHome": true,
"attendancePercentage": 95
}The AI engine calculates promotion score using the weighted formula:
Promotion Score = (Performance Rating / 5 × 35)
+ (Years of Service / 5 × 25) [capped at 25]
+ (Projects / 10 × 20) [capped at 20]
+ (Attendance % / 100 × 15)
+ (WFH Bonus: 5 if true, else 0)
Eligible if Score ≥ 70
The new features are accessible via the sidebar:
- Promotions - AI Promotion Recommendations
- Performance - Performance Tracking Dashboard
- Work From Home - WFH Status & Analytics
- Performance Rating: Manager's rating of employee (1-5 scale)
- Tenure: Time employee has been with company
- Projects Completed: Number of projects completed by employee
- Attendance Percentage: Percentage of working days present
- Promotion Score: AI-calculated score for promotion likelihood (0-100)
- Promotion Eligible: Boolean indicating if score ≥ 70
- Machine Learning Integration: Replace current algorithm with ML models
- Skill-Based Matching: Match employee skills with promotion positions
- Salary Prediction: Predict appropriate salary for promotions
- Goal Tracking: Track employee goals and objectives
- Real-time Notifications: Alert managers when employees become promotion-eligible
- Historical Trends: Track how scores change over time
- Export Reports: Generate PDF reports for HR decision-making
- Bias Analysis: Ensure fairness in promotion recommendations
- All performance data is stored securely in MongoDB
- Employee information is protected
- Access control should be implemented at the API level
- Consider adding role-based access (e.g., only HR can view promotions)
Mock data is included in the frontend components for testing. To test with real data:
- Update employee records with performance data
- Set
performanceRating,projectsCompleted,workFromHometo actual values - Navigate to each feature page to see AI recommendations
- Create an employee with 4-5 years tenure, 4.5+ rating, 15+ projects
- Expected: Promotion score 80-90, eligible for promotion
- Create an employee with <2 years tenure, 3.0 rating, 5 projects
- Expected: Promotion score <70, not yet eligible