Done ticket GEPAFINBE-76

This commit is contained in:
nisha
2025-03-10 20:02:37 +05:30
parent f272d6508b
commit 1c330ff713
21 changed files with 152 additions and 49 deletions

View File

@@ -169,7 +169,7 @@ public class UserDao {
}
private BeneficiaryEntity createBeneficiary(RoleEntity roleEntity, UserReq userReq, HubEntity hub) {
BeneficiaryEntity beneficiaryEntity = null;
if (RoleStatusEnum.ROLE_BENEFICIARY.getValue().equals(roleEntity.getRoleType())) {
if (RoleStatusEnum.ROLE_BENEFICIARY.getValue().equals(roleEntity.getRoleType()) || RoleStatusEnum.ROLE_CONFIDI.getValue().equals(roleEntity.getRoleType())) {
beneficiaryEntity = new BeneficiaryEntity();
beneficiaryEntity.setAddress(userReq.getAddress());
beneficiaryEntity.setCity(userReq.getCity());
@@ -765,7 +765,7 @@ public class UserDao {
HubEntity hubEntity = hubService.valdateHub(userEntity.getHub().getId());
String beneficiaryRoleType = RoleStatusEnum.ROLE_BENEFICIARY.getValue();
if (validator.checkIsBeneficiary()) {
if (Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) {
// Validate if the new email already exists for another beneficiary in the same hub
boolean emailExistsForBeneficiary = userRepository.existsByEmailIgnoreCaseForBeneficiaries(
userReq.getEmail(), hubEntity.getUniqueUuid(), beneficiaryRoleType);