0% found this document useful (0 votes)
6 views3 pages

Backend Practical

The document outlines the requirements for a backend practical project involving a microservice with three RESTful APIs to manage an employee database. The APIs include creating an employee, retrieving an employee by ID, and retrieving employees with optional query parameters for name and salary range. The database should be stored as files within the project, and the final result must be shared via a GitHub link.

Uploaded by

liqetech
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Backend Practical

The document outlines the requirements for a backend practical project involving a microservice with three RESTful APIs to manage an employee database. The APIs include creating an employee, retrieving an employee by ID, and retrieving employees with optional query parameters for name and salary range. The database should be stored as files within the project, and the final result must be shared via a GitHub link.

Uploaded by

liqetech
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Backend Practical

● The microservice should include 3 Restful APIs to manage employees database.

● The database should be file(s) within the project (e.g. txt, json )

● The result should be pushed to your Github and link to be shared.

● APIs
o Create Employee API
▪ Insert a new employee in the database.
o Get Employee by Id API
▪ Retrieve employees’ details by Id
o Get Employees API
▪ The query parameters are optional (name & fromSalary & toSalary)

▪ If the name parameter is passed, the api should search for all employees that
their first name or last name contains the search text.
▪ If fromSalary or toSalary or both passed, consider the following.

● fromSalary only 🡪 Retrieve all employees who have salary >=


fromSalary
● toSalary only 🡪 Retrieve all employees who have salary <= toSalary

● Both 🡪 Retrieve all employees who have salary between fromSalary


and toSalary inclusive.

1. API Create Employee API

URL /employees

Http Method POST

Request Body {
"firstName": "Mussie",

"lastName": "G.michael",

"dateOfBirth": "2000-01-01",

"salary": "1000",
"joinDate": "2023-05-18",

"departement": "IT"

Response {
"id": 1

2. API Get Employee By Id API

URL /employees/{id}

Http Method GET

Response Body {
"id": 1,

"firstName": "Mussie",

"lastName": "G.ebrael",

"dateOfBirth": "2000-01-01",

"salary": "1000",

"joinDate": "2023-05-18",

"departement": "IT"

3. API Get Employees

URL /employees?name={name}&fromSalary={fromSalary}

&toSalary={toSalary}

Http Method GET

Response Body [{
"id": 1,

"firstName": "Mussie",

"lastName": "G.michael",

"dateOfBirth": "2000-01-01",

"salary": "1000",

"joinDate": "2023-05-18",
"departement": "IT"

},

{
"id": 2,

"firstName": "Merhawi",

"lastName": "Tsegay",

"dateOfBirth": "1990-01-01",

"salary": "2000",

"joinDate": "2016-03-18",

"departement": "Business"

You might also like