Skip to content

AbbasHabib/HR-System-RestAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HR-System-Using-RestAPI

this project is an HR system where the of it is managing employees teams, departments, salaries...and so on. System is able to apply CRUD operation on the DB

The project will be fully driven by JavaSpringBoot ​Framework, and MySql Database

Add new employee using postman

New employee data is transferred through an HTTP request body carrying employee data as a json. This request gets sent to a servlet that calls the addEmployee api. json date from request body gets mapped to a java object that gets stored in the SQL database. Using JPA and hibernate that are built in springboot

  • this request can be done by employees with HR role only

  • no id has to be sent. employee id is autogenerated

  • when adding a manager to employee. Manager id has to sent as an object and same thing for team and department

    "manager":{"id":1},
    "team":{"id":1},
    "department":{"id":1}
    

add-employee-postman

Modify employee using postman

  • this request can be done by employees with HR role only
  • employee id has to be added after the uri

modify-employee-postman

Get employee from authentication using postman

  • this request can be done by employees with HR or EMPLOYEE role
  • this request gets employee data from authentication username

get-employee-postman

Add new day details

  • this request can be done by employees with HR role only
  • employee id has to be added after the uri
  • this request adds new dat data to a month
  • this day can either carry absence in current day or bonus in salary
  • important -> to creat a new month for an employee a day has to be added at this month date

add-new-day-postman

Change password

  • this request can be done by employees with HR or EMPLOYEE role
  • old password (currentPassword) has to be correct inorder to change old password with the new one

change-password-postman

Entity Relation Diagram

ERD

Test Cases

  • there are currently 56 test cases for this application covering most of the possible scenarios.
  • currently, working on adding I will keep adding more test cases and reducing the number of code warnings.

change-password-postman

Current TodoList

  • add command + api to modify employee salary
  • working on attendance apis
  • Test for addNewDayData doesn't work
  • Basic Authorization with every request
  • Add test cases for all attendance table apis
  • Rest Api to get absences through the year till specific month
  • Rest Api to add day with details: [absence, bonusInSalary] + dayDate
  • Rest Api to get employee salary with calculating deduction[through the year] and bonuses[monthly]
  • Api to check deduction at specific month [checking absences through year till specific month]
  • Rest Api to show salary history In a month

Improving Code Todo List

  • Auto generate getters and setters using -> (Project Lombok)
  • Handle Exceptions at client side
  • Use Enums to replace constants
  • Migration of MySQl DB using flyway
  • Improve Testing using DBunit
  • mapping data from DTO to main entities delete all boilerplate code.
  • Remove the beautiful magic numbers ✨

ToDo List

  • Add Team to Employee
  • Deal with Employee salary logic
  • Rest API to add Employee
  • Rest API to get employee Info
  • Rest API to modify employee
  • Rest API to delete employee
  • Dealing with manager deletion logic
  • Rest API to get Employee salary info
  • Rest API to get All employees under a specific manager
  • Rest API to get All employees under a specific manager >> recursively <<
  • Rest Api to get All Employees in some team
  • Primary key sequence for each table

Currently working on

  • improving code stability and adding comments

About

RestAPI HR System. Where the main objective is managing employees teams, departments, salaries...and so on. System is able to apply CRUD operation on the DB.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages