Beneficiary GDPR

This commit is contained in:
harish
2024-10-07 18:42:59 +05:30
parent 65169e54c3
commit 654beb1c8a
6 changed files with 108 additions and 3 deletions

View File

@@ -83,6 +83,15 @@ public class UserDao {
beneficiaryEntity.setLastName(userReq.getLastName());
beneficiaryEntity.setOrganization(userReq.getOrganization());
beneficiaryEntity.setPhoneNumber(userReq.getPhoneNumber());
beneficiaryEntity.setGdprRead(userReq.getGdprRead());
beneficiaryEntity.setGdprComunicazione(userReq.getGdprComunicazione());
beneficiaryEntity.setGdprElaborazione(userReq.getGdprElaborazione());
beneficiaryEntity.setGdprMateriale(userReq.getGdprMateriale());
beneficiaryEntity.setPrivacy(userReq.getPrivacy());
beneficiaryEntity.setTerms(userReq.getTerms());
beneficiaryEntity.setOffers(userReq.getOffers());
beneficiaryEntity.setMarketing(userReq.getMarketing());
beneficiaryEntity.setThirdParty(userReq.getThirdParty());
beneficiaryEntity =beneficiaryRepository.save(beneficiaryEntity);
}
return beneficiaryEntity;
@@ -148,6 +157,14 @@ public class UserDao {
setIfUpdated(userEntity::getOrganization, userEntity::setOrganization, userReq.getOrganization());
setIfUpdated(userEntity::getAddress, userEntity::setAddress, userReq.getAddress());
setIfUpdated(userEntity::getPhoneNumber, userEntity::setPhoneNumber, userReq.getPhoneNumber());
setIfUpdated(userEntity::getDateOfBirth, userEntity::setDateOfBirth, userReq.getDateOfBirth());
setIfUpdated(userEntity.getBeneficiary()::getCodiceFiscale, userEntity.getBeneficiary()::setCodiceFiscale, userReq.getCodiceFiscale());
setIfUpdated(userEntity.getBeneficiary()::getGdprComunicazione, userEntity.getBeneficiary()::setGdprComunicazione, userReq.getGdprComunicazione());
setIfUpdated(userEntity.getBeneficiary()::getGdprElaborazione, userEntity.getBeneficiary()::setGdprElaborazione, userReq.getGdprElaborazione());
setIfUpdated(userEntity.getBeneficiary()::getGdprMateriale, userEntity.getBeneficiary()::setGdprMateriale, userReq.getGdprMateriale());
setIfUpdated(userEntity.getBeneficiary()::getMarketing, userEntity.getBeneficiary()::setMarketing, userReq.getMarketing());
setIfUpdated(userEntity.getBeneficiary()::getOffers, userEntity.getBeneficiary()::setOffers, userReq.getOffers());
setIfUpdated(userEntity.getBeneficiary()::getThirdParty, userEntity.getBeneficiary()::setThirdParty, userReq.getThirdParty());
if (userReq.getRoleId() != null) {
RoleEntity roleEntity = roleDao.validateRole(userReq.getRoleId());
setIfUpdated(userEntity::getRoleEntity, userEntity::setRoleEntity, roleEntity);
@@ -167,6 +184,7 @@ public class UserDao {
userEntity.setStatus(UserStatusEnum.ACTIVE.getValue());
userEntity.setBeneficiary(beneficiary);
if (Boolean.FALSE.equals(RoleStatusEnum.ROLE_BENEFICIARY.getValue().equals(roleEntity.getRoleType()))) {
userEntity.setFirstName(userReq.getFirstName());
userEntity.setLastName(userReq.getLastName());
userEntity.setOrganization(userReq.getOrganization());
@@ -216,6 +234,15 @@ public class UserDao {
userResponseBean.setCountry(userEntity.getBeneficiary().getCountry());
userResponseBean.setCodiceFiscale(userEntity.getBeneficiary().getCodiceFiscale());
userResponseBean.setDateOfBirth(userEntity.getBeneficiary().getDateOfBirth());
userResponseBean.setGdprRead(userEntity.getBeneficiary().getGdprRead());
userResponseBean.setGdprComunicazione(userEntity.getBeneficiary().getGdprComunicazione());
userResponseBean.setGdprElaborazione(userEntity.getBeneficiary().getGdprElaborazione());
userResponseBean.setGdprMateriale(userEntity.getBeneficiary().getGdprMateriale());
userResponseBean.setPrivacy(userEntity.getBeneficiary().getPrivacy());
userResponseBean.setTerms(userEntity.getBeneficiary().getTerms());
userResponseBean.setOffers(userEntity.getBeneficiary().getOffers());
userResponseBean.setMarketing(userEntity.getBeneficiary().getMarketing());
userResponseBean.setThirdParty(userEntity.getBeneficiary().getThirdParty());
}
return userResponseBean;
}

View File

@@ -44,4 +44,30 @@ public class BeneficiaryEntity extends BaseEntity {
@Column(name = "DATE_OF_BIRTH")
private LocalDateTime dateOfBirth;
@Column(name = "PRIVACY")
private Boolean privacy;
@Column(name = "TERMS")
private Boolean terms;
@Column(name = "GDPR_READ")
private Boolean gdprRead;
@Column(name = "MARKETING")
private Boolean marketing;
@Column(name = "OFFERS")
private Boolean offers;
@Column(name = "THIRD_PARTY")
private Boolean thirdParty;
@Column(name = "GDPR_MATERIALE")
private Boolean gdprMateriale;
@Column(name = "GDPR_ELABORAZIONE")
private Boolean gdprElaborazione;
@Column(name = "GDPR_COMUNICAZIONE")
private Boolean gdprComunicazione;
}

View File

@@ -4,6 +4,8 @@ import lombok.Getter;
import lombok.Setter;
import net.gepafin.tendermanagement.enums.UserStatusEnum;
import java.time.LocalDateTime;
@Getter
@Setter
public class UpdateUserReq {
@@ -17,4 +19,12 @@ public class UpdateUserReq {
private String city;
private UserStatusEnum status;
private String country;
private String codiceFiscale;
private LocalDateTime dateOfBirth;
private Boolean marketing;
private Boolean offers;
private Boolean thirdParty;
private Boolean gdprMateriale;
private Boolean gdprElaborazione;
private Boolean gdprComunicazione;
}

View File

@@ -31,5 +31,16 @@ public class UserReq {
private String codiceFiscale;
private LocalDateTime dateOfBirth;
private Boolean privacy;
private Boolean terms;
private Boolean gdprRead;
private Boolean marketing;
private Boolean offers;
private Boolean thirdParty;
private Boolean gdprMateriale;
private Boolean gdprElaborazione;
private Boolean gdprComunicazione;
}

View File

@@ -39,4 +39,16 @@ public class UserResponseBean extends BaseBean {
private LocalDateTime dateOfBirth;
private List<CompanyResponse> companies;
private Boolean privacy;
private Boolean terms;
private Boolean gdprRead;
private Boolean marketing;
private Boolean offers;
private Boolean thirdParty;
private Boolean gdprMateriale;
private Boolean gdprElaborazione;
private Boolean gdprComunicazione;
}

View File

@@ -879,5 +879,24 @@
<sqlFile dbms="postgresql"
path="classpath:db/dump/updated_form_field_data_03-10-2024_1.sql" />
</changeSet>
<changeSet id="07-10-2024_1" author="Harish Bagora">
<addColumn tableName="beneficiary">
<column name="PRIVACY" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="TERMS" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="GDPR_READ" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="MARKETING" type="BOOLEAN"/>
<column name="OFFERS" type="BOOLEAN"/>
<column name="THIRD_PARTY" type="BOOLEAN"/>
<column name="GDPR_MATERIALE" type="BOOLEAN"/>
<column name="GDPR_ELABORAZIONE" type="BOOLEAN"/>
<column name="GDPR_COMUNICAZIONE" type="BOOLEAN"/>
</addColumn>
</changeSet>
</databaseChangeLog>