refactor: login by email (loginId kept as internal identifier)
This commit is contained in:
@@ -76,10 +76,9 @@ public class EmployeeService {
|
||||
|
||||
@Transactional
|
||||
public Employee create(Employee employee) {
|
||||
if (employeeRepository.findByLoginId(employee.getLoginId()).isPresent()) {
|
||||
if (employee.getEmail() != null && employeeRepository.findByEmail(employee.getEmail()).isPresent()) {
|
||||
throw new BusinessException(ErrorCode.DUPLICATE_LOGIN_ID);
|
||||
}
|
||||
|
||||
if (employee.getRoleCode() == null) employee.setRoleCode(RoleCode.EMPLOYEE);
|
||||
if (employee.getEmpStatus() == null) employee.setEmpStatus(EmpStatus.ACTIVE);
|
||||
if (employee.getDispatchStatus() == null) employee.setDispatchStatus(DispatchStatus.WAITING);
|
||||
|
||||
Reference in New Issue
Block a user