Resolved Conflicts.

This commit is contained in:
harish
2024-11-06 12:13:13 +05:30
13 changed files with 313 additions and 50 deletions

View File

@@ -98,7 +98,7 @@ public class ApplicationAmendmentRequestDao {
@Autowired @Autowired
private Validator validator; private Validator validator;
public ApplicationAmendmentRequestResponse getApplicationDataForAmendment(HttpServletRequest request, Long applicationEvaluationId) { public ApplicationAmendmentRequestResponse getApplicationDataForAmendment(Long applicationEvaluationId) {
log.info("Fetching the application data for the Amendment process {}", applicationEvaluationId); log.info("Fetching the application data for the Amendment process {}", applicationEvaluationId);
ApplicationEvaluationEntity applicationEvaluationEntity = applicationEvaluationService.validateApplicationEvaluation(applicationEvaluationId); ApplicationEvaluationEntity applicationEvaluationEntity = applicationEvaluationService.validateApplicationEvaluation(applicationEvaluationId);
Long applicationId = applicationEvaluationEntity.getApplicationId(); Long applicationId = applicationEvaluationEntity.getApplicationId();
@@ -228,8 +228,6 @@ public class ApplicationAmendmentRequestDao {
applicationEvaluationEntity.getAssignedApplicationsEntity().getApplication(), protocolNumber, applicationEvaluationEntity.getAssignedApplicationsEntity().getApplication(), protocolNumber,
userEntity.getHub().getId()); userEntity.getHub().getId());
applicationAmendmentRequestEntity.setProtocol(protocolEntity); applicationAmendmentRequestEntity.setProtocol(protocolEntity);
applicationAmendmentRequestEntity.setIsEmail(false);
applicationAmendmentRequestEntity.setIsNotification(false);
ApplicationAmendmentRequestEntity applicationAmendment = saveApplicationAmendmentRequestEntity(applicationAmendmentRequestEntity); ApplicationAmendmentRequestEntity applicationAmendment = saveApplicationAmendmentRequestEntity(applicationAmendmentRequestEntity);
//Set Status //Set Status
@@ -379,7 +377,6 @@ public class ApplicationAmendmentRequestDao {
} }
public List<ApplicationAmendmentRequestResponse> getAllApplicationAmendmentRequest(HttpServletRequest request,Long userId) { public List<ApplicationAmendmentRequestResponse> getAllApplicationAmendmentRequest(HttpServletRequest request,Long userId) {
UserEntity user = validator.validateUser(request);
if(validator.checkIsPreInstructor() && userId == null) { if(validator.checkIsPreInstructor() && userId == null) {
throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.USER_ID_NOT_NULL_MSG)); throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.USER_ID_NOT_NULL_MSG));
} }
@@ -580,8 +577,10 @@ public class ApplicationAmendmentRequestDao {
String subject = prepareSubject(emailTemplate, amendment, beneficiaryUser); String subject = prepareSubject(emailTemplate, amendment, beneficiaryUser);
String body = prepareBody(emailTemplate, amendment, beneficiaryUser); String body = prepareBody(emailTemplate, amendment, beneficiaryUser);
String email = beneficiaryUser.getEmail(); String email = beneficiaryUser.getEmail();
if (Boolean.TRUE.equals(amendment.getIsEmail())&&email != null && !email.isEmpty()) { String companyEmail = applicationEntity.getCompany().getEmail();
if (Boolean.TRUE.equals(amendment.getIsEmail())&&email != null && !email.isEmpty() && companyEmail != null && !companyEmail.isEmpty()) {
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(email)); emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(email));
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(companyEmail));
// mailUtil.sendByMailGun(subject,body,List.of(email),null); // mailUtil.sendByMailGun(subject,body,List.of(email),null);
} else { } else {
throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.BENEFICIARY_EMAIL_NOT_FOUND_MSG)); throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.BENEFICIARY_EMAIL_NOT_FOUND_MSG));

View File

@@ -32,6 +32,7 @@ import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationExceptio
import net.gepafin.tendermanagement.web.rest.api.errors.ResourceNotFoundException; import net.gepafin.tendermanagement.web.rest.api.errors.ResourceNotFoundException;
import net.gepafin.tendermanagement.web.rest.api.errors.Status; import net.gepafin.tendermanagement.web.rest.api.errors.Status;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -110,6 +111,9 @@ public class ApplicationDao {
@Value("${carlo_email}") @Value("${carlo_email}")
private String carloEmail; private String carloEmail;
@Value("${call.id}")
private String callId;
@Autowired @Autowired
private AmazonS3Service amazonS3Service; private AmazonS3Service amazonS3Service;
@@ -776,7 +780,7 @@ public class ApplicationDao {
MultipartFile file) { MultipartFile file) {
ApplicationEntity applicationEntity = validateApplication(applicationId); ApplicationEntity applicationEntity = validateApplication(applicationId);
validator.validateUserWithCompany(request, applicationEntity.getCompany().getId()); validator.validateUserWithCompany(request, applicationEntity.getCompany().getId());
validateFileType(file); validateFileTypeForCall(file, applicationEntity);
ApplicationSignedDocumentEntity applicationSignedDocument = applicationSignedDocumentRepository ApplicationSignedDocumentEntity applicationSignedDocument = applicationSignedDocumentRepository
.findByApplicationIdAndStatus(applicationId, ApplicationSignedDocumentStatusEnum.ACTIVE.getValue()); .findByApplicationIdAndStatus(applicationId, ApplicationSignedDocumentStatusEnum.ACTIVE.getValue());
if (applicationSignedDocument != null) { if (applicationSignedDocument != null) {
@@ -796,6 +800,16 @@ public class ApplicationDao {
applicationRepository.save(applicationEntity); applicationRepository.save(applicationEntity);
return convertApplicationSignedDocumentToApplicationSignedDocumentResponse(applicationSignedDocument); return convertApplicationSignedDocumentToApplicationSignedDocumentResponse(applicationSignedDocument);
} }
private void validateFileTypeForCall(MultipartFile file, ApplicationEntity applicationEntity) {
List<String> validCallIds = Arrays.asList(callId.split(","));
if (applicationEntity != null && validCallIds.contains(applicationEntity.getCall().getId().toString())) {
return;
}
validateFileType(file);
}
private UploadFileOnAmazonS3Response uploadFileOnAmazonS3ForUserSignedDocument(MultipartFile file, Long callId, Long applicationId) { private UploadFileOnAmazonS3Response uploadFileOnAmazonS3ForUserSignedDocument(MultipartFile file, Long callId, Long applicationId) {
try { try {
String s3Path = generateS3PathForDelegation(callId, applicationId); String s3Path = generateS3PathForDelegation(callId, applicationId);

View File

@@ -897,12 +897,13 @@ public class ApplicationEvaluationDao {
assignedApplicationsRepository.save(assignedApplicationsEntity); assignedApplicationsRepository.save(assignedApplicationsEntity);
ApplicationAmendmentRequestEntity amendmentRequest = applicationAmendmentRequestRepository.findByApplicationEvaluationIdAndIsDeletedFalse(entity.getId()); ApplicationAmendmentRequestEntity amendmentRequest = applicationAmendmentRequestRepository.findByApplicationEvaluationIdAndIsDeletedFalse(entity.getId());
if(amendmentRequest!=null){
if (Boolean.TRUE.equals(statusType.equals((ApplicationStatusTypeEnum.APPROVED.getValue())))) { if (Boolean.TRUE.equals(statusType.equals((ApplicationStatusTypeEnum.APPROVED.getValue())))) {
emailNotificationDao.sendAdmissibilityNotificationEmailForApprovedApplication(amendmentRequest); emailNotificationDao.sendAdmissibilityNotificationEmailForApprovedApplication(amendmentRequest);
} }
if (Boolean.TRUE.equals(statusType.equals((ApplicationStatusTypeEnum.REJECTED.getValue())))) { if (Boolean.TRUE.equals(statusType.equals((ApplicationStatusTypeEnum.REJECTED.getValue())))) {
emailNotificationDao.sendInadmissibilityEmailForRejectedApplication(amendmentRequest); emailNotificationDao.sendInadmissibilityEmailForRejectedApplication(amendmentRequest);
} }}
return convertToResponse(entity); return convertToResponse(entity);
} }
return null; return null;

View File

@@ -77,9 +77,15 @@ public class EmailNotificationDao {
UserEntity userEntity = userService.validateUser(applicationEntity.getUserId()); UserEntity userEntity = userService.validateUser(applicationEntity.getUserId());
List<String> recipientEmails = new ArrayList<>(); List<String> recipientEmails = new ArrayList<>();
if (applicationEntity.getCompany().getEmail() != null) { String companyEmail = applicationEntity.getCompany().getEmail();
recipientEmails.add(applicationEntity.getCompany().getEmail()); String contactEmail = applicationEntity.getCompany().getContactEmail();
if (companyEmail != null && !companyEmail.isEmpty()) {
recipientEmails.add(companyEmail);
} }
if (contactEmail != null && !contactEmail.isEmpty() && !contactEmail.equals(companyEmail)) {
recipientEmails.add(contactEmail);
}
if (userEntity.getBeneficiary().getEmail() != null) { if (userEntity.getBeneficiary().getEmail() != null) {
recipientEmails.add(userEntity.getBeneficiary().getEmail()); recipientEmails.add(userEntity.getBeneficiary().getEmail());
} }

View File

@@ -31,6 +31,7 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Component @Component
public class PdfDao { public class PdfDao {
@@ -476,7 +477,7 @@ public class PdfDao {
String contentId = content.getId(); // Content ID String contentId = content.getId(); // Content ID
String label = content.getLabel(); // Content label String label = content.getLabel(); // Content label
String name = content.getName(); // Content name String name = content.getName(); // Content name
Object fieldValue = null; Object fieldValue = "";
String contentLabel = content.getSettings().stream() String contentLabel = content.getSettings().stream()
.filter(setting -> "label".equals(setting.getName())) // Filter settings by name .filter(setting -> "label".equals(setting.getName())) // Filter settings by name
@@ -485,6 +486,32 @@ public class PdfDao {
.findFirst() // Get the first matching value .findFirst() // Get the first matching value
.orElse(null); // If no match is found, set label to null .orElse(null); // If no match is found, set label to null
// Find the form field in the response that matches the contentId // Find the form field in the response that matches the contentId
if (name.equals("paragraph")){
String paragraph = content.getSettings().stream()
.filter(setting -> "text".equals(setting.getName())) // Filter settings by name
.map(SettingResponseBean::getValue) // Extract the value from the matching setting
.map(Object::toString) // Convert the value to a string
.findFirst() // Get the first matching value
.orElse(null);
Paragraph labelParagraph = new Paragraph();
PdfPCell labelCell = new PdfPCell(PdfUtils.htmlToPdfPCell(paragraph,labelFont));
labelCell.setBorder(Rectangle.NO_BORDER);
labelCell.setGrayFill(7);
labelCell.setPadding(5);
// Create a PdfPTable with 1 column and add the PdfPCell to it
PdfPTable table = new PdfPTable(1);
table.setWidthPercentage(100);
table.addCell(labelCell);
labelParagraph.add(table);
try {
document.add(labelParagraph);
document.add(new Paragraph(" "));
} catch (DocumentException e) {
throw new RuntimeException(e);
}
}
Optional<ApplicationFormFieldResponseBean> matchingFormField = formFields.stream() Optional<ApplicationFormFieldResponseBean> matchingFormField = formFields.stream()
.filter(formField -> formField.getFieldId().equals(contentId)) .filter(formField -> formField.getFieldId().equals(contentId))
.findFirst(); .findFirst();
@@ -501,7 +528,13 @@ public class PdfDao {
// Process 'fileupload' and 'checkboxes' cases as in the original logic // Process 'fileupload' and 'checkboxes' cases as in the original logic
if (name.equals("fileupload")) { if (name.equals("fileupload")) {
continue; if (fieldValue instanceof List<?> && ((List<?>) fieldValue).stream().allMatch(item -> item instanceof DocumentResponseBean)) {
List<DocumentResponseBean> documentList = (List<DocumentResponseBean>) fieldValue;
List<String> names = documentList.stream()
.map(DocumentResponseBean::getName)
.collect(Collectors.toList());
fieldValue = names;
}
} else if (name.equals("checkboxes") && fieldValue instanceof List<?>) { } else if (name.equals("checkboxes") && fieldValue instanceof List<?>) {
List<String> check = (List<String>) fieldValue; List<String> check = (List<String>) fieldValue;
List<SettingResponseBean> settingResponseBeans = content.getSettings(); List<SettingResponseBean> settingResponseBeans = content.getSettings();
@@ -529,15 +562,12 @@ public class PdfDao {
// Further processing of field value (e.g., finding labels in options) // Further processing of field value (e.g., finding labels in options)
fieldValue = findLabelInOptions(content.getSettings(), fieldValue); fieldValue = findLabelInOptions(content.getSettings(), fieldValue);
} else {
// If no matching form field is found, store contentId with an empty string
fieldValue = "";
} }
try { try {
if((contentLabel!=null && Boolean.FALSE.equals(contentLabel.isEmpty())) || (fieldValue!=null && !StringUtils.isEmpty((CharSequence) fieldValue))) { if((contentLabel==null || StringUtils.isEmpty(contentLabel)) && (fieldValue==null || StringUtils.isEmpty(fieldValue.toString()))) {
addLabelValuePair(writer, document, contentLabel, fieldValue, labelFont, valueFont, content); continue;
} }
addLabelValuePair(writer, document, contentLabel, fieldValue, labelFont, valueFont, content);
} catch (DocumentException e) { } catch (DocumentException e) {
log.error("Error checking object: " + e.getMessage(), e); log.error("Error checking object: " + e.getMessage(), e);

View File

@@ -29,15 +29,15 @@ public interface ApplicationRepository extends JpaRepository<ApplicationEntity,
public Optional<ApplicationEntity> findByIdAndUserIdAndCallIdAndIsDeletedFalse(Long applicationId, Long userId, public Optional<ApplicationEntity> findByIdAndUserIdAndCallIdAndIsDeletedFalse(Long applicationId, Long userId,
Long callId); Long callId);
@Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.userId = :userId AND a.company.id = :companyId AND a.status = 'SUBMIT' ") @Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.userId = :userId AND a.company.id = :companyId AND a.status = 'SUBMIT' AND a.isDeleted = false")
Long countSubmittedApplicationsByUserId(@Param("userId") Long userId, @Param("companyId") Long companyId); Long countSubmittedApplicationsByUserId(@Param("userId") Long userId, @Param("companyId") Long companyId);
List<ApplicationEntity> findByCompanyIdAndUserIdAndIsDeletedFalse(Long companyId,Long userId); List<ApplicationEntity> findByCompanyIdAndUserIdAndIsDeletedFalse(Long companyId,Long userId);
@Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'SUBMIT' And a.hubId = :hubId") @Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'SUBMIT' And a.hubId = :hubId AND a.isDeleted = false")
public Long countSubmittedApplicationsByHubId(@Param("hubId") Long hubId); public Long countSubmittedApplicationsByHubId(@Param("hubId") Long hubId);
@Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'DRAFT' And a.hubId = :hubId") @Query("SELECT COUNT(a) FROM ApplicationEntity a WHERE a.status = 'DRAFT' And a.hubId = :hubId AND a.isDeleted = false")
public Long countDraftApplicationsByHubId(@Param("hubId") Long hubId); public Long countDraftApplicationsByHubId(@Param("hubId") Long hubId);
@Query("SELECT a.call.id FROM ApplicationEntity a WHERE a.id = :id") @Query("SELECT a.call.id FROM ApplicationEntity a WHERE a.id = :id")

View File

@@ -39,59 +39,104 @@ public class ApplicationAmendmentRequestServiceImpl implements ApplicationAmendm
@Override @Override
public ApplicationAmendmentRequestResponse getApplicationDataForAmendment(HttpServletRequest request, Long applicationEvaluationId) { public ApplicationAmendmentRequestResponse getApplicationDataForAmendment(HttpServletRequest request, Long applicationEvaluationId) {
UserEntity user= validator.validateUser(request); Optional<ApplicationEvaluationEntity> entityOptional = applicationEvaluationRepository.findByIdAndIsDeletedFalse(applicationEvaluationId);
return applicationAmendmentRequestDao.getApplicationDataForAmendment(request,applicationEvaluationId); entityOptional.ifPresent(applicationEvaluationEntity -> validator.validatePreInstructor(request, applicationEvaluationEntity.getUserId()));
return applicationAmendmentRequestDao.getApplicationDataForAmendment(applicationEvaluationId);
} }
@Override @Override
public ApplicationAmendmentRequestResponse createApplicationAmendmentRequest(HttpServletRequest request, Long applicationEvaluationId , ApplicationAmendmentRequest applicationAmendmentRequest) { public ApplicationAmendmentRequestResponse createApplicationAmendmentRequest(HttpServletRequest request, Long applicationEvaluationId , ApplicationAmendmentRequest applicationAmendmentRequest) {
UserEntity user= validator.validateUser(request); Optional<ApplicationEvaluationEntity> entityOptional = applicationEvaluationRepository.findByIdAndIsDeletedFalse(applicationEvaluationId);
entityOptional.ifPresent(applicationEvaluationEntity -> validator.validatePreInstructor(request, applicationEvaluationEntity.getUserId()));
return applicationAmendmentRequestDao.createApplicationAmendmentRequest(applicationEvaluationId,applicationAmendmentRequest); return applicationAmendmentRequestDao.createApplicationAmendmentRequest(applicationEvaluationId,applicationAmendmentRequest);
} }
@Override @Override
public void deleteApplicationAmendmentRequest(HttpServletRequest request, Long id) { public void deleteApplicationAmendmentRequest(HttpServletRequest request, Long id) {
ApplicationAmendmentRequestEntity amendment = applicationAmendmentRequestRepository.findByIdAndIsDeletedFalse(id)
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
Translator.toLocale(GepafinConstant.APPLICATION_AMENDMENT_NOT_FOUND_MSG)));
Optional<ApplicationEvaluationEntity> entityOptional = applicationEvaluationRepository.findByIdAndIsDeletedFalse(amendment.getApplicationEvaluationEntity().getId());
if (entityOptional.isPresent()) {
UserEntity user = validator.validatePreInstructor(request, entityOptional.get().getUserId());
applicationAmendmentRequestDao.deleteById(id); applicationAmendmentRequestDao.deleteById(id);
} }
}
@Override @Override
public ApplicationAmendmentRequestResponse getApplicationAmendmentRequestById(HttpServletRequest request,Long id) { public ApplicationAmendmentRequestResponse getApplicationAmendmentRequestById(HttpServletRequest request,Long id) {
ApplicationAmendmentRequestEntity amendment = applicationAmendmentRequestRepository.findByIdAndIsDeletedFalse(id)
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
Translator.toLocale(GepafinConstant.APPLICATION_AMENDMENT_NOT_FOUND_MSG)));
Optional<ApplicationEvaluationEntity> entityOptional = applicationEvaluationRepository.findByIdAndIsDeletedFalse(amendment.getApplicationEvaluationEntity().getId());
if (entityOptional.isPresent()) {
UserEntity user = validator.validatePreInstructor(request, entityOptional.get().getUserId());
}
return applicationAmendmentRequestDao.getApplicationAmendmentRequestById(id); return applicationAmendmentRequestDao.getApplicationAmendmentRequestById(id);
} }
@Override @Override
public List<ApplicationAmendmentRequestResponse> getAllApplicationAmendmentRequest(HttpServletRequest request,Long userId) { public List<ApplicationAmendmentRequestResponse> getAllApplicationAmendmentRequest(HttpServletRequest request,Long userId) {
UserEntity user = validator.validatePreInstructor(request, userId);
return applicationAmendmentRequestDao.getAllApplicationAmendmentRequest(request,userId); return applicationAmendmentRequestDao.getAllApplicationAmendmentRequest(request,userId);
} }
@Override @Override
public ApplicationAmendmentRequestResponse updateApplicationAmendment(HttpServletRequest request, Long id, ApplicationAmendmentRequestBean applicationAmendmentRequestBean) { public ApplicationAmendmentRequestResponse updateApplicationAmendment(HttpServletRequest request, Long id, ApplicationAmendmentRequestBean applicationAmendmentRequestBean) {
UserEntity updatedByUser= validator.validateUser(request); ApplicationAmendmentRequestEntity amendment = applicationAmendmentRequestRepository.findByIdAndIsDeletedFalse(id)
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
Translator.toLocale(GepafinConstant.APPLICATION_AMENDMENT_NOT_FOUND_MSG)));
Optional<ApplicationEvaluationEntity> entityOptional = applicationEvaluationRepository.findByIdAndIsDeletedFalse(amendment.getApplicationEvaluationEntity().getId());
if (entityOptional.isPresent()) {
UserEntity user = validator.validatePreInstructor(request, entityOptional.get().getUserId());
}
return applicationAmendmentRequestDao.updateApplicationAmendment(id,applicationAmendmentRequestBean); return applicationAmendmentRequestDao.updateApplicationAmendment(id,applicationAmendmentRequestBean);
} }
@Override @Override
public ApplicationAmendmentRequestEntity validateApplicationAmendmentRequest(Long applicationAmendmentId) { public ApplicationAmendmentRequestEntity validateApplicationAmendmentRequest(Long applicationAmendmentId) {
return applicationAmendmentRequestDao.validateApplicationAmendmentRequest(applicationAmendmentId); return applicationAmendmentRequestDao.validateApplicationAmendmentRequest(applicationAmendmentId);
} }
@Override @Override
public List<ApplicationAmendmentRequestResponse> getAllAmendmentRequestByBeneficiaryId(HttpServletRequest request, Long beneficiaryId) { public List<ApplicationAmendmentRequestResponse> getAllAmendmentRequestByBeneficiaryId(HttpServletRequest request, Long beneficiaryId) {
UserEntity user= validator.validateUser(request);
return applicationAmendmentRequestDao.getAllAmendmentRequestByBeneficiaryId(beneficiaryId); return applicationAmendmentRequestDao.getAllAmendmentRequestByBeneficiaryId(beneficiaryId);
} }
@Override @Override
public ApplicationAmendmentRequestResponse closeAmendmentRequest(HttpServletRequest request, Long id, CloseAmendmentRequest closeAmendmentRequest) { public ApplicationAmendmentRequestResponse closeAmendmentRequest(HttpServletRequest request, Long id, CloseAmendmentRequest closeAmendmentRequest) {
ApplicationAmendmentRequestEntity amendment = applicationAmendmentRequestRepository.findByIdAndIsDeletedFalse(id)
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
Translator.toLocale(GepafinConstant.APPLICATION_AMENDMENT_NOT_FOUND_MSG)));
Optional<ApplicationEvaluationEntity> entityOptional = applicationEvaluationRepository.findByIdAndIsDeletedFalse(amendment.getApplicationEvaluationEntity().getId());
if (entityOptional.isPresent()) {
UserEntity user = validator.validatePreInstructor(request, entityOptional.get().getUserId());
}
return applicationAmendmentRequestDao.closeAmendmentRequest(id,closeAmendmentRequest); return applicationAmendmentRequestDao.closeAmendmentRequest(id,closeAmendmentRequest);
} }
@Override @Override
public ApplicationAmendmentRequestResponse extendResponseDays(HttpServletRequest request, Long id, Long addedDays) { public ApplicationAmendmentRequestResponse extendResponseDays(HttpServletRequest request, Long id, Long addedDays) {
UserEntity user= validator.validateUser(request);
return applicationAmendmentRequestDao.extendResponseDays(id, addedDays); return applicationAmendmentRequestDao.extendResponseDays(id, addedDays);
} }
public ApplicationAmendmentRequestResponse getAmendmentByApplicationId(HttpServletRequest request, Long applicationId) { public ApplicationAmendmentRequestResponse getAmendmentByApplicationId(HttpServletRequest request, Long applicationId) {
UserEntity user= validator.validateUser(request); ApplicationAmendmentRequestEntity amendment = applicationAmendmentRequestRepository.findByApplicationIdAndIsDeletedFalse(applicationId);
if(amendment!=null) {
Optional<ApplicationEvaluationEntity> entityOptional = applicationEvaluationRepository.findByIdAndIsDeletedFalse(amendment.getApplicationEvaluationEntity().getId());
if (entityOptional.isPresent()) {
UserEntity user = validator.validatePreInstructor(request, entityOptional.get().getUserId());
}}
return applicationAmendmentRequestDao.getAmendmentByApplicationId(request,applicationId); return applicationAmendmentRequestDao.getAmendmentByApplicationId(request,applicationId);
} }
@Override @Override

View File

@@ -181,7 +181,7 @@ public interface ApplicationAmendmentRequestApi {
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = { @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })) @ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) }))
}) })
@PostMapping(value = "sendReminderEmail/{amendmentId}", produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/{amendmentId}/reminder", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<Response<Void>> sendReminderEmail(HttpServletRequest request, ResponseEntity<Response<Void>> sendReminderEmail(HttpServletRequest request,
@Parameter( required = true) @Parameter( required = true)
@PathVariable(value = "amendmentId") Long amendmentId); @PathVariable(value = "amendmentId") Long amendmentId);

