Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DaphOS Time Tracking API

A minimal REST API built with Spring Boot to manage employees and their working times in healthcare facilities. Supports CRUD operations, simple validation, and overlapping shift checks.

Stack

  • Java 17
  • Spring Boot 3.5.7
  • Gradle
  • H2 in-memory database
  • JUnit 5, Mockito
  • Lombok

Setup

1. Run the application in your IDE or using Gradle:

./gradlew bootRun

2. Example Requests

The following example requests are provided in a format suitable for Postman and other HTTP clients.

Employee API

Create an employee
POST /api/employees
Content-Type: application/json

{
  "name": "Anna",
  "role": "DOCTOR"
}
Get employee by ID
GET /api/employees/1
Get employee by name
GET /api/employees?name=Anna
Get all employees by role
GET /api/employees?role=DOCTOR
Update employee
PUT /api/employees/1
Content-Type: application/json

{
  "name": "Anna Weber",
  "role": "DOCTOR"
}

WorkingTime API

Create a working time
POST /api/working-times
Content-Type: application/json

{
  "employeeId": 1,
  "startTime": "2025-11-16T09:00:00",
  "endTime": "2025-11-16T17:00:00"
}
Get working time by ID
GET /api/working-times/1
Get all working times for an employee
GET /api/working-times/employee/1
Update working time
PUT /api/working-times/1
Content-Type: application/json

{
  "employeeId": 1,
  "startTime": "2025-11-16T10:00:00",
  "endTime": "2025-11-16T18:00:00"
}

3. Run tests in your IDE or using Gradle:

./gradlew test

About

DaphOS Coding Challenge Backend

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages