This app represents relationships between models - it provides statistics on departmental employee data: Expenses/department; Average salary/department; Employee count/department, etc.
Two teams work are on the app: The backend team is responsible for maintaining microservices; The frontend team develops UIs.
The application aims to able to provide support for
- Add / Update / Delete Departments
- Add / Update / Delete Employees
- Employee salary management
- Graphical representation of departmental dashboards:
Expenses/department; Average salary/department; Employee count/department, etc.
Changes
- Created Department Controller
- Created Employee Controller
- Finished implementation of Account Statistics Controller
- Properly Decorated Entities
- Created view entities to display data
- Created Salary Repository
- Created Salary Component Repository
- Created commands to initialize database for application
- Added insomnia requests to test application
- Added unit tests for controllers
- Added unit tests for services
SalaryComponent is dependent upon base salary and can be calculated as baseSalary multiplied by respective factor. i.e.
SalaryComponent_amount = baseSalary * factor;
Actual salary can be calculated as sum of all SalaryComponent amounts.
Salary_amount = Sum of all SalaryComponent_amounts;
Environment setup needed to work on the codebase:
- Java 8
- Git
- Maven
- Any IDE (IntelliJ / Eclipse / VS Code)
Note: All required dependencies (ex. spring boot, data jpa, h2, etc) are already added to the POM.
- Clone app using this CLI command: git clone https://github.com/inoptradigital/employee-department-demo.git
- Import the project into your IDE, then build it.
- Run the spring boot app - fix any exceptions.
- At this point, the spring boot app should be in a running state, free of exceptions.
- Open h2 console - http://www.h2database.com/html/quickstart.html - and login (basic h2 properties have been set within the app).
Build
mvn clean install
Test
mvn clean test
Setup
- Open h2 console, use the commands provided in
resources/init.sql
file to create the database structures. - run
mvn spring-boot:run
to run the application - Download Insomnia to test the application endpoints
- Import the requests located in
resources/insomnia_requests.json