View File

@@ -23,6 +23,8 @@ spring.liquibase.enabled=true
springdoc.api-docs.path=/v1/api-docs springdoc.api-docs.path=/v1/api-docs
springdoc.swagger-ui.tagsSorter=alpha springdoc.swagger-ui.tagsSorter=alpha
#signed_document_callIds for more file type upload feature.
call.id=10
#aws configuration #aws configuration
aws.access.key.id=AKIAVWDQWCUEOSUN4LUW aws.access.key.id=AKIAVWDQWCUEOSUN4LUW

View File

@@ -1711,4 +1711,13 @@
<sqlFile dbms="postgresql" <sqlFile dbms="postgresql"
path="db/dump/insert_system_email_template_for_sollecito_30_10_2024.sql"/> path="db/dump/insert_system_email_template_for_sollecito_30_10_2024.sql"/>
</changeSet> </changeSet>
<changeSet id="04-11-2024_1" author="Piyush">
<sqlFile dbms="postgresql"
path="db/dump/update_system_email_template_for_notification_mail_04_11_2024_1.sql"/>
</changeSet>
<changeSet id="05-11-2024_4" author="Harish Bagora">
<sqlFile dbms="postgresql"
path="db/dump/update_system_email_template_for_notification_mail_05_11_2024_4.sql"/>
</changeSet>
</databaseChangeLog> </databaseChangeLog>

View File

@@ -1,5 +1,14 @@
UPDATE gepafin_schema.system_email_template INSERT INTO gepafin_schema.system_email_template
SET html_content = '<html> (
id, template_name, "type", html_content, subject, "json", "system",
is_deleted, created_date, updated_date
)
VALUES
(
3,
'Instructional Aid/Request for Documentation Integration Template',
'DOCUMENTATION_INTEGRATION_REQUEST',
'<html>
<body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;"> <body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;"> <div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p><strong>RICHIESTA INTEGRAZIONE DOCUMENTALE</strong></p> <p><strong>RICHIESTA INTEGRAZIONE DOCUMENTALE</strong></p>
@@ -22,11 +31,27 @@ SET html_content = '<html>
<p><strong>{{email_signature}}</strong></p> <p><strong>{{email_signature}}</strong></p>
</div> </div>
</body> </body>
</html>' </html>',
WHERE "type" = 'DOCUMENTATION_INTEGRATION_REQUEST' AND "system" = true; 'RICHIESTA INTEGRAZIONE DOCUMENTALE - {{call_name}}',
NULL,
true,
false,
'2024-10-26 20:00:00',
'2024-10-26 20:00:00'
);
UPDATE gepafin_schema.system_email_template -- Insert for INADMISSIBILITY_NOTIFICATION_DUE_TO_FAILURE
SET html_content = '<html> INSERT INTO gepafin_schema.system_email_template
(
id, template_name, "type", html_content, subject, "json", "system",
is_deleted, created_date, updated_date
)
VALUES
(
4,
'Notification of Inadmissibility Due to Failure to Respond Template',
'INADMISSIBILITY_NOTIFICATION_DUE_TO_FAILURE',
'<html>
<body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;"> <body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;"> <div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p><strong>Comunicazione di non ammissibilità per mancata risposta a richiesta integrazione documentale</strong></p> <p><strong>Comunicazione di non ammissibilità per mancata risposta a richiesta integrazione documentale</strong></p>
@@ -40,11 +65,27 @@ SET html_content = '<html>
<p><strong>{{email_signature}}</strong></p> <p><strong>{{email_signature}}</strong></p>
</div> </div>
</body> </body>
</html>' </html>',
WHERE "type" = 'INADMISSIBILITY_NOTIFICATION_DUE_TO_FAILURE' AND "system" = true; 'BANDO {{call_name}} - Domanda di finanziamento non ammessa {{company_name}}',
NULL,
true,
false,
'2024-10-26 20:00:00',
'2024-10-26 20:00:00'
);
UPDATE gepafin_schema.system_email_template -- Insert for ADMISSIBILITY_NOTIFICATION
SET html_content = '<html> INSERT INTO gepafin_schema.system_email_template
(
id, template_name, "type", html_content, subject, "json", "system",
is_deleted, created_date, updated_date
)
VALUES
(
5,
'Notification of Admissibility Template',
'ADMISSIBILITY_NOTIFICATION',
'<html>
<body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;"> <body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;"> <div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p>Buongiorno,</p> <p>Buongiorno,</p>
@@ -56,11 +97,27 @@ SET html_content = '<html>
<p><strong>{{email_signature}}</strong></p> <p><strong>{{email_signature}}</strong></p>
</div> </div>
</body> </body>
</html>' </html>',
WHERE "type" = 'ADMISSIBILITY_NOTIFICATION' AND "system" = true; 'BANDO {{call_name}} Esito positivo istruttoria di ammissibilità {{company_name}}',
NULL,
true,
false,
'2024-10-26 20:00:00',
'2024-10-26 20:00:00'
);
UPDATE gepafin_schema.system_email_template -- Insert for INADMISSIBILITY_NOTIFICATION
SET html_content = '<html> INSERT INTO gepafin_schema.system_email_template
(
id, template_name, "type", html_content, subject, "json", "system",
is_deleted, created_date, updated_date
)
VALUES
(
6,
'Notification of Inadmissibility Template',
'INADMISSIBILITY_NOTIFICATION',
'<html>
<body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;"> <body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;"> <div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p>Buongiorno,</p> <p>Buongiorno,</p>
@@ -74,5 +131,11 @@ SET html_content = '<html>
<p><strong>{{email_signature}}</strong></p> <p><strong>{{email_signature}}</strong></p>
</div> </div>
</body> </body>
</html>' </html>',
WHERE "type" = 'INADMISSIBILITY_NOTIFICATION' AND "system" = true; 'BANDO {{call_name}} Esito negativo istruttoria di ammissibilità {{company_name}}',
NULL,
true,
false,
'2024-10-26 20:00:00',
'2024-10-26 20:00:00'
);

