Merge pull request #208 from Kitzanos/feature/GEPAFINBE-166
GEPAFINBE-166 (Linking the SystemEmailTemplate entity with the hub)
This commit is contained in:
@@ -423,44 +423,8 @@ public class GepafinConstant {
|
|||||||
|
|
||||||
public static final String FORMULA_AMOUNT_NOT_MATCHED="formula.amount.not.matches.requested.amount";
|
public static final String FORMULA_AMOUNT_NOT_MATCHED="formula.amount.not.matches.requested.amount";
|
||||||
public static final String CRITERIA_TABLE_COLUMNS="criteria_table_columns";
|
public static final String CRITERIA_TABLE_COLUMNS="criteria_table_columns";
|
||||||
|
|
||||||
public static final String DOCUMENTATION_INTEGRATION_REQUEST_SVILUPPUMBRIA= "<html>\n" +
|
|
||||||
" <body style=\"font-family: Arial, sans-serif; color: #000; line-height: 1.6;\">\n" +
|
|
||||||
" <div style=\"padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;\">\n" +
|
|
||||||
" <p><strong>RICHIESTA INTEGRAZIONE DOCUMENTALE</strong></p>\n" +
|
|
||||||
" <p>Buongiorno,</p>\n" +
|
|
||||||
" <p>In riferimento alla domanda di concessione di Finanziamento agevolato a valere sul Bando \n" +
|
|
||||||
" “<strong>{{call_name}}</strong>“ di cui al <strong>Protocollo n. {{protocol_number}} del\n" +
|
|
||||||
" {{protocol_date}} e {{protocol_time}}</strong>, alla luce dell'attività istruttoria svolta,\n" +
|
|
||||||
" segnaliamo quanto segue:\n" +
|
|
||||||
" </p>\n" +
|
|
||||||
" {{note}}\n" +
|
|
||||||
" <p>Vi invitiamo a fornire quanto sopra richiesto integrando la documentazione caricandola all'interno dello sportello\n" +
|
|
||||||
" online <a href=\"{{platform_link}}\">{{platform_link}}</a> entro e <strong>non oltre {{response_days}} giorni</strong> dal ricevimento della presente comunicazione,\n" +
|
|
||||||
" precisando che, in caso di mancata ricezione nei termini indicati, saremo costretti a non prendere in considerazione la Vostra richiesta di finanziamento.\n" +
|
|
||||||
" </p>\n" +
|
|
||||||
" <p>La documentazione trasmessa e le informazioni fornite saranno processate dall'istruttore assegnatario della pratica.\n" +
|
|
||||||
" </p>\n" +
|
|
||||||
" <p>Distinti Saluti,</p>\n" +
|
|
||||||
" <p><strong>{{email_signature}}</strong></p>\n" +
|
|
||||||
" </div>\n" +
|
|
||||||
" </body>\n" +
|
|
||||||
"</html>";
|
|
||||||
|
|
||||||
|
|
||||||
public static final String APPLICATION_REJECTED_SVILUPPUMBRIA = "<html>\n" +
|
|
||||||
" <body style=\"font-family: Arial, sans-serif; color: #000; line-height: 1.6;\">\n" +
|
|
||||||
" <div style=\"padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;\">\n" +
|
|
||||||
" <p>Buongiorno,</p>\n" +
|
|
||||||
" <p>Si comunica che, in riferimento alla domanda a valere sul bando “<strong>{{call_name}}</strong>” di cui al\n" +
|
|
||||||
" <strong>Protocollo n. {{protocol_number}} del {{protocol_date}} alle {{protocol_time}}</strong>,\n" +
|
|
||||||
" la stessa è stata sottoposta ad istruttoria di ammissibilità con esito negativo.</p>\n" +
|
|
||||||
" <p>Le motivazioni sono le seguenti: <strong>{{form_text}}</strong></p>\n" +
|
|
||||||
" <p>Vi ricordiamo che i Beneficiari che hanno presentato richieste valutate non ammissibili entro 10 giorni dalla data di ricevimento della presente potranno finoltrare richiesta di chiarimenti e/o osservazioni alla scrivente Società ai sensi e per gli effetti dell’art.10 bis della L.241/1990 e s.m.i.</p>\n" +
|
|
||||||
" <p>Distinti Saluti,</p>\n" +
|
|
||||||
" <p><strong>{{email_signature}}</strong></p>\n" +
|
|
||||||
" </div>\n" +
|
|
||||||
" </body>\n" +
|
|
||||||
"</html>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -94,19 +94,7 @@ public class EmailNotificationDao {
|
|||||||
subjectPlaceholders.put("{{company_name}}", company.getCompanyName());
|
subjectPlaceholders.put("{{company_name}}", company.getCompanyName());
|
||||||
// bodyPlaceholders.put("{{legal_mail}}", legalMail);
|
// bodyPlaceholders.put("{{legal_mail}}", legalMail);
|
||||||
String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders);
|
String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders);
|
||||||
String body;
|
String body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
|
||||||
if ("t7jh5wfg9QXylNaTZkPoE".equals(hubEntity.getUniqueUuid()) && templateType.equals(SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.DOCUMENTATION_INTEGRATION_REQUEST)) {
|
|
||||||
bodyPlaceholders.put("{{email_signature}}", hubEntity.getEmailSignature());
|
|
||||||
bodyPlaceholders.put("{{platform_link}}",hubEntity.getDomainName());
|
|
||||||
body = Utils.replacePlaceholders(GepafinConstant.DOCUMENTATION_INTEGRATION_REQUEST_SVILUPPUMBRIA, bodyPlaceholders);
|
|
||||||
}
|
|
||||||
else if ("t7jh5wfg9QXylNaTZkPoE".equals(hubEntity.getUniqueUuid()) && templateType.equals(SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.INADMISSIBILITY_TEMPLATE)) {
|
|
||||||
bodyPlaceholders.put("{{email_signature}}", hubEntity.getEmailSignature());
|
|
||||||
body = Utils.replacePlaceholders(GepafinConstant.APPLICATION_REJECTED_SVILUPPUMBRIA, bodyPlaceholders);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new EmailContentResponse(subject, body, systemEmailTemplateResponse);
|
return new EmailContentResponse(subject, body, systemEmailTemplateResponse);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ public class SystemEmailTemplatesDao {
|
|||||||
public SystemEmailTemplateResponse retrieveTemplate(SystemEmailTemplatesEntityTypeEnum type, HubEntity hub, Locale language) {
|
public SystemEmailTemplateResponse retrieveTemplate(SystemEmailTemplatesEntityTypeEnum type, HubEntity hub, Locale language) {
|
||||||
SystemEmailTemplatesEntity dbSystemEmailTemplatesEntity = null;
|
SystemEmailTemplatesEntity dbSystemEmailTemplatesEntity = null;
|
||||||
if(hub != null){
|
if(hub != null){
|
||||||
// dbSystemEmailTemplatesEntity = systemEmailTemplatesRespository
|
dbSystemEmailTemplatesEntity = systemEmailTemplatesRespository
|
||||||
// .findByTypeAndCallId(type.getValue(), call.getId());
|
.findByTypeAndHubEntityId(type.getValue(), hub.getId());
|
||||||
}
|
}
|
||||||
if(dbSystemEmailTemplatesEntity == null) {
|
if(dbSystemEmailTemplatesEntity == null){
|
||||||
dbSystemEmailTemplatesEntity = systemEmailTemplatesRespository
|
dbSystemEmailTemplatesEntity = systemEmailTemplatesRespository
|
||||||
.findByType(type.getValue());
|
.findByType(type.getValue());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,11 @@ public class SystemEmailTemplatesEntity extends BaseEntity {
|
|||||||
@Column(name = "email_scenario")
|
@Column(name = "email_scenario")
|
||||||
private String emailScenario;
|
private String emailScenario;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "HUB_ID")
|
||||||
|
private HubEntity hubEntity;
|
||||||
|
|
||||||
|
|
||||||
public enum SystemEmailTemplatesEntityTypeEnum {
|
public enum SystemEmailTemplatesEntityTypeEnum {
|
||||||
|
|
||||||
APPLICATION_SUBMISSION_TO_USER_AND_COMPANY("APPLICATION_SUBMISSION_TO_USER_AND_COMPANY"),
|
APPLICATION_SUBMISSION_TO_USER_AND_COMPANY("APPLICATION_SUBMISSION_TO_USER_AND_COMPANY"),
|
||||||
|
|||||||
@@ -14,4 +14,7 @@ public interface SystemEmailTemplatesRespository extends JpaRepository<SystemEma
|
|||||||
@Query("select s from SystemEmailTemplatesEntity s where s.type=:type and s.isDeleted =false and s.system = true")
|
@Query("select s from SystemEmailTemplatesEntity s where s.type=:type and s.isDeleted =false and s.system = true")
|
||||||
SystemEmailTemplatesEntity findByType(@Param("type") String type);
|
SystemEmailTemplatesEntity findByType(@Param("type") String type);
|
||||||
|
|
||||||
|
@Query("select s from SystemEmailTemplatesEntity s where s.type=:type and s.hubEntity.id=:hubId and s.isDeleted =false and s.system = false")
|
||||||
|
SystemEmailTemplatesEntity findByTypeAndHubEntityId(@Param("type") String type, @Param("hubId") Long hubId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2390,6 +2390,26 @@
|
|||||||
|
|
||||||
<sqlFile dbms="postgresql"
|
<sqlFile dbms="postgresql"
|
||||||
path="db/dump/update_form_field_data_06-02-2025.sql"/>
|
path="db/dump/update_form_field_data_06-02-2025.sql"/>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="11-02-2025_RK_111500" author="Rajesh Khore">
|
||||||
|
<addColumn tableName="system_email_template">
|
||||||
|
<column name="hub_id" type="INTEGER">
|
||||||
|
<constraints foreignKeyName="fk_hub_id"
|
||||||
|
references="hub(id)" />
|
||||||
|
</column>
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="11-02-2025_RK_111515" author="Rajesh Khore">
|
||||||
|
<sql dbms="postgresql">select
|
||||||
|
setval('gepafin_schema.system_email_template_id_seq', (select
|
||||||
|
max(id)+1
|
||||||
|
from gepafin_schema.system_email_template), false)
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sqlFile dbms="postgresql"
|
||||||
|
path="db/dump/insert_system_email_template_for_updating_amendment_mail_notification_mail_31_01_2024_1.sql"/>
|
||||||
|
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
INSERT INTO gepafin_schema.system_email_template (template_name, "type", html_content, subject, "json", "system", is_deleted, created_date, updated_date, email_scenario, hub_id)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'Instructional Aid/Request for Documentation Integration Template For Sviluppumbria',
|
||||||
|
'DOCUMENTATION_INTEGRATION_REQUEST',
|
||||||
|
'<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 Bando
|
||||||
|
"<strong>{{call_name}}</strong>" di cui al <strong>Protocollo n. {{protocol_number}} del
|
||||||
|
{{protocol_date}} e {{protocol_time}}</strong>, alla luce dell''attività istruttoria svolta,
|
||||||
|
segnaliamo quanto segue:
|
||||||
|
</p>
|
||||||
|
{{note}}
|
||||||
|
<p>Vi invitiamo a fornire quanto sopra richiesto integrando la documentazione caricandola all''interno dello sportello
|
||||||
|
online <a href="{{platform_link}}">{{platform_link}}</a> entro e <strong>non oltre {{response_days}} 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>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>',
|
||||||
|
'BANDO {{call_name}}- Domanda di concessione di finanziamento agevolato {{company_name}}',
|
||||||
|
NULL,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
CURRENT_TIMESTAMP,
|
||||||
|
CURRENT_TIMESTAMP,
|
||||||
|
'APPLICATION_AMENDMENT_REQUESTED',
|
||||||
|
2
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO gepafin_schema.system_email_template (template_name, "type", html_content, subject, "json", "system", is_deleted, created_date, updated_date, email_scenario, hub_id)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'Notification of Inadmissibility Template',
|
||||||
|
'INADMISSIBILITY_NOTIFICATION',
|
||||||
|
'<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>Si comunica che, in riferimento alla domanda a valere sul bando “<strong>{{call_name}}</strong>” di cui al
|
||||||
|
<strong>Protocollo n. {{protocol_number}} del {{protocol_date}} alle {{protocol_time}}</strong>,
|
||||||
|
la stessa è stata sottoposta ad istruttoria di ammissibilità con esito negativo.</p>
|
||||||
|
<p>Le motivazioni sono le seguenti: <strong>{{form_text}}</strong></p>
|
||||||
|
<p>Vi ricordiamo che i Beneficiari che hanno presentato richieste valutate non ammissibili entro 10 giorni dalla data di ricevimento della presente potranno finoltrare richiesta di chiarimenti e/o osservazioni alla scrivente Società ai sensi e per gli effetti dell’art.10 bis della L.241/1990 e s.m.i.</p>
|
||||||
|
<p>Distinti Saluti,</p>
|
||||||
|
<p><strong>{{email_signature}}</strong></p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>',
|
||||||
|
'BANDO {{call_name}} – Esito negativo istruttoria di ammissibilità {{company_name}}',
|
||||||
|
NULL,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
CURRENT_TIMESTAMP,
|
||||||
|
CURRENT_TIMESTAMP,
|
||||||
|
'APPLICATION_REJECTED',
|
||||||
|
2
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user