Skip to content

Shivansh-Rajput01/Employee-Payroll-Structure-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Employee Payroll Management System

A simplified employee payroll management system with attendance tracking and salary calculation based on work hours.

Features

  • 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

Quick Start

1. Setup Backend

cd Backend
npm install

2. Configure Database

Edit Backend/.env:

DB_HOST=localhost
DB_PORT=5432
DB_NAME=payroll_db
DB_USER=postgres
DB_PASSWORD=your_password
PORT=3000

3. Run Backend

npm run start:dev

Server runs on: http://localhost:3000

API Endpoints

1. Create Employee

POST /employee

{
  "name": "John Doe",
  "salary": 25000,
  "isPfEnabled": true
}

2. Get Employees (Dropdown)

GET /employees

3. Get Datasets (Dropdown)

GET /datasets

4. Calculate Salary

POST /calculate-salary

{
  "employeeId": 1,
  "datasetId": 1
}

Datasets

  1. Dataset 1: 9.5 hours/day (Full day)
  2. Dataset 2: 8 hours/day (Full day)
  3. Dataset 3: 8 hours/day (Full day)
  4. Dataset 4: 5.5 hours/day (Half day)

Attendance Rules

  • 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

Salary Calculation

Salary > ₹30,000

  • No PF deduction
  • PT = ₹200 deducted first
  • Full salary structure calculated

Salary ₹12,000 - ₹30,000

  • PF = 24% (max ₹2,880) if enabled
  • PT = ₹200
  • Salary structure on remaining amount

Salary ≤ ₹12,000

  • PF = 24% (max ₹2,880) if enabled
  • No PT deduction
  • No salary structure

Tech Stack

  • Backend: NestJS, TypeScript
  • Database: PostgreSQL
  • API Testing: Postman

Testing

Import Payroll-APIs.postman_collection.json into Postman and test all endpoints.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors