http://localhost:8080/swagger-ui/index.html
http://localhost:8080
Request
GET /employee
GET /employee?page=0
Response
{
"totalPages": 1,
"employees": [
{
"id": 1,
"name": "AdminManager",
"salary": 75000.0,
"address": "123 Main Street, Kochi",
"role": "Admin",
"joinDate": "2022-04-15",
"dateOfBirth": "1990-06-10",
"yearlyBonusPercentage": 10.5,
"departmentId": null,
"reportingManagerId": null
},
{
"id": 2,
"name": "Manager IT",
"salary": 85000.0,
"address": "101 Tech Park, Kochi",
"role": "Manager",
"joinDate": "2021-01-10",
"dateOfBirth": "1980-03-25",
"yearlyBonusPercentage": 12.0,
"departmentId": 1,
"reportingManagerId": 1
}
],
"currentPage": 0
}Request
GET /employee?lookup=true
GET /employee?lookup=true&page=0
Response
{
"totalPages": 1,
"employees": [
{
"id": 1,
"name": "AdminManager"
},
{
"id": 2,
"name": "Manager IT"
}
],
"currentPage": 0
}Request
GET /employee/1
Response
{
"id": 1,
"name": "AdminManager",
"salary": 75000.0,
"address": "123 Main Street, Kochi",
"role": "Admin",
"joinDate": "2022-04-15",
"dateOfBirth": "1990-06-10",
"yearlyBonusPercentage": 10.5,
"departmentId": null,
"reportingManagerId": null
}Request
POST /employee
Request Body
{
"name": "Ashil",
"salary": 44000.0,
"address": "203 HM, Kochi",
"role": "Employee",
"joinDate": "2023-04-15",
"dateOfBirth": "1994-05-10",
"yearlyBonusPercentage": 5.2,
"departmentId": 3,
"reportingManagerId": 4
}Response
{
"id": 29,
"name": "Ashil",
"salary": 44000.0,
"address": "203 HM, Kochi",
"role": "Employee",
"joinDate": "2023-04-15",
"dateOfBirth": "1994-05-10",
"yearlyBonusPercentage": 5.2,
"departmentId": 3,
"reportingManagerId": 4
}Request
PUT /employee/29
Request Body
{
"name": "Ashil B",
"salary": 75000.0,
"address": "123 Main Street, Kochi",
"role": "employee",
"joinDate": "2021-04-15",
"dateOfBirth": "1992-06-10",
"yearlyBonusPercentage": 10.5
}Response
{
"id": 29,
"name": "Ashil B",
"salary": 75000.0,
"address": "123 Main Street, Kochi",
"role": "employee",
"joinDate": "2021-04-15",
"dateOfBirth": "1992-06-10",
"yearlyBonusPercentage": 10.5,
"departmentId": 3,
"reportingManagerId": 4
}Request
PATCH /employee/{id}/department
Request Body
{
"departmentId": 4
}Response
{
"id": 29,
"name": "Ashil B",
"salary": 75000.0,
"address": "123 Main Street, Kochi",
"role": "employee",
"joinDate": "2021-04-15",
"dateOfBirth": "1992-06-10",
"yearlyBonusPercentage": 10.5,
"departmentId": 3,
"reportingManagerId": 4
}Request
DELETE /employee/29
Response
{
"message": "Employee deleted successfully"
}Request
GET /department/
GET /department?page=0
Response
{
"totalPages": 1,
"departments": [
{
"id": 1,
"name": "IT",
"creationDate": "2024-06-01",
"departmentHeadId": 2,
"employeeCount": 4
},
{
"id": 2,
"name": "HR",
"creationDate": "2024-06-05",
"departmentHeadId": 3,
"employeeCount": 6
},
{
"id": 3,
"name": "Finance",
"creationDate": "2024-06-10",
"departmentHeadId": 4,
"employeeCount": 7
},
{
"id": 4,
"name": "Marketing",
"creationDate": "2024-06-15",
"departmentHeadId": 5,
"employeeCount": 7
}
],
"currentPage": 0
}Request
GET /department/1
Response
{
"id": 1,
"name": "IT",
"creationDate": "2024-06-01",
"departmentHeadId": 2,
"employeeCount": 7
}Request
GET /department/1?expand=employee
Response
{
"id": 1,
"name": "IT",
"creationDate": "2024-06-01",
"departmentHeadId": 2,
"employees": [
{
"id": 2,
"name": "Manager IT",
"salary": 85000.0,
"address": "101 Tech Park, Kochi",
"role": "Manager",
"joinDate": "2021-01-10",
"dateOfBirth": "1980-03-25",
"yearlyBonusPercentage": 12.0,
"departmentId": 1,
"reportingManagerId": 1
},
{
"id": 6,
"name": "Arjun P",
"salary": 42000.0,
"address": "201 Infopark, Kochi",
"role": "Employee",
"joinDate": "2023-02-10",
"dateOfBirth": "1995-01-15",
"yearlyBonusPercentage": 5.0,
"departmentId": 1,
"reportingManagerId": 2
},
{
"id": 7,
"name": "Sneha R",
"salary": 43000.0,
"address": "202 City Lane, Kochi",
"role": "Employee",
"joinDate": "2022-11-20",
"dateOfBirth": "1996-08-25",
"yearlyBonusPercentage": 4.7,
"departmentId": 1,
"reportingManagerId": 2
},
{
"id": 8,
"name": "Vishnu D",
"salary": 44000.0,
"address": "203 IT Plaza, Kochi",
"role": "Employee",
"joinDate": "2023-04-15",
"dateOfBirth": "1994-05-10",
"yearlyBonusPercentage": 5.2,
"departmentId": 1,
"reportingManagerId": 2
}
],
"employeeCount": 4
}Request
POST localhost:8080/department
Request Body
{
"name": "UI/UX",
"creationDate": "2024-06-01",
"departmentHeadId": null
}Response
{
"id": 5,
"name": "UI/UX",
"creationDate": "2024-06-01",
"departmentHeadId": null,
"employeeCount": 0
}Request
PUT localhost:8080/department/5
Request Body
{
"name": "UI/UX Design",
"creationDate": "2024-06-01",
"departmentHeadId": null
}Response
{
"id": 5,
"name": "UI/UX Design",
"creationDate": "2024-06-01",
"departmentHeadId": null,
"employeeCount": 0
}Request
DELETE /department/5
Response
{
"message": "Department deleted successfully."
}``
Request
GET /dashboard/count
Response
{
"totalEmployees": 28,
"totalDepartments": 5
}Request
GET dashboard/role_chart
Response
[
{
"role": "Admin",
"count": 1
},
{
"role": "Manager",
"count": 4
},
{
"role": "Employee",
"count": 23
}
]Request
GET /dashboard/department_chart
Response
[
{
"departmentName": "IT",
"employeeCount": 7
},
{
"departmentName": "HR",
"employeeCount": 6
},
{
"departmentName": "Finance",
"employeeCount": 7
},
{
"departmentName": "Marketing",
"employeeCount": 7
},
{
"departmentName": "UI/UX",
"employeeCount": 0
}
]Request
GET /reporting-chains/by_role
Response
[
{
"role": "Manager",
"reportsTo": "Admin"
},
{
"role": "Employee",
"reportsTo": "Manager"
}
]Request
GET /reporting-chains/12
Response
{
"employeeId": 12,
"employeeName": "Ravi N",
"reportingChain": [
"Manager HR",
"AdminManager"
]
}