Beneficiary GDPR
This commit is contained in:
@@ -83,6 +83,15 @@ public class UserDao {
|
|||||||
beneficiaryEntity.setLastName(userReq.getLastName());
|
beneficiaryEntity.setLastName(userReq.getLastName());
|
||||||
beneficiaryEntity.setOrganization(userReq.getOrganization());
|
beneficiaryEntity.setOrganization(userReq.getOrganization());
|
||||||
beneficiaryEntity.setPhoneNumber(userReq.getPhoneNumber());
|
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);
|
beneficiaryEntity =beneficiaryRepository.save(beneficiaryEntity);
|
||||||
}
|
}
|
||||||
return beneficiaryEntity;
|
return beneficiaryEntity;
|
||||||
@@ -148,6 +157,14 @@ public class UserDao {
|
|||||||
setIfUpdated(userEntity::getOrganization, userEntity::setOrganization, userReq.getOrganization());
|
setIfUpdated(userEntity::getOrganization, userEntity::setOrganization, userReq.getOrganization());
|
||||||
setIfUpdated(userEntity::getAddress, userEntity::setAddress, userReq.getAddress());
|
setIfUpdated(userEntity::getAddress, userEntity::setAddress, userReq.getAddress());
|
||||||
setIfUpdated(userEntity::getPhoneNumber, userEntity::setPhoneNumber, userReq.getPhoneNumber());
|
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) {
|
if (userReq.getRoleId() != null) {
|
||||||
RoleEntity roleEntity = roleDao.validateRole(userReq.getRoleId());
|
RoleEntity roleEntity = roleDao.validateRole(userReq.getRoleId());
|
||||||
setIfUpdated(userEntity::getRoleEntity, userEntity::setRoleEntity, roleEntity);
|
setIfUpdated(userEntity::getRoleEntity, userEntity::setRoleEntity, roleEntity);
|
||||||
@@ -167,6 +184,7 @@ public class UserDao {
|
|||||||
userEntity.setStatus(UserStatusEnum.ACTIVE.getValue());
|
userEntity.setStatus(UserStatusEnum.ACTIVE.getValue());
|
||||||
userEntity.setBeneficiary(beneficiary);
|
userEntity.setBeneficiary(beneficiary);
|
||||||
if (Boolean.FALSE.equals(RoleStatusEnum.ROLE_BENEFICIARY.getValue().equals(roleEntity.getRoleType()))) {
|
if (Boolean.FALSE.equals(RoleStatusEnum.ROLE_BENEFICIARY.getValue().equals(roleEntity.getRoleType()))) {
|
||||||
|
|
||||||
userEntity.setFirstName(userReq.getFirstName());
|
userEntity.setFirstName(userReq.getFirstName());
|
||||||
userEntity.setLastName(userReq.getLastName());
|
userEntity.setLastName(userReq.getLastName());
|
||||||
userEntity.setOrganization(userReq.getOrganization());
|
userEntity.setOrganization(userReq.getOrganization());
|
||||||
@@ -216,6 +234,15 @@ public class UserDao {
|
|||||||
userResponseBean.setCountry(userEntity.getBeneficiary().getCountry());
|
userResponseBean.setCountry(userEntity.getBeneficiary().getCountry());
|
||||||
userResponseBean.setCodiceFiscale(userEntity.getBeneficiary().getCodiceFiscale());
|
userResponseBean.setCodiceFiscale(userEntity.getBeneficiary().getCodiceFiscale());
|
||||||
userResponseBean.setDateOfBirth(userEntity.getBeneficiary().getDateOfBirth());
|
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;
|
return userResponseBean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,11 +37,37 @@ public class BeneficiaryEntity extends BaseEntity {
|
|||||||
|
|
||||||
@Column(name = "COUNTRY")
|
@Column(name = "COUNTRY")
|
||||||
private String country;
|
private String country;
|
||||||
|
|
||||||
@Column(name = "CODICE_FISCALE")
|
@Column(name = "CODICE_FISCALE")
|
||||||
private String codiceFiscale;
|
private String codiceFiscale;
|
||||||
|
|
||||||
@Column(name = "DATE_OF_BIRTH")
|
@Column(name = "DATE_OF_BIRTH")
|
||||||
private LocalDateTime dateOfBirth;
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import lombok.Getter;
|
|||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import net.gepafin.tendermanagement.enums.UserStatusEnum;
|
import net.gepafin.tendermanagement.enums.UserStatusEnum;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UpdateUserReq {
|
public class UpdateUserReq {
|
||||||
@@ -17,4 +19,12 @@ public class UpdateUserReq {
|
|||||||
private String city;
|
private String city;
|
||||||
private UserStatusEnum status;
|
private UserStatusEnum status;
|
||||||
private String country;
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,5 +31,16 @@ public class UserReq {
|
|||||||
private String codiceFiscale;
|
private String codiceFiscale;
|
||||||
|
|
||||||
private LocalDateTime dateOfBirth;
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,4 +39,16 @@ public class UserResponseBean extends BaseBean {
|
|||||||
private LocalDateTime dateOfBirth;
|
private LocalDateTime dateOfBirth;
|
||||||
|
|
||||||
private List<CompanyResponse> companies;
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -879,5 +879,24 @@
|
|||||||
<sqlFile dbms="postgresql"
|
<sqlFile dbms="postgresql"
|
||||||
path="classpath:db/dump/updated_form_field_data_03-10-2024_1.sql" />
|
path="classpath:db/dump/updated_form_field_data_03-10-2024_1.sql" />
|
||||||
</changeSet>
|
</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>
|
</databaseChangeLog>
|
||||||
|
|||||||
Reference in New Issue
Block a user