View File

@@ -0,0 +1,78 @@
UPDATE gepafin_schema.system_email_template
SET html_content = '<html>
<body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p><strong>RICHIESTA INTEGRAZIONE DOCUMENTALE</strong></p>
<p>Buongiorno,</p>
<p>In riferimento alla domanda di concessione di Finanziamento agevolato a valere sul Fondo prestiti
<strong>{{call_name}}</strong> di cui al <strong>Protocollo n. {{protocol_number}} del
{{protocol_date}} e {{protocol_time}}</strong>, alla luce dellattività istruttoria svolta,
segnaliamo quanto segue:</p>
<ul>
<li>{{form_dataInput}}</li>
</ul>
<p>{{note}}</p>
<p>Vi invitiamo a fornire quanto sopra richiesto integrando la documentazione sia caricandola allinterno dello sportello
online <a href="{{platform_link}}">{{platform_link}}</a> che inviandola a mezzo PEC allindirizzo
{{legal_mail}} entro e <strong>non oltre 10 giorni</strong> dal ricevimento della presente comunicazione,
precisando che, in caso di mancata ricezione nei termini indicati, saremo costretti a non prendere in considerazione la Vostra richiesta di finanziamento.</p>
<p>Vi informiamo che per la ricezione della PEC farà fede la ricevuta di avvenuta consegna che attesterà il buon esito
dellinvio. La documentazione trasmessa e le informazioni fornite saranno processate dall''istruttore assegnatario della pratica.</p>
<p>Distinti Saluti,</p>
<p><strong>{{email_signature}}</strong></p>
</div>
</body>
</html>'
WHERE "type" = 'DOCUMENTATION_INTEGRATION_REQUEST' AND "system" = true;
UPDATE gepafin_schema.system_email_template
SET html_content = '<html>
<body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p><strong>Comunicazione di non ammissibilità per mancata risposta a richiesta integrazione documentale</strong></p>
<p>Buongiorno,</p>
<p>Con posta elettronica certificata del <strong>{{date_time_emailSend}}</strong>, vi abbiamo comunicato che i documenti richiesti
dal Gestore sarebbero dovuti pervenire entro <strong>10 giorni</strong> dal ricevimento di detta comunicazione.
Trascorso il termine senza la ricezione dei documenti richiesti, il Gestore non ha potuto prendere in considerazione la richiesta di finanziamento.</p>
<p>È possibile presentare ricorso tramite modello disponibile nello sportello online
<a href="{{platform_link}}">{{platform_link}}</a> entro <strong>10 giorni</strong> dalla ricezione di questa comunicazione.</p>
<p>Distinti Saluti,</p>
<p><strong>{{email_signature}}</strong></p>
</div>
</body>
</html>'
WHERE "type" = 'INADMISSIBILITY_NOTIFICATION_DUE_TO_FAILURE' AND "system" = true;
UPDATE gepafin_schema.system_email_template
SET html_content = '<html>
<body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p>Buongiorno,</p>
<p>In riferimento alla domanda di concessione di Finanziamento agevolato “<strong>{{call_name}}</strong>” di cui al
<strong>Protocollo n. {{protocol_number}} del {{protocol_date}} alle {{protocol_time}}</strong>, listruttoria di ammissibilità
è stata completata con esito positivo.</p>
<p>Seguirà una comunicazione relativa alla valutazione tecnica ed economico-finanziaria ai fini della valutazione finale.</p>
<p>Distinti Saluti,</p>
<p><strong>{{email_signature}}</strong></p>
</div>
</body>
</html>'
WHERE "type" = 'ADMISSIBILITY_NOTIFICATION' AND "system" = true;
UPDATE gepafin_schema.system_email_template
SET html_content = '<html>
<body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p>Buongiorno,</p>
<p>In riferimento alla domanda di concessione di Finanziamento agevolato “<strong>{{call_name}}</strong>” di cui al
<strong>Protocollo n. {{protocol_number}} del {{protocol_date}} alle {{protocol_time}}</strong>,
l''istruttoria di ammissibilità è stata completata con esito negativo.</p>
<p>Motivazioni: <strong>{{form_text}}</strong></p>
<p>È possibile presentare ricorso tramite modello disponibile nello sportello online
<a href="{{platform_link}}">{{platform_link}}</a> entro <strong>10 giorni</strong> dalla ricezione di questa comunicazione.</p>
<p>Distinti Saluti,</p>
<p><strong>{{email_signature}}</strong></p>
</div>
</body>
</html>'
WHERE "type" = 'INADMISSIBILITY_NOTIFICATION' AND "system" = true;

View File

@@ -0,0 +1,16 @@
UPDATE gepafin_schema.system_email_template
SET
subject = 'BANDO {{call_name}}- Domanda di concessione di finanziamento agevolato {{company_name}}',
html_content = '<html>
<body style="font-family: Arial, sans-serif; color: #000; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p>In riferimento alla domanda di concessione di Finanziamento agevolato a valere sul Fondo prestiti
<strong>{{call_name}}</strong> di cui alloggetto, la stessa è stata regolarmente acquisita ed è stata
registrata con Protocollo n. <strong>{{protocol_number}}</strong> del <strong>{{protocol_date}}</strong>
alle <strong>{{protocol_time}}</strong>.</p>
<p>Distinti Saluti,</p>
<p><strong>{{email_signature}}</strong></p>
</div>
</body>
</html>'
WHERE "type" = 'DOCUMENTATION_INTEGRATION_REQUEST' AND "system" = true;