|
@@ -243,19 +243,19 @@ public class AccountLogicImpl implements AccountLogic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (accountVO.getUserType() == UserType.WORKER.getValue()) {
|
|
if (accountVO.getUserType() == UserType.WORKER.getValue()) {
|
|
|
- if (!EmailValidator.getInstance().isValid(accountVO.getManager().getEmail())) {
|
|
|
|
|
|
|
+ if (!EmailValidator.getInstance().isValid(accountVO.getWorker().getEmail())) {
|
|
|
throw new HttpBadRequestException("Invalid email");
|
|
throw new HttpBadRequestException("Invalid email");
|
|
|
}
|
|
}
|
|
|
- if (managerService.getManagerByEmail(accountVO.getManager().getEmail()) != null) {
|
|
|
|
|
- throw new HttpBadRequestException("Manager already exists");
|
|
|
|
|
|
|
+ if (workerService.getWorkerByEmail(accountVO.getWorker().getEmail()) != null) {
|
|
|
|
|
+ throw new HttpBadRequestException("Worker already exists");
|
|
|
}
|
|
}
|
|
|
accountVO.getWorker().setMobile(null);
|
|
accountVO.getWorker().setMobile(null);
|
|
|
} else if (accountVO.getUserType() == UserType.MANAGER.getValue()) {
|
|
} else if (accountVO.getUserType() == UserType.MANAGER.getValue()) {
|
|
|
- if (!EmailValidator.getInstance().isValid(accountVO.getWorker().getEmail())) {
|
|
|
|
|
|
|
+ if (!EmailValidator.getInstance().isValid(accountVO.getManager().getEmail())) {
|
|
|
throw new HttpBadRequestException("Invalid email");
|
|
throw new HttpBadRequestException("Invalid email");
|
|
|
}
|
|
}
|
|
|
- if (workerService.getWorkerByEmail(accountVO.getWorker().getEmail()) != null) {
|
|
|
|
|
- throw new HttpBadRequestException("Worker already exists");
|
|
|
|
|
|
|
+ if (managerService.getManagerByEmail(accountVO.getManager().getEmail()) != null) {
|
|
|
|
|
+ throw new HttpBadRequestException("Manager already exists");
|
|
|
}
|
|
}
|
|
|
accountVO.getManager().setMobile(null);
|
|
accountVO.getManager().setMobile(null);
|
|
|
} else {
|
|
} else {
|