A simplified employee payroll management system with attendance tracking and salary calculation based on work hours.
- Create employees with salary and PF configuration
- 4 different attendance datasets for testing
- Automatic time log generation (30 days)
- Attendance-based salary calculation
- Full day, half day, and leave management
- Automatic PF and PT deductions
cd Backend
npm installEdit Backend/.env:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=payroll_db
DB_USER=postgres
DB_PASSWORD=your_password
PORT=3000npm run start:devServer runs on: http://localhost:3000
POST /employee
{
"name": "John Doe",
"salary": 25000,
"isPfEnabled": true
}GET /employees
GET /datasets
POST /calculate-salary
{
"employeeId": 1,
"datasetId": 1
}- Dataset 1: 9.5 hours/day (Full day)
- Dataset 2: 8 hours/day (Full day)
- Dataset 3: 8 hours/day (Full day)
- Dataset 4: 5.5 hours/day (Half day)
- Full Day: ≥ 6.5 hours
- Half Day: 5-6.4 hours (50% salary)
- Absent: < 5 hours (no salary)
- Paid Leave: Max 1 per month
- Unpaid Leave: Deducted from salary
- No PF deduction
- PT = ₹200 deducted first
- Full salary structure calculated
- PF = 24% (max ₹2,880) if enabled
- PT = ₹200
- Salary structure on remaining amount
- PF = 24% (max ₹2,880) if enabled
- No PT deduction
- No salary structure
- Backend: NestJS, TypeScript
- Database: PostgreSQL
- API Testing: Postman
Import Payroll-APIs.postman_collection.json into Postman and test all endpoints.
MIT