Backend Practical
Backend Practical
● The database should be file(s) within the project (e.g. txt, json )
● 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.
URL /employees
Request Body {
"firstName": "Mussie",
"lastName": "G.michael",
"dateOfBirth": "2000-01-01",
"salary": "1000",
"joinDate": "2023-05-18",
"departement": "IT"
Response {
"id": 1
URL /employees/{id}
Response Body {
"id": 1,
"firstName": "Mussie",
"lastName": "G.ebrael",
"dateOfBirth": "2000-01-01",
"salary": "1000",
"joinDate": "2023-05-18",
"departement": "IT"
URL /employees?name={name}&fromSalary={fromSalary}
&toSalary={toSalary}
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"