refactor: login by email (loginId kept as internal identifier)

This commit is contained in:
pray4skylark
2026-06-08 15:48:22 +09:00
parent 4a0c3ed278
commit ca444a3b4f
10 changed files with 34 additions and 31 deletions
@@ -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);