Done ticket GEPAFINBE-140

This commit is contained in:
rajesh
2025-01-13 19:17:39 +05:30
parent 6e092bd534
commit 7953ba0838
4 changed files with 27 additions and 1 deletions

View File

@@ -124,7 +124,6 @@ public class CompanyDao {
userWithCompanyEntity.setContactEmail(companyRequest.getContactEmail());
userWithCompanyEntity.setJson(Utils.convertMapIntoJsonString(companyRequest.getVatCheckResponse()) );
UserWithCompanyEntity userWithCompany = userWithCompanyRepository.save(userWithCompanyEntity);
/** This code is responsible for adding a version history log for the "adding user with company" operation. **/
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.INSERT).oldData(null).newData(userWithCompany).build());
return userWithCompany;
@@ -144,6 +143,22 @@ public class CompanyDao {
entity.setNumberOfEmployees(request.getNumberOfEmployees());
entity.setAnnualRevenue(request.getAnnualRevenue());
entity.setHub(userEntity.getHub());
Map<String, Object> vatCheckResponse = request.getVatCheckResponse();
if (request.getVatCheckResponse() != null) {
if (vatCheckResponse.containsKey("dettaglio")) {
Map<String, Object> dettaglio = (Map<String, Object>) vatCheckResponse.get("dettaglio");
if (dettaglio != null) {
if (dettaglio.containsKey("codice_ateco")) {
Object codiceAtecoObj = dettaglio.get("codice_ateco");
String codiceAteco = (codiceAtecoObj != null) ? codiceAtecoObj.toString() : null;
if (codiceAteco != null) {
entity.setCodiceAteco(codiceAteco);
}
}
}
}
}
return entity;
}
@@ -165,6 +180,7 @@ public class CompanyDao {
response.setAnnualRevenue(entity.getAnnualRevenue());
if(userWithCompanyEntity!=null) {
response.setIsLegalRepresentant(userWithCompanyEntity.getIsLegalRepresentant());
response.setCodiceAteco(entity.getCodiceAteco());
}
response.setCreatedDate(entity.getCreatedDate());
response.setUpdatedDate(entity.getUpdatedDate());