Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raaz2/tci-assignment
This project is a Spring Boot application designed to manage employees and departments within a company.
https://github.com/raaz2/tci-assignment
gradle java mysql spring-boot
Last synced: 13 days ago
JSON representation
This project is a Spring Boot application designed to manage employees and departments within a company.
- Host: GitHub
- URL: https://github.com/raaz2/tci-assignment
- Owner: Raaz2
- Created: 2024-06-15T07:17:25.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-15T11:58:54.000Z (7 months ago)
- Last Synced: 2024-11-10T15:46:35.422Z (2 months ago)
- Topics: gradle, java, mysql, spring-boot
- Language: Java
- Homepage: https://drive.google.com/file/d/1BVNapkOTZksyWfFQsPYq1e1y4W5HVisG/view?usp=sharing
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Employee Management System
This project is a Spring Boot application designed to manage employees and departments within a company. It provides RESTful APIs for adding employees and retrieving eligible employees for bonuses based on specific criteria.
## Features
- **Add Employees**: Endpoint to add multiple employees in bulk.
- **Retrieve Eligible Employees**: Endpoint to fetch employees eligible for bonuses based on a given date.
- **Department Management**: Supports associating employees with departments.
- **Error Handling**: Provides basic error handling for unexpected scenarios.## Technologies Used
- **Spring Boot**: Framework for creating production-grade Spring-based applications.
- **Spring Data JPA**: Simplifies the implementation of data access layer.
- **MySQL Database**: SQL database for development and testing purposes.
- **Lombok**: Java library to reduce boilerplate code.
- **JUnit 5**: Testing framework for unit testing.## Project Structure
- **Controller Layer**: Handles incoming HTTP requests and delegates business logic to the service layer.
- **Service Layer**: Contains business logic, interacts with repositories for data access.
- **Model Layer**: Defines entities (`Employee` and `Department`) and their relationships.
- **Exception Handling**: Basic exception handling for better error reporting.## Setup
To run this project locally, follow these steps:
1. **Clone the repository**:
```bash
git clone
cd employee-management-system
```2. **Build the project**:
```bash
./gradlew build
```3. **Run the application**:
```bash
./gradlew bootRun
```
The application will start on `http://localhost:8080`.4. **Access API endpoints**:
- Add employees: `POST http://localhost:8080/tci/employee-bonus`
- Get eligible employees: `GET http://localhost:8080/tci/employee-bonus?date=`## API Documentation
- **POST `/tci/employee-bonus`**
- Request Body: JSON payload with a key `"employees"` containing a list of employees.
- Response: Returns status `201 Created` on success or `400 Bad Request` if the payload is invalid.- **GET `/tci/employee-bonus?date=`**
- Query Parameters: `date` (required) - Date string in format `"MMM-dd-yyyy"`.
- Response: Returns JSON formatted response with eligible employees categorized by currency. Possible status codes: `200 OK` or `500 Internal Server Error`.## Additional Notes
- Ensure the date format for the `date` query parameter in the GET request (`MMM-dd-yyyy`) matches the expected format.
- Error handling is currently minimal and can be extended based on specific use cases and exceptions encountered.