Commit 28d15f1f authored by Syed Asif's avatar Syed Asif

update method changes done

parent c12f8cc5
...@@ -66,6 +66,12 @@ public class ProfileServiceImpl implements ProfileService { ...@@ -66,6 +66,12 @@ public class ProfileServiceImpl implements ProfileService {
if (profileDto == null) { if (profileDto == null) {
return Mono.error(new RuntimeException("Profile Should Not be NULL")); return Mono.error(new RuntimeException("Profile Should Not be NULL"));
} }
boolean isValidPan = Utils.builder().build().isValidPanCard(profileDto.getPermanentAccountNumber());
boolean isValidAadhar = Utils.builder().build().isValidAadhar(profileDto.getAdharNumber());
if (isValidPan || isValidAadhar) {
return findOne(profileDto.getProfileId()).flatMap(existingProfileDto -> { return findOne(profileDto.getProfileId()).flatMap(existingProfileDto -> {
if ("ACTIVE".equals(existingProfileDto.getStatus())) { if ("ACTIVE".equals(existingProfileDto.getStatus())) {
...@@ -80,6 +86,9 @@ public class ProfileServiceImpl implements ProfileService { ...@@ -80,6 +86,9 @@ public class ProfileServiceImpl implements ProfileService {
} }
}); });
} else {
return Mono.error(new BusinessException(HttpStatus.BAD_REQUEST, "Invalid PAN or Aadhar Number"));
}
} }
......
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