-
Annual Paid Leave Policy:
-
To be eligible for annual paid leave, an employee must have worked at least one year in our company. Each year, employees earn leave days based on their length of service, as shown in the table below:
Length of Service Annual Leave (Business Days/Year) From 1 year up to (and including) 5 years 15 More than 5 years up to (and including) 10 years 18 More than 10 years 24 - Weekends (Saturday, Sunday) and official holidays do not count towards leave days.
- New hires can use up to 5 business days as advanced leave during their first year. This applies only to the first year of employment.
- When a future-dated leave request is submitted, the requested days are deducted from the employee’s available leave balance.
- Employees cannot request more leave than their remaining leave balance.
- When a leave request is created, it is initially in the “Pending Approval” status. After managerial review, it is either “Approved” or “Rejected.”
-
To be eligible for annual paid leave, an employee must have worked at least one year in our company. Each year, employees earn leave days based on their length of service, as shown in the table below:
Endpoints Summary
Method | Url | Description | Request Body | Path Variable | Response |
---|---|---|---|---|---|
POST | /api/v1/authentication/user/register | Register for Admin or User | RegisterRequest | CustomResponse<Void> | |
POST | /api/v1/authentication/user/login | Login for Admin or User | LoginRequest | CustomResponse<TokenResponse> | |
POST | /api/v1/authentication/user/refresh-token | Refresh Token for Admin or User | TokenRefreshRequest | CustomResponse<TokenResponse> | |
POST | /api/v1/authentication/user/logout | Logout for Admin or User | TokenInvalidateRequest | CustomResponse<Void> | |
POST | /api/v1/leaverequests | Create a new leave request | CreateLeaveRequest | - | CustomResponse<LeaveRequestResponse> |
GET | /api/v1/leaverequests/{id} | Retrieve leave request by ID | - | id (UUID) | CustomResponse<LeaveRequestResponse> |
GET | /api/v1/leaverequests/users/{userId} | Retrieve paginated leave requests for a user | LeaveRequestPagingRequest | userId | CustomResponse<CustomPagingResponse<LeaveRequestResponse>> |
PATCH | /api/v1/leaverequests/{leaveRequestId}/status | Update the status of a leave request | Query Parameter: status (LeaveStatus) | leaveRequestId | CustomResponse<LeaveRequestResponse> |
GET | /api/v1/leaverequests/remaining/{userId} | Retrieve remaining leave days for a user | - | userId (UUID) | CustomResponse<Long> |
- Java 21
- Spring Boot 3.0
- Restful API
- Open Api (Swagger)
- Maven
- Junit5
- Mockito
- Integration Tests
- Docker
- Docker Compose
- CI/CD (Github Actions)
- Postman
- Prometheus
- Grafana
- Kubernetes
- JaCoCo (Test Report)
Import postman collection under postman_collection folder
WORK_PERMISSION_DB_IP=localhost
WORK_PERMISSION_DB_PORT=3306
DATABASE_USERNAME={MY_SQL_DATABASE_USERNAME}
DATABASE_PASSWORD={MY_SQL_DATABASE_PASSWORD}
http://localhost:2552/swagger-ui/index.html
After the command named mvn clean install
completes, the JaCoCo report will be available at:
target/site/jacoco/index.html
Navigate to the target/site/jacoco/
directory.
Open the index.html
file in your browser to view the detailed coverage report.
To build and run the application with Maven
, please follow the directions shown below;
$ cd pdfcompare
$ mvn clean install
$ mvn spring-boot:run
The application can be built and run by the Docker
engine. The Dockerfile
has multistage build, so you do not need to build and run separately.
Please follow directions shown below in order to build and run the application with Docker Compose file;
$ cd pdfcompare
$ docker-compose up -d
If you change anything in the project and run it on Docker, you can also use this command shown below
$ cd pdfcompare
$ docker-compose up --build
To monitor the application, you can use the following tools:
-
Prometheus:
Open in your browser at http://localhost:9090
Prometheus collects and stores application metrics. -
Grafana:
Open in your browser at http://localhost:3000
Grafana provides a dashboard for visualizing the metrics.
Default credentials:- Username:
admin
- Password:
admin
- Username:
-
Define prometheus data source url, use this link shown below
http://prometheus:9090
To build and run the application with Maven
, please follow the directions shown below;
- Start Minikube
$ minikube start
- Open Minikube Dashboard
$ minikube dashboard
- To deploy the application on Kubernetes, apply the Kubernetes configuration file underneath k8s folder
$ kubectl apply -f k8s
- To open Prometheus, click tunnel url link provided by the command shown below to reach out Prometheus
minikube service prometheus-service
- To open Grafana, click tunnel url link provided by the command shown below to reach out Prometheus
minikube service grafana-service
- Define prometheus data source url, use this link shown below
http://prometheus-service.default.svc.cluster.local:9090
https://hub.docker.com/repository/docker/noyandocker/workpermission/general