Commit 3a861909 authored by Deep Dey's avatar Deep Dey

feat: add check for father email only if not twin child

parent db6b2710
...@@ -29,12 +29,14 @@ public class AdmissionFormDAOController { ...@@ -29,12 +29,14 @@ public class AdmissionFormDAOController {
public boolean addNewAdmissionData(@NotNull AdmissionFormData formData) throws Exception { public boolean addNewAdmissionData(@NotNull AdmissionFormData formData) throws Exception {
if (formData.isCheckFatherEmail()) {
List<AdmissionFormData> data = admissionFormDataRepository List<AdmissionFormData> data = admissionFormDataRepository
.getAdmissionFormDataByEmail(formData.getFatherEmail()); .getAdmissionFormDataByEmail(formData.getFatherEmail());
if (!data.isEmpty()) { if (!data.isEmpty()) {
throw new Exception("Father's Email already Exists"); throw new Exception("Father's Email already Exists");
} }
}
formData.setCandidateImageName( formData.setCandidateImageName(
fileStorageService.storeFile( fileStorageService.storeFile(
......
...@@ -102,4 +102,6 @@ public class AdmissionFormData { ...@@ -102,4 +102,6 @@ public class AdmissionFormData {
private String motherImageName; private String motherImageName;
private String interactionDate; private String interactionDate;
private String interactionTime; private String interactionTime;
private boolean checkFatherEmail;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment