Skip to content

Commit

Permalink
............
Browse files Browse the repository at this point in the history
  • Loading branch information
precious authored and precious committed Mar 30, 2022
1 parent 6b77db1 commit 9a4c67a
Show file tree
Hide file tree
Showing 18 changed files with 0 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package africa.semicolon.employeemanagement.data.dto.response;

import africa.semicolon.employeemanagement.data.model.Level;
import africa.semicolon.employeemanagement.data.model.Role;

import java.time.LocalDateTime;

Expand All @@ -10,6 +9,5 @@ public class DepartmentResponse {
private String fieldName;
private String description;
private Level employeeJobLevel;
private Role jobRole;
private LocalDateTime creationDate;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package africa.semicolon.employeemanagement.data.dto.response;

import africa.semicolon.employeemanagement.data.model.Level;
import africa.semicolon.employeemanagement.data.model.Role;
import lombok.*;

import java.time.LocalDateTime;
Expand All @@ -21,7 +20,6 @@ public class EmployeeResponse {
private String departmentName;
private Integer employeeSalary;
private Level employeeJobLevel;
private Role jobRole;
private Boolean isSuspended;
private LocalDateTime creationDate;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ public class Employee {
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.PERSIST)
private Level employeeJobLevel;

@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.PERSIST)
private Role jobRole;

@OneToMany
private List<Qualification> employeeQualifications;
private Boolean isSuspended = false;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public interface EmployeeService {
EmployeeResponse updateEmployeeSalaryByJobLevel(Long employeeId) throws EmployeeDoesNotExistsException;
Employee activateSuspendEmployeeByEmployeeId(Long employeeId) throws EmployeeDoesNotExistsException;
Employee deactivateSuspendEmployeeByEmployeeId(Long employeeId) throws EmployeeDoesNotExistsException;
Employee setEmployeeRoleByEmployeeId(Long employeeId, RoleRequest request) throws EmployeeDoesNotExistsException;
Employee setEmployeeQualificationByEmployeeId(Long employeeId, QualificationRequest request) throws EmployeeDoesNotExistsException;
Employee updateEmployee(String email, JsonPatch jsonpatch) throws EmployeeDoesNotExistsException, JsonPatchException, JsonProcessingException, EmployeeRequestException;
String deleteAllEmployees();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,6 @@ public Employee deactivateSuspendEmployeeByEmployeeId(Long employeeId) throws Em
return employee;
}

@Override
public Employee setEmployeeRoleByEmployeeId(Long employeeId, RoleRequest request) throws EmployeeDoesNotExistsException {
Employee employee = employeeRepository.findById(employeeId).orElse(null);
if (employee == null) throw new EmployeeDoesNotExistsException("Employee with this "+ employeeId+" employee id does not exist");

Role role = mapper.map(request, Role.class);
return employee = Employee.builder()
.jobRole(role)
.build();
}

@Override
public Employee setEmployeeQualificationByEmployeeId(Long employeeId, QualificationRequest request) throws EmployeeDoesNotExistsException {
Employee employee = employeeRepository.findById(employeeId).orElse(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,6 @@ public ResponseEntity<?> deactivateSuspendEmployeeByEmployeeId(@PathVariable Lon
}
}

@PostMapping(value = "/employee_role/{employeeId}")
public ResponseEntity<?> setEmployeeRoleByEmployeeId(@PathVariable Long employeeId, @RequestBody RoleRequest request){
try{
Employee employee = employeeService.setEmployeeRoleByEmployeeId(employeeId, request);
return ResponseEntity.ok().body(employee);
}catch (EmployeeDoesNotExistsException e){
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(e.getMessage());
}
}

@PostMapping(value = "/employee_qualification/{employeeId}")
public ResponseEntity<?> setEmployeeQualificationByEmployeeId(@PathVariable Long employeeId, @RequestBody QualificationRequest request){
try{
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 9a4c67a

Please sign in to comment.