Skip to content

pjambo/human-resources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Systems Development Analyst Practical Assessment

RESTFUL API developed using Spring Boot and TDD

Endpoints

Departments

  1. Create Department
POST https://localhost:8090/departments

Payload

{
  "name" : "string"
}

Response

{
    "statusCode": 201,
    "success": true,
    "message": "Department created successfully",
    "data": {
        "id": 1,
        "name": "string",
        "status": "ACTIVE"
    }
}

  1. Retrieve Department
GET https://localhost:8090/departments/{departmentId}
Parameter Type Description
departmentId long Required. The department id

Response

{
    "statusCode": 200,
    "success": true,
    "message": "Department retrieved successfully",
    "data": {
        "id": 1,
        "name": "string",
        "status": "ACTIVE"
    }
}

  1. Get all Departments
GET https://localhost:8090/departments

Response

{
    "statusCode": 200,
    "success": true,
    "message": "Departments retrieved successfully",
    "data": [
        {
            "id": 1,
            "name": "string",
            "status": "ACTIVE"
        }
    ]
}

  1. Update Department
UPDATE https://localhost:8090/departments/{departmentId}
Parameter Type Description
departmentId long Required. The department id

Payload

{
  "name" : "string"
}

Response

{
    "statusCode": 200,
    "success": true,
    "message": "Department updated successfully",
    "data": {
        "id": 1,
        "name": "string",
        "status": "ACTIVE"
    }
}

  1. Delete Department
DELETE https://localhost:8090/departments/{departmentId}
Parameter Type Description
departmentId long Required. The department id

Response

{
    "statusCode": 200,
    "success": true,
    "message": "Department deleted successfully",
    "data": {
        "id": 1,
        "name": "string",
        "status": "DELETED"
    }
}

Employees

  1. Create Employees
POST https://localhost:8090/employees

Payload

{
	"firstName":"string",
	"lastName":"string",
	"employeeNumber":"string",
	"nationalID":"string",
	"department":{
            "id": 1
        }
}

Response

{
    "statusCode": 201,
    "success": true,
    "message": "Employee created successfully",
    "data": {
        "id": 1,
        "firstName": "string",
        "lastName": "string",
        "employeeNumber": "string",
        "nationalID": "string",
        "department": {
            "id": 1,
            "name": "string",
            "status": "ACTIVE"
        },
        "status": "ACTIVE"
    }
}

About

Systems Development Analyst Practical Assessment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages