Resolved Conflicts

This commit is contained in:
Piyush
2025-03-17 16:43:26 +05:30
49 changed files with 594 additions and 107 deletions

View File

@@ -0,0 +1,18 @@
package net.gepafin.tendermanagement.config;
import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Converter;
import java.sql.Time;
import java.time.LocalTime;
@Converter(autoApply = true)
public class LocalTimeAttributeConverter implements AttributeConverter<LocalTime, Time> {
@Override
public Time convertToDatabaseColumn(LocalTime localTime) {
return (localTime == null ? null : Time.valueOf(localTime));
}
@Override
public LocalTime convertToEntityAttribute(Time sqlTime) {
return (sqlTime == null ? null : sqlTime.toLocalTime());
}
}

View File

@@ -1,8 +1,12 @@
package net.gepafin.tendermanagement.config;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import java.util.Locale;
@Configuration
public class MessageSourceConfig {
@@ -14,4 +18,12 @@ public class MessageSourceConfig {
messageSource.setUseCodeAsDefaultMessage(true);
return messageSource;
}
@Bean
public LocaleResolver localeResolver() {
// Force the locale resolver to always use Italian
SessionLocaleResolver localeResolver = new SessionLocaleResolver();
localeResolver.setDefaultLocale(Locale.ITALIAN);
return localeResolver;
}
}

View File

@@ -485,10 +485,11 @@ public class GepafinConstant {
public static final String USAGE="usage";
public static final String LIMIT="limit";
public static final String DATA="data";
public static final String FILE_SELECT = "fileselect";
public static final String INVALID_LIMIT = "error.invalid.limit";
public static final String PREFERRED_CALL_ID="preferredCallId";
public static final String REGION_ID="regionId";
public static final String DELEGATION_TEMPLATE_CONFIDI="DELEGATION_TEMPLATE_CONFIDI";
public static final String EMAIL_SUPPORT = "email_support";
public static final String PHONE_SUPPORT = "phone_support";

View File

@@ -181,6 +181,7 @@ public class ApplicationAmendmentRequestDao {
for (ApplicationFormEntity form : forms) {
String content = form.getForm().getContent();
List<Map<String, Object>> result = filterByName(content, "fileupload");
result.addAll(filterByName(content, GepafinConstant.FILE_SELECT));
List<AmendmentFormFieldResponse> amendmentFormFieldResponses= getIdAndLabelFromResult(result);
amendmentFormFieldResponses.removeIf(amendmentFormFieldResponse -> {
FieldRequest matchingRequest = fieldRequestMap.get(amendmentFormFieldResponse.getFieldId());
@@ -538,7 +539,10 @@ public class ApplicationAmendmentRequestDao {
return forms.stream()
.flatMap(form -> {
String content = form.getForm().getContent();
return getIdAndLabelFromResult(filterByName(content, "fileupload")).stream();
List<Map<String, Object>> filteredResults = new ArrayList<>();
filteredResults.addAll(filterByName(content, "fileupload"));
filteredResults.addAll(filterByName(content, GepafinConstant.FILE_SELECT));
return getIdAndLabelFromResult(filteredResults).stream();
})
.collect(Collectors.toMap(AmendmentFormFieldResponse::getFieldId, AmendmentFormFieldResponse::getLabel));
}
@@ -678,7 +682,7 @@ public class ApplicationAmendmentRequestDao {
log.info("Updating application amendement with ID: {}", id);
ApplicationAmendmentRequestEntity existingApplicationAmendment = validateApplicationAmendmentRequest(id);
Boolean isBeneficiary=false;
if (Boolean.FALSE.equals(validator.checkIsBeneficiary())) {
if (Boolean.FALSE.equals(validator.checkIsBeneficiary()) && Boolean.FALSE.equals(validator.checkIsConfidi()) ) {
validator.validatePreInstructor(request, existingApplicationAmendment.getApplicationEvaluationEntity().getUserId());
isBeneficiary=false;
} else {
@@ -1368,10 +1372,10 @@ public class ApplicationAmendmentRequestDao {
.toList();
predicates.add(root.get(GepafinConstant.STATUS).in(statusValues));
}
if(Boolean.TRUE.equals(validator.checkIsBeneficiary())) {
if(Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) {
predicates.add(root.get("applicationEvaluationEntity").get("assignedApplicationsEntity").get("application").get("userId").in(userId));
}
if (Boolean.FALSE.equals(validator.checkIsBeneficiary())) {
else {
predicates.add(root.get("applicationEvaluationEntity").get("assignedApplicationsEntity").get("userId").in(userId));
}

View File

@@ -389,7 +389,7 @@ public class ApplicationDao {
return (root, query, builder) -> {
Boolean isBeneficiary = validator.checkIsBeneficiary();
Predicate predicate = builder.isFalse(root.get("isDeleted"));
if (isBeneficiary) {
if (Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) {
predicate = builder.and(predicate, builder.equal(root.get("userId"), userEntity.getId()));
}
if (callId != null) {
@@ -742,7 +742,7 @@ public class ApplicationDao {
List<FormApplicationResponse> formApplicationResponses = new ArrayList<>();
List<FormEntity> formEntities = new ArrayList<>();
UserEntity userEntity = validator.validateUser(request);
boolean isBeneficiary = isBeneficiary(userEntity);
boolean isBeneficiary = Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi());
ApplicationEntity applicationEntity = isBeneficiary
? applicationRepository.findByIdAndUserIdAndIsDeletedFalse(applicationId, userEntity.getId())
.orElseThrow(() -> new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.APPLICATION_NOT_FOUND_MSG)))
@@ -1530,8 +1530,8 @@ public class ApplicationDao {
}
List<Predicate> predicates = new ArrayList<>();
Boolean isBeneficiary = validator.checkIsBeneficiary();
if (isBeneficiary) {
// Boolean isBeneficiary = validator.checkIsBeneficiary();
if (Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) {
predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.USER_ID), userEntity.getId()));
}
if (year != null && year > 0) {

View File

@@ -378,6 +378,9 @@ public class ApplicationEvaluationDao {
case "fileupload":
mapFileFieldDetails(mappedField, formFieldId, applicationForm.getId(), applicationId);
break;
case "fileselect":
mapFileFieldDetails(mappedField, formFieldId, applicationForm.getId(), applicationId);
break;
case "checkboxes":
populateOptionFieldsAsFieldValue(mappedField, formFieldId, applicationForm, applicationId, contentBean);
break;
@@ -516,7 +519,7 @@ public class ApplicationEvaluationDao {
List<ContentResponseBean> contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent();
contentResponseBeans.forEach(contentResponseBean -> {
// Check if this is a file upload field that matches the current field response
if ("fileupload".equals(contentResponseBean.getName()) && contentResponseBean.getId().equals(fieldResponse.getId())) {
if (("fileupload".equals(contentResponseBean.getName()) || GepafinConstant.FILE_SELECT.equals(contentResponseBean.getName())) && contentResponseBean.getId().equals(fieldResponse.getId())) {
String label = null;
// Set the label if available
if (contentResponseBean.getSettings() != null) {
@@ -742,7 +745,7 @@ public class ApplicationEvaluationDao {
applicationAmendmentRequestEntities.forEach(applicationAmendmentRequestEntity->{
ApplicationAmendmentRequestEntity oldEntity = Utils.getClonedEntityForData(applicationAmendmentRequestEntity);
updateAmendment(applicationAmendmentRequestEntity, amendmentFormFieldsMap.get(applicationAmendmentRequestEntity.getId()));
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().actionType(VersionActionTypeEnum.UPDATE).oldData(oldEntity).newData(applicationAmendmentRequestEntity).build());
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldEntity).newData(applicationAmendmentRequestEntity).build());
});
applicationAmendmentRequestRepository.saveAll(applicationAmendmentRequestEntities);
@@ -884,8 +887,10 @@ public class ApplicationEvaluationDao {
amendmentFormField.setValid(amendmentDetailsRequest.getValid());
}
});
if(Boolean.FALSE.equals(CollectionUtils.isEmpty(formFieldsMap))) {
applicationAmendmentRequestEntity.setFormFields(Utils.convertListToJsonString(formFieldsMap.values().stream().toList()));
}
}
// private void updateAmendmentDocuments(List<ApplicationAmendmentRequestEntity> applicationAmendmentRequestEntities, List<AmendmentDetailsRequest> amendmentFormFields) {
@@ -1252,7 +1257,9 @@ public class ApplicationEvaluationDao {
case "fileupload":
populateFileDetailsAsFieldValue(mappedField, formFieldId, applicationForm, applicationId);
break;
case "fileselect":
populateFileDetailsAsFieldValue(mappedField, formFieldId, applicationForm, applicationId);
break;
case "checkboxes":
populateOptionFieldsAsFieldValue(mappedField, formFieldId, applicationForm, applicationId, contentResponseBean);
break;
@@ -1402,7 +1409,7 @@ public class ApplicationEvaluationDao {
// List<ContentResponseBean> contentResponseBeans = Utils.convertJsonStringToList(formEntity.getContent(), ContentResponseBean.class);
List<ContentResponseBean> contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent();
contentResponseBeans.forEach(contentResponseBean -> {
if ("fileupload".equals(contentResponseBean.getName()) && contentResponseBean.getId().equals(fieldResponse.getId())) {
if (("fileupload".equals(contentResponseBean.getName()) || GepafinConstant.FILE_SELECT.equals(contentResponseBean.getName())) && contentResponseBean.getId().equals(fieldResponse.getId())) {
String label = null;
if (contentResponseBean.getSettings() != null) {
for (SettingResponseBean setting : contentResponseBean.getSettings()) {
@@ -1564,9 +1571,10 @@ public class ApplicationEvaluationDao {
mappedField.setFieldName(contentResponseBean.getName());
boolean isCheckbox = "checkboxes".equals(contentResponseBean.getName());
boolean isFileUpload = "fileupload".equals(contentResponseBean.getName());
boolean isFileSelect = GepafinConstant.FILE_SELECT.equals(contentResponseBean.getName());
boolean isParagraph = "paragraph".equals(contentResponseBean.getName());
boolean isTable = "table".equals(contentResponseBean.getName());
if (isFileUpload) {
if (isFileUpload || isFileSelect ) {
handleFileUpload(applicationId, criteriaFormField, mappedField);
} else if (isCheckbox) {
handleCheckbox(applicationId, criteriaFormField, contentResponseBean, mappedField);
@@ -1773,7 +1781,7 @@ public class ApplicationEvaluationDao {
List<ContentResponseBean> contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent();
for (ContentResponseBean contentResponseBean : contentResponseBeans) {
if ("fileupload".equals(contentResponseBean.getName())) {
if ("fileupload".equals(contentResponseBean.getName()) || GepafinConstant.FILE_SELECT.equals(contentResponseBean.getName())) {
String fieldId = contentResponseBean.getId();
Long applicationFormId = applicationForm.getId();
@@ -2103,7 +2111,8 @@ public class ApplicationEvaluationDao {
List<ContentResponseBean> contentResponseBeans=evaluationFormDao.convertEvaluationFormEntityToEvaluationFormResponseBean(evaluationFormEntity).getContent();
for (ContentResponseBean contentResponseBean:contentResponseBeans){
if(Boolean.TRUE.equals(contentResponseBean.getName().equals("fileupload"))) {
if(Boolean.TRUE.equals(contentResponseBean.getName().equals("fileupload")) ||
Boolean.TRUE.equals(contentResponseBean.getName().equals(GepafinConstant.FILE_SELECT))){
if (contentResponseBean.getId().equals(applicationFormFieldRequestBean.getFieldId())) {
Object fieldValueObject = applicationFormFieldRequestBean.getFieldValue();
if (fieldValueObject instanceof String) {
@@ -2128,7 +2137,8 @@ public class ApplicationEvaluationDao {
for (ApplicationEvaluationFormFieldEntity applicationEvaluationFormFieldEntity : evaluationFormFieldEntities) {
Optional<ContentResponseBean> fileUploadContent = contentResponseBeans.stream()
.filter(contentResponseBean -> "fileupload".equals(contentResponseBean.getName()) &&
.filter(contentResponseBean -> ("fileupload".equals(contentResponseBean.getName()) ||
GepafinConstant.FILE_SELECT.equals(contentResponseBean.getName())) &&
contentResponseBean.getId().equals(applicationEvaluationFormFieldEntity.getFieldId()))
.findFirst();

View File

@@ -214,6 +214,7 @@ public class AssignedApplicationsDao {
assignedApplicationsResponse.setAppointmentTemplateId(application.getCall().getAppointmentTemplateId());
assignedApplicationsResponse.setNdg(application.getNdg());
assignedApplicationsResponse.setAppointmentId(application.getAppointmentId());
assignedApplicationsResponse.setApplicationStatus(ApplicationStatusTypeEnum.valueOf(application.getStatus()));
return assignedApplicationsResponse;
}

View File

@@ -15,6 +15,10 @@ import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.Expression;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Root;
import jakarta.persistence.criteria.*;
import jakarta.servlet.http.HttpServletRequest;
import net.gepafin.tendermanagement.entities.*;
@@ -781,30 +785,45 @@ public class CallDao {
return createCallResponseBean;
}
public List<CallDetailsResponseBean> getAllCalls(HttpServletRequest request,UserEntity user, Long companyId,Boolean onlyPreferredCall) {
public List<CallDetailsResponseBean> getAllCalls(HttpServletRequest request,UserEntity user, Long companyId,Boolean onlyPreferredCall,Boolean onlyConfidiCall) {
String type = user.getRoleEntity().getRoleType();
List<String> callStatusList = CallStatusEnum.getStatusValues();
if (Boolean.FALSE.equals(ROLE_SUPER_ADMIN.getValue().equals(type))) {
callStatusList = List.of(CallStatusEnum.PUBLISH.getValue());
}
List<CallEntity> calls;
// List<CallEntity> calls = List.of();
if (Boolean.TRUE.equals(onlyPreferredCall) && companyId == null) {
throw new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.COMPANY_ID_REQUIRED_FOR_PREFERRED_CALL));
}
Specification<CallEntity> spec = buildCallSpecification(request, user, companyId, onlyPreferredCall, onlyConfidiCall, callStatusList);
if (Boolean.TRUE.equals(onlyPreferredCall)) {
validator.validateUserWithCompany(request, companyId);
UserWithCompanyEntity userWithCompanyEntity=companyService.getUserWithCompany(user.getId(),companyId);
List<BeneficiaryPreferredCallEntity> preferredCalls = beneficiaryPreferredCallRepository
.findByUserIdAndUserWithCompanyIdAndIsDeletedFalse(user.getId(), userWithCompanyEntity.getId());
List<Long> preferredCallIds = preferredCalls.stream()
.map(BeneficiaryPreferredCallEntity::getCallId)
.collect(Collectors.toList());
calls = callRepository.findByIdInAndStatusIn(preferredCallIds, callStatusList);
} else {
calls = callRepository.findByStatusInAndHubId(callStatusList, user.getHub().getId());
List<CallEntity> calls = callRepository.findAll(spec);
LocalDateTime now = LocalDateTime.now();
for (CallEntity call : calls) {
CallEntity oldCallEntity = Utils.getClonedEntityForData(call);
if (CallStatusEnum.PUBLISH.getValue().equals(call.getStatus()) &&
call.getEndDate() != null && call.getEndTime() != null) {
LocalDateTime callEndDateTime = LocalDateTime.of(LocalDate.from(call.getEndDate()), call.getEndTime());
if (callEndDateTime.isBefore(now)) {
call.setStatus(CallStatusEnum.EXPIRED.getValue());
callRepository.save(call);
}
if (Boolean.FALSE.equals(oldCallEntity.getStatus().equals(call.getStatus()))) {
loggingUtil.logUserAction(UserActionRequest.builder()
.request(request)
.actionType(UserActionLogsEnum.UPDATE)
.actionContext(UserActionContextEnum.UPDATE_EXPIRED_CALL)
.build());
/** This code is responsible for adding a version history log for the "update call status to EXPIRED" operation **/
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldCallEntity).newData(call).build());
}
}
}
List<Long> callIds = calls.stream().map(CallEntity::getId).collect(Collectors.toList());
Map<String, BeneficiaryPreferredCallEntity> preferredCallsMap =
getBeneficiaryPreferredCallsForUser(request,user, callIds, companyId);
@@ -825,7 +844,7 @@ public class CallDao {
public Map<String, BeneficiaryPreferredCallEntity> getBeneficiaryPreferredCallsForUser(HttpServletRequest request, UserEntity user, List<Long> callIds, Long companyId) {
List<BeneficiaryPreferredCallEntity> beneficiaryPreferredCalls;
if (companyId != null && Boolean.TRUE.equals(validator.checkIsBeneficiary())) {
if (companyId != null && (Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi()))) {
validator.validateUserWithCompany(request, companyId);
UserWithCompanyEntity userWithCompanyEntity=companyService.getUserWithCompany(user.getId(),companyId);
beneficiaryPreferredCalls = beneficiaryPreferredCallRepository
@@ -981,7 +1000,7 @@ public class CallDao {
Translator.toLocale(GepafinConstant.COMPANY_ID_REQUIRED_FOR_PREFERRED_CALL)
);
}
Specification<CallEntity> spec = search(user, callPageableRequestBean);
Specification<CallEntity> spec = search(request,user, callPageableRequestBean);
Page<CallEntity> entityPage;
if (Boolean.TRUE.equals(onlyPreferredCall)) {
validator.validateUserWithCompany(request, companyId);
@@ -994,7 +1013,10 @@ public class CallDao {
// Add preferredCallIds filtering to the specification
spec = spec.and((root, query, criteriaBuilder) ->
root.get(GepafinConstant.ID).in(preferredCallIds)
criteriaBuilder.and(
root.get(GepafinConstant.ID).in(preferredCallIds),
criteriaBuilder.isTrue(root.get("confidi"))
)
);
}
entityPage = callRepository.findAll(spec, PageRequest.of(pageNo - 1, pageLimit));
@@ -1028,10 +1050,10 @@ public class CallDao {
return pageableResponseBean;
}
public Specification<CallEntity> search(UserEntity userEntity, CallPageableRequestBean callPageableRequestBean) {
public Specification<CallEntity> search(HttpServletRequest request,UserEntity userEntity, CallPageableRequestBean callPageableRequestBean) {
return (root, query, criteriaBuilder) -> {
List<Predicate> predicates = getPredicates(callPageableRequestBean, criteriaBuilder, root, userEntity);
List<Predicate> predicates = getPredicates(request,callPageableRequestBean, criteriaBuilder, root, userEntity);
SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true);
if (callPageableRequestBean.getGlobalFilters() != null
@@ -1054,9 +1076,9 @@ public class CallDao {
}
private List<Predicate> getPredicates(CallPageableRequestBean callPageableRequestBean,
private List<Predicate> getPredicates(HttpServletRequest request,CallPageableRequestBean callPageableRequestBean,
CriteriaBuilder criteriaBuilder, Root<CallEntity> root, UserEntity userEntity) {
expirePublishedCalls(request);
Integer year = null;
String search = null;
Map<String, FilterCriteria> filters = new HashMap<>();
@@ -1110,13 +1132,84 @@ public class CallDao {
predicates.add(root.get(GepafinConstant.STATUS).in(statusValues));
}
applyFilters(root, criteriaBuilder, predicates, filters);
predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.HUB).get(GepafinConstant.ID), userEntity.getHub().getId()));
Boolean isConfidi = callPageableRequestBean.getConfidi();
if (validator.checkIsConfidi()) {
if (isConfidi == null || isConfidi.equals(Boolean.FALSE)) {
// Ensure no records are returned
return List.of(criteriaBuilder.disjunction());
}
if (isConfidi.equals(Boolean.TRUE)) {
predicates.add(criteriaBuilder.isTrue(root.get("confidi")));
}
} else if (Boolean.TRUE.equals(validator.checkIsBeneficiary())) {
predicates.add(criteriaBuilder.isFalse(root.get("confidi")));
} else if( Boolean.FALSE.equals(validator.checkIsConfidi()) && isConfidi!=null){
if (isConfidi.equals(Boolean.TRUE)) {
predicates.add(criteriaBuilder.isTrue(root.get("confidi")));
}
if (isConfidi.equals(Boolean.FALSE)) {
predicates.add(criteriaBuilder.isFalse(root.get("confidi")));
}
}
predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.HUB).get(GepafinConstant.ID), userEntity.getHub().getId()));
return predicates;
}
public void expirePublishedCalls(HttpServletRequest request) {
List<CallEntity> expiredCalls = callRepository.findAll((root, query, criteriaBuilder) -> {
Predicate isPublished = criteriaBuilder.equal(root.get(GepafinConstant.STATUS), CallStatusEnum.PUBLISH.name());
// Concatenate date and time as a single string
Expression<String> dateTimeString = criteriaBuilder.concat(
root.get(GepafinConstant.END_DATE),
criteriaBuilder.literal(" ") // Space between date and time
);
Expression<String> fullDateTimeString = criteriaBuilder.concat(dateTimeString, root.get(GepafinConstant.END_TIME));
// Convert the concatenated string into TIMESTAMP
Expression<LocalDateTime> endDateTime = criteriaBuilder.function(
"to_timestamp",
LocalDateTime.class,
fullDateTimeString,
criteriaBuilder.literal("YYYY-MM-DD HH24:MI:SS")
);
Predicate isExpired = criteriaBuilder.lessThan(endDateTime, LocalDateTime.now());
return criteriaBuilder.and(isPublished, isExpired);
});
if (!expiredCalls.isEmpty()) {
for (CallEntity call : expiredCalls) {
CallEntity oldCallEntity = Utils.getClonedEntityForData(call); // Clone before modification
call.setStatus(CallStatusEnum.EXPIRED.getValue());
if (!oldCallEntity.getStatus().equals(call.getStatus())) {
// Log user action
loggingUtil.logUserAction(UserActionRequest.builder()
.request(request)
.actionType(UserActionLogsEnum.UPDATE)
.actionContext(UserActionContextEnum.UPDATE_EXPIRED_CALL)
.build());
// Add version history log
loggingUtil.addVersionHistory(VersionHistoryRequest.builder()
.request(request)
.actionType(VersionActionTypeEnum.UPDATE)
.oldData(oldCallEntity)
.newData(call)
.build());
}
}
callRepository.saveAll(expiredCalls); // Save all modified calls at once
}
}
private void applyFilters(Root<?> root, CriteriaBuilder criteriaBuilder, List<Predicate> predicates, Map<String, FilterCriteria> filters) {
if (Boolean.FALSE.equals(filters.isEmpty())) {
for (Map.Entry<String, FilterCriteria> entry : filters.entrySet()) {
@@ -1251,4 +1344,47 @@ public class CallDao {
createCallResponseBean.setCurrentStep(GepafinConstant.EVALUATION_V2_STEP_2);
return createCallResponseBean;
}
private Specification<CallEntity> buildCallSpecification(HttpServletRequest request, UserEntity user, Long companyId, Boolean onlyPreferredCall, Boolean onlyConfidiCall, List<String> callStatusList) {
return (root, query, criteriaBuilder) -> {
List<Predicate> predicates = new ArrayList<>();
predicates.add(root.get("status").in(callStatusList));
if (Boolean.TRUE.equals(onlyPreferredCall)) {
validator.validateUserWithCompany(request, companyId);
UserWithCompanyEntity userWithCompanyEntity = companyService.getUserWithCompany(user.getId(), companyId);
List<BeneficiaryPreferredCallEntity> preferredCalls = beneficiaryPreferredCallRepository
.findByUserIdAndUserWithCompanyIdAndIsDeletedFalse(user.getId(), userWithCompanyEntity.getId());
List<Long> preferredCallIds = preferredCalls.stream()
.map(BeneficiaryPreferredCallEntity::getCallId)
.collect(Collectors.toList());
predicates.add(root.get("id").in(preferredCallIds));
} else {
predicates.add(criteriaBuilder.equal(root.get("hub").get("id"), user.getHub().getId()));
}
if (validator.checkIsConfidi()) {
if (onlyConfidiCall==null || Boolean.FALSE.equals(onlyConfidiCall)) {
return criteriaBuilder.disjunction(); // Returns an empty predicate (no results)
}
if (onlyConfidiCall!=null && Boolean.TRUE.equals(onlyConfidiCall)) {
predicates.add(criteriaBuilder.isTrue(root.get("confidi")));
}
} else if (Boolean.TRUE.equals(validator.checkIsBeneficiary())) {
predicates.add(criteriaBuilder.isFalse(root.get("confidi")));
} else {
if(onlyConfidiCall!=null) {
if (Boolean.TRUE.equals(onlyConfidiCall)) {
predicates.add(criteriaBuilder.isTrue(root.get("confidi")));
}
if (Boolean.FALSE.equals(onlyConfidiCall)) {
predicates.add(criteriaBuilder.isFalse(root.get("confidi")));
}
}
}
return criteriaBuilder.and(predicates.toArray(new Predicate[0]));
};
}
}

View File

@@ -138,7 +138,7 @@ public class CommunicationDao {
if(validator.checkIsPreInstructor()){
communicationEntity.setSenderUserId(amendmentRequest.getApplicationEvaluationEntity().getUserId());
communicationEntity.setReceiverUserId(amendmentRequest.getApplicationEvaluationEntity().getAssignedApplicationsEntity().getApplication().getUserId());
} else if(validator.checkIsBeneficiary()) {
} else if(Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) {
communicationEntity.setSenderUserId(amendmentRequest.getApplicationEvaluationEntity().getAssignedApplicationsEntity().getApplication().getUserId());
communicationEntity.setReceiverUserId(amendmentRequest.getApplicationEvaluationEntity().getUserId());
}

View File

@@ -1,23 +1,33 @@
package net.gepafin.tendermanagement.dao;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.Pageable; // Correct package
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.log4j.Log4j2;
import net.gepafin.tendermanagement.entities.*;
import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum;
import net.gepafin.tendermanagement.enums.UserCompanyDelegationStatusEnum;
import net.gepafin.tendermanagement.model.request.LimitRequest;
import net.gepafin.tendermanagement.model.response.VatCheckResponseBean;
import net.gepafin.tendermanagement.repositories.*;
import net.gepafin.tendermanagement.service.CompanyService;
import net.gepafin.tendermanagement.enums.VersionActionTypeEnum;
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
import net.gepafin.tendermanagement.repositories.ApplicationRepository;
import net.gepafin.tendermanagement.repositories.FaqRepository;
import net.gepafin.tendermanagement.service.feignClient.VatCheckService;
import net.gepafin.tendermanagement.util.LoggingUtil;
import net.gepafin.tendermanagement.web.rest.api.errors.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Component;
import net.gepafin.tendermanagement.config.Translator;
@@ -27,9 +37,11 @@ import net.gepafin.tendermanagement.model.response.CompanyResponse;
import net.gepafin.tendermanagement.service.UserService;
import net.gepafin.tendermanagement.util.Utils;
import static net.gepafin.tendermanagement.util.Utils.convertObjectToJsonString;
import static net.gepafin.tendermanagement.util.Utils.setIfUpdated;
@Component
@Log4j2
public class CompanyDao {
@Autowired
@@ -60,6 +72,13 @@ public class CompanyDao {
@Autowired
private HttpServletRequest request;
@Autowired
private VatCheckService vatCheckService; // Service to call VAT API
private static final String NOT_FOUND_JSON = "{\"data\": \"not found\"}";
public CompanyResponse createCompany(UserEntity userEntity, CompanyRequest companyRequest) {
CompanyEntity existingCompany = companyRepository.findByVatNumberAndHubId(companyRequest.getVatNumber(), userEntity.getHub().getId());
@@ -410,4 +429,123 @@ public class CompanyDao {
VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.SOFT_DELETE).oldData(oldUserWithCompanyData).newData(existingRelation).build());
}
public void updateMissingVatCheckResponses(HttpServletRequest request, LimitRequest limitRequest) {
long limit = limitRequest.getLimit();
if (limit <= 0 || limit > 3000) {
log.error("Invalid limit: {}. Limit should be between 1 and 3000.", limit);
throw new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.INVALID_LIMIT));
}
int successfulUpdates = 0;
int failedUpdates = 0;
int invalidVatNumbers = 0;
Pageable pageable = PageRequest.of(0, (int) limit, Sort.by("id").ascending());
Page<CompanyEntity> companyPage = companyRepository.findCompaniesWithMissingVatCheck(pageable);
List<CompanyEntity> companies = companyPage.getContent();
if (companies.isEmpty()) {
log.info("No companies found with missing VAT check responses.");
return;
}
log.info("Processing {} companies with missing VAT check responses...", companies.size());
for (CompanyEntity company : companies) {
try {
log.info("Processing company ID: {} with VAT number: {}", company.getId(), company.getVatNumber());
VatCheckResponseBean vatResponse = companyService.checkVatNumber(request, company.getVatNumber());
CompanyEntity oldCompanyData = Utils.getClonedEntityForData(company);
if (vatResponse != null && vatResponse.getVatCheckResponse() != null) {
// Convert response to JSON and update the JSON field
String jsonResponse = Utils.convertMapIntoJsonString(vatResponse.getVatCheckResponse());
company.setJson(jsonResponse);
log.info("Company ID {}: JSON field updated successfully.", company.getId());
// Extract and set codiceAteco field
updateCodiceAtecoField(company);
successfulUpdates++;
} else {
company.setJson(NOT_FOUND_JSON);
invalidVatNumbers++;
log.warn("Company ID {}: Invalid or null VAT check response. JSON set to '{}'", company.getId(), NOT_FOUND_JSON);
}
// Adding version history log
/** This code is responsible for adding a version history log for the "Update MissingVatCheckResponses" operation. **/
loggingUtil.addVersionHistory(
VersionHistoryRequest.builder()
.request(request)
.actionType(VersionActionTypeEnum.UPDATE)
.oldData(oldCompanyData)
.newData(company)
.build());
} catch (Exception e) {
failedUpdates++;
log.error("Error updating VAT check response for company ID {}: {}", company.getId(), e.getMessage(), e);
}
}
companyRepository.saveAll(companies);
log.info("VAT check update completed. Limit: {} | Successful: {} | Invalid VAT numbers: {} | Failed: {}",
limit, successfulUpdates, invalidVatNumbers, failedUpdates);
}
private void updateCodiceAtecoField(CompanyEntity company) {
Map<String, Object> vatCheckResponse = Utils.convertJsonStringToMap(company.getJson());
if (vatCheckResponse != null && vatCheckResponse.containsKey("data")) {
Object dataObj = vatCheckResponse.get("data");
if (dataObj instanceof Map) {
Map<String, Object> dataMap = (Map<String, Object>) dataObj;
log.info("Company ID {}: Available keys inside 'data' -> {}", company.getId(), dataMap.keySet());
if (dataMap.containsKey("dettaglio")) {
Object dettaglioObj = dataMap.get("dettaglio");
if (dettaglioObj instanceof Map) {
Map<String, Object> dettaglio = (Map<String, Object>) dettaglioObj;
if (dettaglio.containsKey("codice_ateco")) {
Object codiceAtecoObj = dettaglio.get("codice_ateco");
if (codiceAtecoObj instanceof String) {
String codiceAteco = (String) codiceAtecoObj;
if (codiceAteco != null && !codiceAteco.isEmpty()) {
company.setCodiceAteco(codiceAteco);
log.info("Company ID {}: codiceAteco updated to {}", company.getId(), codiceAteco);
} else {
log.warn("Company ID {}: codiceAteco is null or empty in the response.", company.getId());
}
} else {
log.warn("Company ID {}: 'codice_ateco' is not a string, actual type: {}", company.getId(), codiceAtecoObj.getClass());
}
} else {
log.warn("Company ID {}: 'dettaglio' does not contain 'codice_ateco' key.", company.getId());
}
} else {
log.warn("Company ID {}: 'dettaglio' is not a Map, actual type: {}", company.getId(), dettaglioObj.getClass());
}
} else {
log.warn("Company ID {}: 'dettaglio' section is missing inside 'data'!", company.getId());
}
} else {
log.warn("Company ID {}: 'data' is not a Map, actual type: {}", company.getId(), dataObj.getClass());
}
} else {
log.warn("Company ID {}: 'data' section missing in the JSON response.", company.getId());
}
}
}

View File

@@ -258,30 +258,29 @@ public class CompanyDocumentDao {
return userActionContext;
}
public DocumentResponseBean validateAndDuplicateCompanyDocument(HttpServletRequest request , Long userId ,Long companyDocumentId , Long applicationId , DocumentTypeEnum documentTypeEnum){
public DocumentResponseBean createDuplicateCompanyDocument(HttpServletRequest request , Long userId ,Long companyDocumentId , Long applicationId , DocumentTypeEnum documentTypeEnum){
ApplicationEntity applicationEntity = applicationService.validateApplication(applicationId);
CompanyDocumentEntity companyDocumentEntity = validateCompanyDocument(companyDocumentId);
validator.validateUserWithCompany(request,companyDocumentEntity.getCompanyId());
String oldS3Path = companyDocumentEntity.getFilePath();
String newS3Path = s3ConfigBean.generateDocumentPath(DocumentSourceTypeEnum.APPLICATION,applicationEntity.getCall().getId(),applicationId,0L);
String companyDocumentPath = companyDocumentEntity.getFilePath();
String documentPath = s3ConfigBean.generateDocumentPath(DocumentSourceTypeEnum.APPLICATION,applicationEntity.getCall().getId(),applicationId,0L);
log.info("Original Paths - oldPath: {}, newPath: {}", oldS3Path, newS3Path);
log.info("Original Paths - oldPath: {}, newPath: {}", companyDocumentPath, documentPath);
oldS3Path = amazonS3ServiceImpl.decodeS3Key(amazonS3ServiceImpl.cleanOldPath(oldS3Path));
newS3Path = amazonS3ServiceImpl.cleanNewPath(oldS3Path, newS3Path);
log.info("Moving file from {} to {} in bucket {}", oldS3Path, newS3Path, bucketName);
UploadFileOnAmazonS3Response response;
try {
response = amazonS3ServiceImpl.copyFile(companyDocumentEntity.getName(), companyDocumentPath, documentPath);
} catch (Exception e) {
log.error("Error occurred while uploading file from Amazon S3: {}", e);
throw new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.UPLOAD_ERROR_S3));
}
CopyObjectRequest copyRequest = new CopyObjectRequest(bucketName, oldS3Path, bucketName, newS3Path);
s3Client.copyObject(copyRequest);
log.info("File copied successfully from {} to {}", oldS3Path, newS3Path);
URL amazonS3Url = amazonS3.getUrl(bucketName, newS3Path);
String fileUrl = amazonS3Url.toString();
DocumentEntity entity = new DocumentEntity();
entity.setFilePath(fileUrl);
entity.setFileName(companyDocumentEntity.getFileName());
entity.setFilePath(response.getFilePath());
entity.setFileName(response.getFileName());
entity.setSource(DocumentSourceTypeEnum.APPLICATION.getValue());
entity.setType(documentTypeEnum.getValue());
entity.setSourceId(applicationId);

View File

@@ -136,8 +136,8 @@ public class DashboardDao {
}
private void setRegisteredUsers(Widget1 widget1, UserEntity requestedUserEntity) {
Long activeUsers = userRepository.countByStatusAndRoleEntityRoleTypeAndHubId(UserStatusEnum.ACTIVE.getValue(),
RoleStatusEnum.ROLE_BENEFICIARY.getValue(), requestedUserEntity.getHub().getId());
Long activeUsers = userRepository.countByStatusAndRoleEntityRoleTypeInAndHubId(UserStatusEnum.ACTIVE.getValue(),
List.of(RoleStatusEnum.ROLE_BENEFICIARY.getValue(),RoleStatusEnum.ROLE_CONFIDI.getValue()), requestedUserEntity.getHub().getId());
if (activeUsers != null) {
widget1.setNumberOfResgisteredUsers(activeUsers);
}
@@ -183,10 +183,21 @@ public class DashboardDao {
.map(BeneficiaryPreferredCallEntity::getCallId)
.collect(Collectors.toList());
List<CallEntity> callEntities = callRepository.findByIdIn(callIds);
long activeCallsCount = callEntities.stream()
long activeCallsCount=0;
if(Boolean.TRUE.equals(validator.checkIsBeneficiary())) {
activeCallsCount = callEntities.stream()
.filter(call -> CallStatusEnum.PUBLISH.getValue().equals(call.getStatus())
&& userEntity.getHub().getId().equals(call.getHub().getId()))
.count();
}
if(Boolean.TRUE.equals(validator.checkIsConfidi())) {
activeCallsCount = callEntities.stream()
.filter(call -> CallStatusEnum.PUBLISH.getValue().equals(call.getStatus())
&& userEntity.getHub().getId().equals(call.getHub().getId())
&& call.getConfidi()) // Add this condition for confidi
.count();
}
beneficiaryWidgetResponseBean.setNumberOfCalls(activeCallsCount);
}

View File

@@ -128,7 +128,12 @@ public class DelegationDao {
CompanyEntity companyEntity = companyDao.validateCompany(companyId);
companyDao.getUserWithCompany(userEntity.getId(), companyId);
updatePlaceholdersForDelegation(user, companyEntity, placeholders, companyDelegationRequest);
DocumentEntity documentEntity = documentRepository.findBySource(GepafinConstant.DELEGATION_TEMPLATE).get(0);
DocumentEntity documentEntity =null;
if(Boolean.TRUE.equals(validator.checkIsConfidi())){
documentEntity = documentRepository.findBySource(GepafinConstant.DELEGATION_TEMPLATE_CONFIDI).get(0);
}else {
documentEntity = documentRepository.findBySource(GepafinConstant.DELEGATION_TEMPLATE).get(0);
}
return generateDocument(placeholders, documentEntity.getFilePath());
}
@@ -293,7 +298,7 @@ public class DelegationDao {
if (validator.checkIsPreInstructor()) {
ApplicationEvaluationEntity applicationEvaluationEntity = applicationEvaluationService.validateApplicationEvaluationByApplicationId(applicationId);
validator.validatePreInstructor(request, applicationEvaluationEntity.getUserId());
} else if (validator.checkIsBeneficiary()) {
} else if (Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) {
userId = validator.validateUser(request).getId();
}
return companyService.getUserWithCompany(userId, companyId);

View File

@@ -184,8 +184,11 @@ public class EmailNotificationDao {
// Extract data from forms
for (ApplicationFormEntity form : forms) {
String content = form.getForm().getContent();
List<Map<String, Object>> result = filterByName(content, "fileupload");
allFormFields.addAll(getIdAndLabelFromResult(result));
List<Map<String, Object>> fileUploadResult = filterByName(content, "fileupload");
allFormFields.addAll(getIdAndLabelFromResult(fileUploadResult));
List<Map<String, Object>> fileSelectResult = filterByName(content,GepafinConstant.FILE_SELECT);
allFormFields.addAll(getIdAndLabelFromResult(fileSelectResult));
}
// Process allFormFields and generate bullet points

View File

@@ -66,7 +66,7 @@ public class FaqDao {
CallEntity callEntity = callService.validateCall(callId);
FaqEntity entity = createOrUpdateFaqEntity(faqRequest, callEntity, userEntity, LookUpDataTypeEnum.FAQ);
FaqEntity oldFaqEntity = Utils.getClonedEntityForData(entity);
if (validator.checkIsBeneficiary() && companyId == null) {
if ((Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) && companyId == null) {
throw new CustomValidationException(Status.VALIDATION_ERROR, Translator.toLocale(GepafinConstant.COMPANY_ID_MANDATORY));
}
UserWithCompanyEntity userWithCompanyEntity=null;
@@ -132,7 +132,7 @@ public class FaqDao {
oldFaqEntity = Utils.getClonedEntityForData(faqEntity);
actionType = VersionActionTypeEnum.UPDATE;
} else {
if (Boolean.FALSE.equals(userEntity.getRoleEntity().getRoleType().equals(RoleStatusEnum.ROLE_BENEFICIARY.getValue()))) {
if (Boolean.FALSE.equals(userEntity.getRoleEntity().getRoleType().equals(RoleStatusEnum.ROLE_BENEFICIARY.getValue())) && Boolean.FALSE.equals(userEntity.getRoleEntity().getRoleType().equals(RoleStatusEnum.ROLE_CONFIDI.getValue()))) {
lookUpDataService.getOrCreateLookUpDataEntity(faqReq, type);
}
faqEntity = new FaqEntity();

View File

@@ -49,7 +49,8 @@ public class ProtocolDao {
LocalDateTime utcDateTime = DateTimeUtil.DateServerToUTC(LocalDateTime.now());
protocolEntity.setYear(utcDateTime.getYear());
protocolEntity.setProtocolNumber(protocolNumber);
protocolEntity.setTime(LocalTime.now());
LocalTime time = utcDateTime.toLocalTime().withNano(0);
protocolEntity.setTime(time);
protocolEntity.setApplicationId(applicationEntity.getId());
protocolEntity.setHubId(hubId);
if(Boolean.TRUE.equals(isForApplication)){

View File

@@ -195,7 +195,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());
@@ -791,7 +791,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);

View File

@@ -2,6 +2,7 @@ package net.gepafin.tendermanagement.entities;
import jakarta.persistence.*;
import lombok.Data;
import net.gepafin.tendermanagement.config.LocalTimeAttributeConverter;
import java.time.LocalTime;
@@ -20,6 +21,7 @@ public class ProtocolEntity extends BaseEntity {
private Long call;
@Column(name = "TIME", nullable = false)
@Convert(converter = LocalTimeAttributeConverter.class)
private LocalTime time;
@Column(name="APPLICATION_ID")

View File

@@ -65,6 +65,7 @@ public enum UserActionContextEnum {
CHECK_COMPANY_VAT_NUMBER("CHECK_COMPANY_VAT_NUMBER"),
GET_COMPANY_BY_USER("GET_COMPANY_BY_USER"),
REMOVE_COMPANY_FROM_USER("REMOVE_COMPANY_FROM_USER"),
UPDATE_COMPANY_JSON("UPDATE_COMPANY_JSON"),
/** LookUpData action context **/
CREATE_LOOKUP_DATA("CREATE_LOOKUP_DATA"),
@@ -213,7 +214,8 @@ public enum UserActionContextEnum {
GET_ALL_APPLICATION_AMENDMENT_BY_PAGINATION("GET_ALL_APPLICATION_AMENDMENT_BY_PAGINATION"),
GET_ALL_USER_ACTION_BY_PAGINATION("GET_ALL_USER_ACTION_BY_PAGINATION"),
GET_ALL_USER_BY_PAGINATION("GET_ALL_USER_BY_PAGINATION"),
UPDATE_CALL_END_DATE_AND_TIME("UPDATE_CALL_END_DATE_AND_TIME");
UPDATE_CALL_END_DATE_AND_TIME("UPDATE_CALL_END_DATE_AND_TIME"),
UPDATE_EXPIRED_CALL("UPDATE_EXPIRED_CALL") ;
private final String value;

View File

@@ -14,4 +14,6 @@ public class CallPageableRequestBean {
private List<CallStatusEnum> status;
private Map<String, FilterCriteria> filters;
private Boolean confidi;
}

View File

@@ -0,0 +1,8 @@
package net.gepafin.tendermanagement.model.request;
import lombok.Data;
@Data
public class LimitRequest {
private Long limit;
}

View File

@@ -1,6 +1,8 @@
package net.gepafin.tendermanagement.model.response;
import com.amazonaws.services.dynamodbv2.xspec.S;
import lombok.Data;
import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum;
import net.gepafin.tendermanagement.enums.AssignedApplicationEnum;
import net.gepafin.tendermanagement.enums.EvaluationVersionEnum;
import net.gepafin.tendermanagement.model.BaseBean;
@@ -28,6 +30,7 @@ public class AssignedApplicationsResponse extends BaseBean {
private EvaluationVersionEnum evaluationVersion;
private String ndg;
private String appointmentId;
private ApplicationStatusTypeEnum applicationStatus;
}

View File

@@ -54,4 +54,9 @@ public interface CallRepository extends JpaRepository<CallEntity, Long>, JpaSpec
List<CallEntity> findByIdIn(@Param("ids") List<Long> ids);
@Query("SELECT c FROM CallEntity c WHERE c.id IN :ids AND c.status IN :status AND c.confidi= :confidi")
List<CallEntity> findByIdInAndStatusInAndConfidi(@Param("ids") List<Long> ids, @Param("status") List<String> status,Boolean confidi);
public List<CallEntity> findByStatusInAndHubIdAndConfidi(List<String> callStatus, Long hubId,Boolean onlyConfidiCall);
}

View File

@@ -1,7 +1,10 @@
package net.gepafin.tendermanagement.repositories;
import org.springframework.data.domain.Pageable;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
@@ -21,5 +24,12 @@ public interface CompanyRepository extends JpaRepository<CompanyEntity, Long> {
CompanyEntity findByVatNumberAndHubId(String vatNumber, Long hubId);
@Query("""
SELECT c FROM CompanyEntity c
WHERE c.vatNumber IS NOT NULL
AND (c.json IS NULL OR c.json = '')
""")
Page<CompanyEntity> findCompaniesWithMissingVatCheck(Pageable pageable);
}

View File

@@ -1,6 +1,7 @@
package net.gepafin.tendermanagement.repositories;
import net.gepafin.tendermanagement.entities.UserEntity;
import net.gepafin.tendermanagement.enums.RoleStatusEnum;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
@@ -32,6 +33,10 @@ public interface UserRepository extends JpaRepository<UserEntity, Long>, JpaSpec
Long countByStatusAndRoleEntityRoleTypeAndHubId(String status, String roleName, Long hubId);
Long countByStatusAndRoleEntityRoleTypeInAndHubId(String status,List<String> roleName, Long hubId);
Optional<UserEntity> findByBeneficiaryCodiceFiscaleAndHubId(String codiceFiscale, Long hubId);
// Boolean existsByBeneficiaryCodiceFiscaleAndHubId(String codiceFiscale, Long hubId);

View File

@@ -19,4 +19,6 @@ AmazonS3Service {
UploadFileOnAmazonS3Response moveFile(String fileName, String oldPath, String newPath);
UploadFileOnAmazonS3Response copyFile(String fileName, String oldS3Path, String newS3Path);
}

View File

@@ -21,7 +21,7 @@ public interface CallService {
CallResponse getCallById (HttpServletRequest request, Long callId,Long companyId);
List<CallDetailsResponseBean> getAllCalls(HttpServletRequest request,Long companyId,Boolean onlyPreferredCall);
List<CallDetailsResponseBean> getAllCalls(HttpServletRequest request,Long companyId,Boolean onlyPreferredCall,Boolean onlyConfidiCall);
CallResponse validateCallData(HttpServletRequest request, Long callId);

View File

@@ -20,7 +20,7 @@ public interface CompanyDocumentService {
void deleteCompanyFile(HttpServletRequest request,Long companyDocumentId);
DocumentResponseBean validateAndDuplicateCompanyDocument(HttpServletRequest request, Long companyDocumentId, Long applicationId, DocumentTypeEnum typeEnum);
DocumentResponseBean createDuplicateCompanyDocument(HttpServletRequest request, Long companyDocumentId, Long applicationId, DocumentTypeEnum typeEnum);
List<CompanyDocumentResponseBean> getAllCompanyDocument(HttpServletRequest request ,Long companyId , CompanyDocumentTypeEnum typeEnum);

View File

@@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
import java.util.List;
import java.util.Map;
import net.gepafin.tendermanagement.model.request.LimitRequest;
import net.gepafin.tendermanagement.model.response.VatCheckResponseBean;
import org.springframework.web.multipart.MultipartFile;
@@ -45,4 +46,6 @@ public interface CompanyService {
UserWithCompanyEntity getUserWithCompanyEntity(Long userId,Long companyId);
void removeCompanyFromList(HttpServletRequest request, Long companyId);
void updateMissingVatCheckResponses(HttpServletRequest request, LimitRequest limitRequest);
}

View File

@@ -160,20 +160,14 @@ public class AmazonS3ServiceImpl implements AmazonS3Service {
@Override
public UploadFileOnAmazonS3Response moveFile(String fileName, String oldPath, String newPath) {
try {
log.info("Original Paths - oldPath: {}, newPath: {}", oldPath, newPath);
oldPath = decodeS3Key(cleanOldPath(oldPath));
newPath = cleanNewPath(oldPath, newPath);
log.info("Moving file from {} to {} in bucket {}", oldPath, newPath, bucketName);
CopyObjectRequest copyRequest = new CopyObjectRequest(bucketName, oldPath, bucketName, newPath);
s3Client.copyObject(copyRequest);
log.info("File copied successfully from {} to {}", oldPath, newPath);
UploadFileOnAmazonS3Response response = copyFile(fileName, oldPath, newPath);
s3Client.deleteObject(bucketName, oldPath);
s3Client.deleteObject(bucketName, decodeS3Key(cleanOldPath(oldPath)));
log.info("Original file deleted successfully: {}", oldPath);
String filePath = s3Url + newPath;
return UploadFileOnAmazonS3Response.builder().fileName(fileName).filePath(filePath).build();
return response;
} catch (AmazonServiceException e) {
log.error("AWS service error while moving file: {}", e.getErrorMessage(), e);
throw e;
@@ -193,4 +187,34 @@ public class AmazonS3ServiceImpl implements AmazonS3Service {
public String cleanOldPath(String oldPath) {
return oldPath.replace(s3Url, "");
}
@Override
public UploadFileOnAmazonS3Response copyFile(String fileName, String oldS3Path, String newS3Path){
try {
log.info("Copying file from {} to {} in bucket {}", oldS3Path, newS3Path, bucketName);
oldS3Path = decodeS3Key(cleanOldPath(oldS3Path));
newS3Path = cleanNewPath(oldS3Path, newS3Path);
log.info("Copying file from {} to {} in bucket {}", oldS3Path, newS3Path, bucketName);
CopyObjectRequest copyRequest = new CopyObjectRequest(bucketName, oldS3Path, bucketName, newS3Path);
s3Client.copyObject(copyRequest);
log.info("File copied successfully from {} to {}", oldS3Path, newS3Path);
URL amazonS3Url = amazonS3.getUrl(bucketName, newS3Path);
String fileUrl = amazonS3Url.toString();
return UploadFileOnAmazonS3Response.builder().fileName(fileName).filePath(fileUrl).build();
}
catch (AmazonServiceException e) {
log.error("AWS service error while copying file: {}", e.getErrorMessage(), e);
throw e;
} catch (SdkClientException e) {
log.error("SDK client error while copying file: {}", e.getMessage(), e);
throw e;
} catch (Exception e) {
log.error("Unexpected error while copying file: {}", e.getMessage(), e);
throw e;
}
}
}

View File

@@ -81,7 +81,7 @@ public class ApplicationServiceImpl implements ApplicationService {
validator.validateUserWithCompany(request, companyId);
}
ApplicationEntity applicationEntity =null;
if(validator.checkIsBeneficiary()){
if(Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())){
if(companyId==null){
throw new ForbiddenAccessException(Status.FORBIDDEN,Translator.toLocale(GepafinConstant.COMPANY_ID_MANDATORY));
}

View File

@@ -61,10 +61,10 @@ public class CallServiceImpl implements CallService {
}
@Override
@Transactional(readOnly = true)
public List<CallDetailsResponseBean> getAllCalls(HttpServletRequest request,Long companyId,Boolean onlyPreferredCall) {
@Transactional(rollbackFor = Exception.class)
public List<CallDetailsResponseBean> getAllCalls(HttpServletRequest request,Long companyId,Boolean onlyPreferredCall,Boolean onlyConfidiCall) {
UserEntity user = validator.validateUser(request);
return callDao.getAllCalls(request,user,companyId,onlyPreferredCall);
return callDao.getAllCalls(request,user,companyId,onlyPreferredCall,onlyConfidiCall);
}
@@ -104,6 +104,7 @@ public class CallServiceImpl implements CallService {
}
@Override
@Transactional(rollbackFor = Exception.class)
public PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request,Long companyId , Boolean onlyPreferredCall, CallPageableRequestBean callPageableRequestBean) {
UserEntity user = validator.validateUser(request);
return callDao.getAllCallsByPagination(request,user,companyId,onlyPreferredCall,callPageableRequestBean);

View File

@@ -31,7 +31,7 @@ public class CommunicationServiceImpl implements CommunicationService {
@Transactional(rollbackFor = Exception.class)
public CommunicationResponseBean addCommentToAmendmentRequest(HttpServletRequest request ,CommunicationRequestBean communicationRequestBean, Long amendmentId) {
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity = applicationAmendmentRequestDao.validateApplicationAmendmentRequest(amendmentId);
if (Boolean.FALSE.equals(validator.checkIsBeneficiary())) {
if (Boolean.FALSE.equals(validator.checkIsBeneficiary()) && Boolean.FALSE.equals(validator.checkIsConfidi())) {
validator.validatePreInstructor(request, applicationAmendmentRequestEntity.getApplicationEvaluationEntity().getUserId());
} else {
validator.validateUserId(request, applicationAmendmentRequestEntity.getApplicationEvaluationEntity().getAssignedApplicationsEntity().getApplication().getUserId());
@@ -43,7 +43,7 @@ public class CommunicationServiceImpl implements CommunicationService {
@Transactional(rollbackFor = Exception.class)
public String deleteComment(HttpServletRequest request ,Long amendmentId, Long commentId) {
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity = applicationAmendmentRequestDao.validateApplicationAmendmentRequest(amendmentId);
if (Boolean.FALSE.equals(validator.checkIsBeneficiary())) {
if (Boolean.FALSE.equals(validator.checkIsBeneficiary()) && Boolean.FALSE.equals(validator.checkIsConfidi())) {
validator.validatePreInstructor(request, applicationAmendmentRequestEntity.getApplicationEvaluationEntity().getUserId());
} else {
validator.validateUserId(request, applicationAmendmentRequestEntity.getApplicationEvaluationEntity().getAssignedApplicationsEntity().getApplication().getUserId());

View File

@@ -53,9 +53,9 @@ public class CompanyDocumentServiceImpl implements CompanyDocumentService {
}
@Override
public DocumentResponseBean validateAndDuplicateCompanyDocument(HttpServletRequest request, Long companyDocumentId, Long applicationId, DocumentTypeEnum typeEnum) {
public DocumentResponseBean createDuplicateCompanyDocument(HttpServletRequest request, Long companyDocumentId, Long applicationId, DocumentTypeEnum typeEnum) {
UserEntity user = validator.validateUser(request);
return companyDocumentDao.validateAndDuplicateCompanyDocument(request, user.getId(), companyDocumentId,applicationId,typeEnum);
return companyDocumentDao.createDuplicateCompanyDocument(request, user.getId(), companyDocumentId,applicationId,typeEnum);
}
@Override

View File

@@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
import java.util.List;
import java.util.Map;
import net.gepafin.tendermanagement.model.request.LimitRequest;
import net.gepafin.tendermanagement.model.response.VatCheckResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -130,4 +131,10 @@ public class CompanyServiceImpl implements CompanyService {
UserEntity userEntity =validator.validateUser(request);
companyDao.removeCompanyFromList(userEntity, companyId);
}
@Override
public void updateMissingVatCheckResponses(HttpServletRequest request, LimitRequest limitRequest) {
UserEntity userEntity =validator.validateUser(request);
companyDao.updateMissingVatCheckResponses(request, limitRequest);
}
}

View File

@@ -63,8 +63,8 @@ public class FieldValidator {
if (value != null) {
if(min!=null) {
if(contentResponseBean.getName().equals(GepafinConstant.NUMBER_INPUT)) {
long numericValue = Long.parseLong(value); // Convert String to Long
if (numericValue < min) {
double numericValue = Double.parseDouble(value); // Use double instead of long
if (numericValue < min.doubleValue()) {
errors.add(MessageFormat.format(
Translator.toLocale(GepafinConstant.VALIDATION_FIELD_MIN), fieldLabel, min));
}
@@ -90,8 +90,8 @@ public class FieldValidator {
if (value != null) {
if (max != null) {
if(contentResponseBean.getName().equals(GepafinConstant.NUMBER_INPUT)) {
long numericValue = Long.parseLong(value); // Convert String to Long
if (numericValue > max) {
double numericValue = Double.parseDouble(value); // Convert String to Long
if (numericValue > max.doubleValue()) {
errors.add(MessageFormat.format(
Translator.toLocale(GepafinConstant.VALIDATION_FIELD_MAX), fieldLabel, max));
}

View File

@@ -788,4 +788,12 @@ public class Utils {
public static boolean isValidBoolean(String value) {
return "true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value);
}
public static Map<String, Object> convertJsonStringToMap(String jsonString) {
try {
return mapper.readValue(jsonString, Map.class);
} catch (Exception e) {
e.printStackTrace(); // Handle the exception
return null;
}
}
}

View File

@@ -195,4 +195,15 @@ public class Validator {
}
return false;
}
public Boolean checkIsConfidi() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null && authentication.isAuthenticated()) {
for (GrantedAuthority authority : authentication.getAuthorities()) {
if (RoleStatusEnum.ROLE_CONFIDI.getValue().equals(authority.getAuthority())) {
return true;
}
}
}
return false;
}
}

View File

@@ -101,7 +101,7 @@ public interface CallApi {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@GetMapping(value = "",
produces = { "application/json" })
ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId , @RequestParam(value = "onlyPreferredCall", required = false, defaultValue = "false") Boolean onlyPreferredCall);
ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId , @RequestParam(value = "onlyPreferredCall", required = false, defaultValue = "false") Boolean onlyPreferredCall,@RequestParam(value = "onlyConfidiCall", required = false) Boolean onlyConfidiCall);
@Operation(summary = "Api to validate call",

View File

@@ -33,7 +33,7 @@ public interface CommunicationApi {
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@PostMapping(value = "/{amendmentId}", produces = { "application/json" })
@PreAuthorize("hasRole('ROLE_PRE_INSTRUCTOR') || hasRole('ROLE_BENEFICIARY') || hasRole('ROLE_INSTRUCTOR_MANAGER')")
@PreAuthorize("hasRole('ROLE_PRE_INSTRUCTOR') || hasRole('ROLE_BENEFICIARY') || hasRole('ROLE_INSTRUCTOR_MANAGER') || hasRole('ROLE_CONFIDI')")
ResponseEntity<Response<CommunicationResponseBean>> addCommentToAmendmentRequest(HttpServletRequest request,
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @PathVariable(value = "amendmentId") Long amendmentId);
@@ -55,7 +55,7 @@ public interface CommunicationApi {
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@PutMapping(value = "/{amendmentId}/{commentId}", produces = { "application/json" })
@PreAuthorize("hasRole('ROLE_PRE_INSTRUCTOR') || hasRole('ROLE_BENEFICIARY') || hasRole('ROLE_INSTRUCTOR_MANAGER')")
@PreAuthorize("hasRole('ROLE_PRE_INSTRUCTOR') || hasRole('ROLE_BENEFICIARY') || hasRole('ROLE_INSTRUCTOR_MANAGER') || hasRole('ROLE_CONFIDI')")
ResponseEntity<Response<CommunicationResponseBean>> updateCommunicationAmendment(HttpServletRequest request,
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @PathVariable(value = "amendmentId") Long amendmentId, @PathVariable(value = "commentId") Long commentId);

View File

@@ -3,9 +3,11 @@ package net.gepafin.tendermanagement.web.rest.api;
import java.util.List;
import java.util.Map;
import net.gepafin.tendermanagement.model.request.LimitRequest;
import net.gepafin.tendermanagement.model.response.VatCheckResponseBean;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@@ -155,4 +157,16 @@ public interface CompanyApi {
ResponseEntity<Response<Void>> removeCompanyFromList(HttpServletRequest request,
@Parameter(description = "The company id", required = true) @PathVariable("companyId") Long companyId);
@Operation(summary = "Api to update company with no data through script", responses = { @ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@PostMapping(value = "/updateCompanyJson", produces = { "application/json" })
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') ")
ResponseEntity<Response<Void>> updateMissingVatCheckResponses(HttpServletRequest request,
@Parameter(description = "Limit request object ", required = true) @RequestBody LimitRequest limitRequest);
}

View File

@@ -102,7 +102,7 @@ public interface CompanyDocumentApi {
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) }))})
@PutMapping(value = "/{id}/document/upload", produces = MediaType.APPLICATION_JSON_VALUE)
default ResponseEntity<Response<DocumentResponseBean>> validateAndDuplicateCompanyDocument (HttpServletRequest httpServletRequest, @Parameter(description = "Company Document Id", required = true) @PathVariable("id") Long companyDocumentId,
default ResponseEntity<Response<DocumentResponseBean>> createDuplicateCompanyDocument (HttpServletRequest httpServletRequest, @Parameter(description = "Company Document Id", required = true) @PathVariable("id") Long companyDocumentId,
@Parameter(description = "Application Id", required = true) @RequestParam Long applicationId,
@RequestParam("documentType") DocumentTypeEnum documentTypeEnum) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);

View File

@@ -93,13 +93,13 @@ public class CallApiController implements CallApi {
@Override
@Transactional
public ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,Long companyId,Boolean onlyPreferredCall) {
public ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,Long companyId,Boolean onlyPreferredCall,Boolean onlyConfidiCall) {
/** This code is responsible for creating user action logs for the "get all Calls" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW)
.actionContext(UserActionContextEnum.GET_CALL).build());
List<CallDetailsResponseBean> calls = callService.getAllCalls(request, companyId, onlyPreferredCall);
List<CallDetailsResponseBean> calls = callService.getAllCalls(request, companyId, onlyPreferredCall,onlyConfidiCall);
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(calls, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));

View File

@@ -6,6 +6,7 @@ import java.util.Map;
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
import net.gepafin.tendermanagement.model.request.LimitRequest;
import net.gepafin.tendermanagement.model.request.UserActionRequest;
import net.gepafin.tendermanagement.model.response.VatCheckResponseBean;
import net.gepafin.tendermanagement.util.LoggingUtil;
@@ -188,4 +189,16 @@ public class CompanyApiController implements CompanyApi{
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMPANY_DELETE_SUCCESS_MSG)));
}
@Override
public ResponseEntity<Response<Void>> updateMissingVatCheckResponses(HttpServletRequest request, LimitRequest limitRequest) {
log.info("Api to update company json field");
/** This code is responsible for creating user action logs for the "Update company json field" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE).actionContext(UserActionContextEnum.UPDATE_COMPANY_JSON).build());
companyService.updateMissingVatCheckResponses(request, limitRequest);
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMPANY_UPDATED_SUCCESS_MSG)));
}
}

View File

@@ -91,12 +91,12 @@ public class CompanyDocumentApiControlller implements CompanyDocumentApi {
}
@Override
public ResponseEntity<Response<DocumentResponseBean>> validateAndDuplicateCompanyDocument(HttpServletRequest httpServletRequest, Long companyDocumentId , Long applicationId,DocumentTypeEnum typeEnum) {
public ResponseEntity<Response<DocumentResponseBean>> createDuplicateCompanyDocument(HttpServletRequest httpServletRequest, Long companyDocumentId , Long applicationId,DocumentTypeEnum typeEnum) {
/** This code is responsible for creating user action logs for the "duplicate company document" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(httpServletRequest).actionType(UserActionLogsEnum.UPDATE).actionContext(UserActionContextEnum.DUPLICATE_COMPANY_DOCUMENT).build());
DocumentResponseBean responseBeans = companyDocumentService.validateAndDuplicateCompanyDocument(httpServletRequest, companyDocumentId,applicationId,typeEnum);
DocumentResponseBean responseBeans = companyDocumentService.createDuplicateCompanyDocument(httpServletRequest, companyDocumentId,applicationId,typeEnum);
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<DocumentResponseBean>(responseBeans, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMPANY_DOCUMENT_COPIED_SUCCESSFULLY)));
}

View File

@@ -2641,5 +2641,24 @@
path="db/dump/insert_system_email_template_for_user_13-03-2025.sql"/>
</changeSet>
<changeSet id="06-03-2025_NK_190111" author="Nisha Kashyap">
<update tableName="role">
<column name="permissions" value="VIEW_CONFIDI_CALLS,APPLY_CONFIDI_CALLS"/>
<where>role_type = 'ROLE_CONFIDI'</where>
</update>
</changeSet>
<changeSet id="10-03-2025_NK_180430" author="Nisha Kashyap">
<insert tableName="document">
<column name="file_name" value="PROCURA_BANDI_TEMPLATE_CONFIDI.DOCX"></column>
<column name="file_path" value="https://mementoresources.s3.eu-west-1.amazonaws.com/gepafin/local/template/PROCURA_BANDI_TEMPLATE_CONFIDI.docx"></column>
<column name="type" value="DOCUMENT"></column>
<column name="source" value="DELEGATION_TEMPLATE_CONFIDI"></column>
</insert>
</changeSet>
<changeSet id="12-03-2025_NK_180530" author="Nisha Kashyap">
<sqlFile dbms="postgresql"
path="db/dump/update_form_field_data_12-03-2025.sql"/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,6 @@
UPDATE FORM_FIELD
SET LABEL = 'Seleziona File',
SETTINGS = '[{"name": "label", "value": "Seleziona File"},{"name": "documentCategories", "value": []},{"name": "isDelegation", "value": false}]',
UPDATED_DATE = CURRENT_TIMESTAMP
WHERE NAME = 'fileselect';

View File

@@ -53,7 +53,7 @@ call.update.successfully=Call updated successfully.
call.fetch.success=Call details fetched successfully.
call.not.found=Call not found.
score.not.null=Score cannot be null or cannot be zero.
field.not.null={0} cannot be null.
field.not.null={0} cannot be empty.
field.not.empty={0} cannot be empty.
update_call_status_success_msg=The call status has been updated successfully.
status.same.error=Status is already set.
@@ -394,4 +394,5 @@ appointment.cannot.be.created = Appointment cannot be created because call doesn
appointment.not.created = Appointment not created please try again.
validation.failed.checklist=Validation failed for checklist.
error.invalid.limit=Limit should be between 1 and 3000.
insufficient.score.msg = Insufficient score to pass to the technical and economic-financial evaluation

View File

@@ -53,7 +53,7 @@ call.update.successfully=Chiamata aggiornata con successo.
call.fetch.success=Dettagli della chiamata recuperati con successo.
call.not.found=Chiamata non trovata.
score.not.null=Il punteggio non pu? essere nullo o zero.
field.not.null={0} non pu? essere nullo.
field.not.null={0} non può essere vuoto.
field.not.empty=la {0} non pu? essere vuota.
update_call_status_success_msg=Lo stato della chiamata ? stato aggiornato con successo.
status.same.error=Lo stato ? gi? impostato.
@@ -385,4 +385,6 @@ appointment.cannot.be.created = Impossibile creare l'appuntamento perch<63> la ch
appointment.not.created = Appuntamento non creato, riprova
validation.failed.checklist=Convalida fallita per la checklist.
error.invalid.limit=Il limite dovrebbe essere compreso tra 1 e 3000.
insufficient.score.msg = Punteggio non sufficiente per passaggio alla valutazione tecnica ed economico finanziaria
validation.table.message=I dati per il campo {0} non sono presenti.