Resolved conflicts
This commit is contained in:
2
mvnw
vendored
Normal file → Executable file
2
mvnw
vendored
Normal file → Executable file
@@ -8,7 +8,7 @@
|
|||||||
# "License"); you may not use this file except in compliance
|
# "License"); you may not use this file except in compliance
|
||||||
# with the License. You may obtain a copy of the License at
|
# with the License. You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# https://www.apache.org/licenses/LICENSE-2.0
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing,
|
# Unless required by applicable law or agreed to in writing,
|
||||||
# software distributed under the License is distributed on an
|
# software distributed under the License is distributed on an
|
||||||
|
|||||||
2
mvnw.cmd
vendored
2
mvnw.cmd
vendored
@@ -8,7 +8,7 @@
|
|||||||
@REM "License"); you may not use this file except in compliance
|
@REM "License"); you may not use this file except in compliance
|
||||||
@REM with the License. You may obtain a copy of the License at
|
@REM with the License. You may obtain a copy of the License at
|
||||||
@REM
|
@REM
|
||||||
@REM https://www.apache.org/licenses/LICENSE-2.0
|
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||||
@REM
|
@REM
|
||||||
@REM Unless required by applicable law or agreed to in writing,
|
@REM Unless required by applicable law or agreed to in writing,
|
||||||
@REM software distributed under the License is distributed on an
|
@REM software distributed under the License is distributed on an
|
||||||
|
|||||||
14
pom.xml
14
pom.xml
@@ -231,6 +231,20 @@
|
|||||||
<artifactId>spring-test</artifactId>
|
<artifactId>spring-test</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Notification RabbitMQ and WebSocket/WS-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.projectreactor.netty</groupId>
|
||||||
|
<artifactId>reactor-netty</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ public class TendermanagementApplication {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCorsMappings(CorsRegistry registry) {
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
registry.addMapping("/**").allowedOrigins("http://localhost:3000")
|
registry.addMapping("/**").allowedOrigins("http://localhost:3000", "http://127.0.0.1:5500", "https://bandi-staging.memento.credit", "https://bandi.gepafin.it")
|
||||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "HEAD").allowCredentials(true);
|
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD").allowCredentials(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class SamlSuccessHandler implements AuthenticationSuccessHandler {
|
|||||||
Saml2AuthenticatedPrincipal principal = (Saml2AuthenticatedPrincipal) samlAuth.getPrincipal();
|
Saml2AuthenticatedPrincipal principal = (Saml2AuthenticatedPrincipal) samlAuth.getPrincipal();
|
||||||
|
|
||||||
Map<String, List<Object>> userAttributes = principal.getAttributes();
|
Map<String, List<Object>> userAttributes = principal.getAttributes();
|
||||||
String token = Utils.generateSecureToken();
|
String token = Utils.generateSecureSamlToken();
|
||||||
logger.info("SAML User Attributes: " + userAttributes);
|
logger.info("SAML User Attributes: " + userAttributes);
|
||||||
|
|
||||||
// Extracting raw SAML response
|
// Extracting raw SAML response
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ public class SecurityConfig {
|
|||||||
.requestMatchers("/v1/api-docs/**").permitAll() // API docs
|
.requestMatchers("/v1/api-docs/**").permitAll() // API docs
|
||||||
.requestMatchers("/v1/user/reset-password/initiate").permitAll()
|
.requestMatchers("/v1/user/reset-password/initiate").permitAll()
|
||||||
.requestMatchers("/v1/user/reset-password").permitAll()
|
.requestMatchers("/v1/user/reset-password").permitAll()
|
||||||
|
.requestMatchers("/wss/**").permitAll() // if this is not running use this /gs-guide-websocket
|
||||||
.anyRequest().authenticated())
|
.anyRequest().authenticated())
|
||||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED))
|
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED))
|
||||||
.exceptionHandling(exceptionHandling -> exceptionHandling
|
.exceptionHandling(exceptionHandling -> exceptionHandling
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package net.gepafin.tendermanagement.config;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
||||||
|
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
|
||||||
|
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
|
||||||
|
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableWebSocketMessageBroker
|
||||||
|
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||||
|
|
||||||
|
@Value("${spring.rabbitmq.host}")
|
||||||
|
private String relayHost;
|
||||||
|
|
||||||
|
@Value("${spring.rabbitmq.port}")
|
||||||
|
private int relayPort;
|
||||||
|
|
||||||
|
@Value("${spring.rabbitmq.username}")
|
||||||
|
private String clientUserName;
|
||||||
|
|
||||||
|
@Value("${spring.rabbitmq.password}")
|
||||||
|
private String clientPassword;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configureMessageBroker(MessageBrokerRegistry config) {
|
||||||
|
|
||||||
|
config.enableStompBrokerRelay("/topic").setRelayHost(relayHost).setRelayPort(relayPort).setClientLogin(clientUserName).setClientPasscode(clientPassword);
|
||||||
|
config.setApplicationDestinationPrefixes("/app");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
||||||
|
|
||||||
|
registry.addEndpoint("/wss").setAllowedOrigins("http://localhost:3000", "http://127.0.0.1:5500", "https://bandi-staging.memento.credit", "https://bandi.gepafin.it")
|
||||||
|
.withSockJS();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -305,6 +305,8 @@ public class GepafinConstant {
|
|||||||
public static final String USER_ID = "userId";
|
public static final String USER_ID = "userId";
|
||||||
public static final String LOGIN_ATTEMPT_ID = "loginAttemptId";
|
public static final String LOGIN_ATTEMPT_ID = "loginAttemptId";
|
||||||
public static final String USER_ACTION_ID = "userActionId";
|
public static final String USER_ACTION_ID = "userActionId";
|
||||||
|
public static final String RESET_PASSWORD_URL_FORMAT = "/reset-password?token=%s&email=%s";
|
||||||
|
public static final String VALID_VATNUMBER_MSG = "valid.vatnumber.message";
|
||||||
public static final String ATLEAST_ONE_ID_REQUIRED="atleast.one.id.required";
|
public static final String ATLEAST_ONE_ID_REQUIRED="atleast.one.id.required";
|
||||||
|
|
||||||
//Appointment
|
//Appointment
|
||||||
@@ -342,5 +344,16 @@ public class GepafinConstant {
|
|||||||
public static final String DOCUMENT_UPLOADING_IN_PROGRESS = "document.uploading.is.in.progress";
|
public static final String DOCUMENT_UPLOADING_IN_PROGRESS = "document.uploading.is.in.progress";
|
||||||
public static final String ASYNC_DOCUMENT_UPLOAD_NAME = "AsyncDocumentUpload-";
|
public static final String ASYNC_DOCUMENT_UPLOAD_NAME = "AsyncDocumentUpload-";
|
||||||
public static final String All_DOCUMENT_CHECKED_AND_ONE_CHECKLIST_CHECKED="all.document.checked.and.one.checklist.checked";
|
public static final String All_DOCUMENT_CHECKED_AND_ONE_CHECKLIST_CHECKED="all.document.checked.and.one.checklist.checked";
|
||||||
|
|
||||||
|
//Notification
|
||||||
|
public static final String COMMON_SINGLE_CHANNEL_PREFIX = "/topic/notifications_user_";
|
||||||
|
public static final String COMPANY_PREFIX = "_company_";
|
||||||
|
public static final String NOTIFICATION_SENT_SUCCESSFULLY = "notification.sent.successfully";
|
||||||
|
public static final String NOTIFICATION_FETCHED_SUCCESSFULLY= "notification.fetched.successfully";
|
||||||
|
public static final String NOTIFICATION_NOT_FOUND= "notification.not.found";
|
||||||
|
public static final String NOTIFICATION_ALREADY_IN_THAT_STATE="notification.already.in.state";
|
||||||
|
public static final String NOTIFICATION_DELETED_SUCCESSFULLY="notification.deleted.successfully";
|
||||||
|
public static final String NOTIFICATION_UPDATED_SUCCESSFULLY="notification.updated.successfully";
|
||||||
|
public static final String USER_WITH_COMPANY_NOT_FOUND = "user.with.company.not.found";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,14 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DocumentRepository documentRepository;
|
private DocumentRepository documentRepository;
|
||||||
|
@Autowired
|
||||||
|
private CompanyService companyService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationDao notificationDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserRepository userRepository;
|
||||||
|
|
||||||
public ApplicationAmendmentRequestResponse getApplicationDataForAmendment(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);
|
||||||
@@ -231,7 +239,7 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
log.info("Submiting application data for amendment Process with details: {}", applicationEvaluationId);
|
log.info("Submiting application data for amendment Process with details: {}", applicationEvaluationId);
|
||||||
|
|
||||||
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity = createApplicationAmendmentRequestEntity(applicationAmendmentRequest, applicationEvaluationId);
|
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity = createApplicationAmendmentRequestEntity(applicationAmendmentRequest, applicationEvaluationId);
|
||||||
ApplicationAmendmentRequestResponse applicationAmendmentRequestResponse = convertEntityToResponse(applicationAmendmentRequestEntity);
|
ApplicationAmendmentRequestResponse applicationAmendmentRequestResponse = convertEntityToResponse(applicationAmendmentRequestEntity,false);
|
||||||
log.info("Application submitted successfully for amendment", applicationAmendmentRequestResponse);
|
log.info("Application submitted successfully for amendment", applicationAmendmentRequestResponse);
|
||||||
if (Boolean.TRUE.equals(applicationAmendmentRequestResponse.getIsSendEmail())) {
|
if (Boolean.TRUE.equals(applicationAmendmentRequestResponse.getIsSendEmail())) {
|
||||||
emailNotificationDao.sendMailToNotifyBeneficiaryRegardingNewAmendment(applicationAmendmentRequestEntity);
|
emailNotificationDao.sendMailToNotifyBeneficiaryRegardingNewAmendment(applicationAmendmentRequestEntity);
|
||||||
@@ -326,6 +334,10 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
assignedApplicationsEntity.setStatus(AssignedApplicationEnum.SOCCORSO.getValue());
|
assignedApplicationsEntity.setStatus(AssignedApplicationEnum.SOCCORSO.getValue());
|
||||||
assignedApplicationsRepository.save(assignedApplicationsEntity);
|
assignedApplicationsRepository.save(assignedApplicationsEntity);
|
||||||
|
|
||||||
|
Map<String, String> placeHolders = notificationDao.sendNotificationToBeneficiary(applicationEntity, NotificationTypeEnum.AMENDMENT_CREATION);
|
||||||
|
|
||||||
|
notificationDao.sendNotificationToInstructor(placeHolders,applicationAmendmentRequestEntity.getApplicationEvaluationEntity(),NotificationTypeEnum.AMENDMENT_CREATION);
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for the "Update Assigned Application" operation. **/
|
/** This code is responsible for adding a version history log for the "Update Assigned Application" operation. **/
|
||||||
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldAssignedApplication).newData(assignedApplicationsEntity).build());
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldAssignedApplication).newData(assignedApplicationsEntity).build());
|
||||||
}
|
}
|
||||||
@@ -362,8 +374,8 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
return applicationAmendmentRequest;
|
return applicationAmendmentRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApplicationAmendmentRequestResponse convertEntityToResponse(ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity) {
|
public ApplicationAmendmentRequestResponse convertEntityToResponse(ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity,boolean includeEmailContent) {
|
||||||
ApplicationAmendmentRequestResponse response = initializeBasicResponse(applicationAmendmentRequestEntity);
|
ApplicationAmendmentRequestResponse response = initializeBasicResponse(applicationAmendmentRequestEntity,includeEmailContent);
|
||||||
|
|
||||||
List<ApplicationFormEntity> forms = applicationFormRepository.findByApplicationId(applicationAmendmentRequestEntity.getApplicationId());
|
List<ApplicationFormEntity> forms = applicationFormRepository.findByApplicationId(applicationAmendmentRequestEntity.getApplicationId());
|
||||||
Map<String, String> fieldIdToLabelMap = extractFieldIdToLabelMap(forms);
|
Map<String, String> fieldIdToLabelMap = extractFieldIdToLabelMap(forms);
|
||||||
@@ -431,8 +443,12 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private ApplicationAmendmentRequestResponse initializeBasicResponse(ApplicationAmendmentRequestEntity entity) {
|
private ApplicationAmendmentRequestResponse initializeBasicResponse(ApplicationAmendmentRequestEntity entity,boolean includeEmailContent) {
|
||||||
ApplicationAmendmentRequestResponse response = new ApplicationAmendmentRequestResponse();
|
ApplicationAmendmentRequestResponse response = new ApplicationAmendmentRequestResponse();
|
||||||
|
ApplicationEntity applicationEntity = entity.getApplicationEvaluationEntity().getAssignedApplicationsEntity().getApplication();
|
||||||
|
Long hubId = applicationEntity.getHubId();
|
||||||
|
HubEntity hubEntity = hubService.valdateHub(hubId);
|
||||||
|
|
||||||
response.setId(entity.getId());
|
response.setId(entity.getId());
|
||||||
response.setApplicationId(entity.getApplicationId());
|
response.setApplicationId(entity.getApplicationId());
|
||||||
response.setApplicationEvaluationId(entity.getApplicationEvaluationEntity().getId());
|
response.setApplicationEvaluationId(entity.getApplicationEvaluationEntity().getId());
|
||||||
@@ -454,10 +470,17 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
|
|
||||||
UserEntity userEntity = userService.validateUser(application.getUserId());
|
UserEntity userEntity = userService.validateUser(application.getUserId());
|
||||||
response.setBeneficiaryName(buildBeneficiaryName(userEntity));
|
response.setBeneficiaryName(buildBeneficiaryName(userEntity));
|
||||||
|
CompanyEntity company = companyService.validateCompany(application.getCompanyId());
|
||||||
|
response.setCompanyName(company.getCompanyName());
|
||||||
Long protocolNumber = entity.getProtocol() != null ? entity.getProtocol().getProtocolNumber() : null;
|
Long protocolNumber = entity.getProtocol() != null ? entity.getProtocol().getProtocolNumber() : null;
|
||||||
response.setProtocolNumber(protocolNumber);
|
response.setProtocolNumber(protocolNumber);
|
||||||
|
|
||||||
|
if (includeEmailContent) {
|
||||||
|
Map<String, String> bodyPlaceholders = emailNotificationDao.prepareEmailPlaceholders(applicationEntity, entity);
|
||||||
|
EmailContentResponse emailContent = emailNotificationDao.prepareEmailContent(applicationEntity, SystemEmailTemplatesEntityTypeEnum.DOCUMENTATION_INTEGRATION_REQUEST, hubEntity, bodyPlaceholders);
|
||||||
|
String body = emailContent.getBody();
|
||||||
|
response.setEmailTemplate(body);
|
||||||
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,7 +587,7 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
public ApplicationAmendmentRequestResponse getApplicationAmendmentRequestById(Long id) {
|
public ApplicationAmendmentRequestResponse getApplicationAmendmentRequestById(Long id) {
|
||||||
log.info("Fetching application amendment with ID: {}", id);
|
log.info("Fetching application amendment with ID: {}", id);
|
||||||
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity = validateApplicationAmendmentRequest(id);
|
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity = validateApplicationAmendmentRequest(id);
|
||||||
ApplicationAmendmentRequestResponse response = convertEntityToResponse(applicationAmendmentRequestEntity);
|
ApplicationAmendmentRequestResponse response = convertEntityToResponse(applicationAmendmentRequestEntity,true);
|
||||||
log.info("Application Amendment fetched successfully by ID: {}", response);
|
log.info("Application Amendment fetched successfully by ID: {}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -581,7 +604,7 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
applicationAmendmentRequestRepository.findAll(spec);
|
applicationAmendmentRequestRepository.findAll(spec);
|
||||||
|
|
||||||
return applicationAmendmentRequestEntities.stream()
|
return applicationAmendmentRequestEntities.stream()
|
||||||
.map(this::convertEntityToResponse)
|
.map(entity -> convertEntityToResponse(entity, false))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -641,7 +664,7 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
setAmendmentDocuments(updateRequest.getAmendmentNotes(),updateRequest.getAmendmentDocuments(), existingApplicationAmendment);
|
setAmendmentDocuments(updateRequest.getAmendmentNotes(),updateRequest.getAmendmentDocuments(), existingApplicationAmendment);
|
||||||
}
|
}
|
||||||
ApplicationAmendmentRequestEntity updatedApplicationAmendment = saveApplicationAmendmentRequestEntity(existingApplicationAmendment,oldApplicationAmendmentEntity,VersionActionTypeEnum.UPDATE);
|
ApplicationAmendmentRequestEntity updatedApplicationAmendment = saveApplicationAmendmentRequestEntity(existingApplicationAmendment,oldApplicationAmendmentEntity,VersionActionTypeEnum.UPDATE);
|
||||||
ApplicationAmendmentRequestResponse response = convertEntityToResponse(updatedApplicationAmendment);
|
ApplicationAmendmentRequestResponse response = convertEntityToResponse(updatedApplicationAmendment,false);
|
||||||
log.info("Application Amendment updated successfully: {}", response);
|
log.info("Application Amendment updated successfully: {}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -942,7 +965,7 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
applicationAmendmentRequestRepository.findByUserId(beneficiaryUserId);
|
applicationAmendmentRequestRepository.findByUserId(beneficiaryUserId);
|
||||||
|
|
||||||
return entities.stream()
|
return entities.stream()
|
||||||
.map(this::convertEntityToResponse)
|
.map(entity -> convertEntityToResponse(entity, false))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -952,7 +975,6 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
ApplicationAmendmentRequestEntity existingApplicationAmendment = validateApplicationAmendmentRequest(id);
|
ApplicationAmendmentRequestEntity existingApplicationAmendment = validateApplicationAmendmentRequest(id);
|
||||||
//cloned entity for old data and versioning
|
//cloned entity for old data and versioning
|
||||||
ApplicationAmendmentRequestEntity oldApplicationAmendmentEntity = Utils.getClonedEntityForData(existingApplicationAmendment);
|
ApplicationAmendmentRequestEntity oldApplicationAmendmentEntity = Utils.getClonedEntityForData(existingApplicationAmendment);
|
||||||
|
|
||||||
List<ApplicationAmendmentRequestEntity> amendmentRequestList = applicationAmendmentRequestRepository.findAllByApplicationEvaluationIdAndIsDeletedFalse(
|
List<ApplicationAmendmentRequestEntity> amendmentRequestList = applicationAmendmentRequestRepository.findAllByApplicationEvaluationIdAndIsDeletedFalse(
|
||||||
existingApplicationAmendment.getApplicationEvaluationEntity().getId()
|
existingApplicationAmendment.getApplicationEvaluationEntity().getId()
|
||||||
);
|
);
|
||||||
@@ -971,7 +993,7 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
|
|
||||||
ApplicationAmendmentRequestEntity updatedApplicationAmendment = saveApplicationAmendmentRequestEntity(existingApplicationAmendment, oldApplicationAmendmentEntity,
|
ApplicationAmendmentRequestEntity updatedApplicationAmendment = saveApplicationAmendmentRequestEntity(existingApplicationAmendment, oldApplicationAmendmentEntity,
|
||||||
VersionActionTypeEnum.UPDATE);
|
VersionActionTypeEnum.UPDATE);
|
||||||
ApplicationAmendmentRequestResponse response = convertEntityToResponse(updatedApplicationAmendment);
|
ApplicationAmendmentRequestResponse response = convertEntityToResponse(updatedApplicationAmendment,false);
|
||||||
|
|
||||||
List<ApplicationAmendmentRequestEntity> amendmentRequests = applicationAmendmentRequestRepository.findAllByApplicationEvaluationIdAndIsDeletedFalse(
|
List<ApplicationAmendmentRequestEntity> amendmentRequests = applicationAmendmentRequestRepository.findAllByApplicationEvaluationIdAndIsDeletedFalse(
|
||||||
existingApplicationAmendment.getApplicationEvaluationEntity().getId());
|
existingApplicationAmendment.getApplicationEvaluationEntity().getId());
|
||||||
@@ -998,6 +1020,11 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
AssignedApplicationsEntity oldAssignedApplicationData = Utils.getClonedEntityForData(assignedApplicationsEntity);
|
AssignedApplicationsEntity oldAssignedApplicationData = Utils.getClonedEntityForData(assignedApplicationsEntity);
|
||||||
assignedApplicationsEntity = assignedApplicationsRepository.save(existingApplicationAmendment.getApplicationEvaluationEntity().getAssignedApplicationsEntity());
|
assignedApplicationsEntity = assignedApplicationsRepository.save(existingApplicationAmendment.getApplicationEvaluationEntity().getAssignedApplicationsEntity());
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, String> placeHolders = notificationDao.sendNotificationToBeneficiary(application, NotificationTypeEnum.AMENDMENT_CLOSED);
|
||||||
|
|
||||||
|
notificationDao.sendNotificationToInstructor(placeHolders,existingApplicationAmendment.getApplicationEvaluationEntity(),NotificationTypeEnum.AMENDMENT_CLOSED);
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for the "Update Application Evaluation" operation. **/
|
/** This code is responsible for adding a version history log for the "Update Application Evaluation" operation. **/
|
||||||
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldApplicationEvaluationEntity)
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldApplicationEvaluationEntity)
|
||||||
.newData(existingApplicationEvaluationEntity).build());
|
.newData(existingApplicationEvaluationEntity).build());
|
||||||
@@ -1017,6 +1044,7 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ApplicationAmendmentRequestResponse extendResponseDays(Long id, Long newResponseDays) {
|
public ApplicationAmendmentRequestResponse extendResponseDays(Long id, Long newResponseDays) {
|
||||||
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity = validateApplicationAmendmentRequest(id);
|
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity = validateApplicationAmendmentRequest(id);
|
||||||
|
|
||||||
@@ -1030,7 +1058,7 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
/** This code is responsible for adding a version history log for the "Update Application Amendment" operation. **/
|
/** This code is responsible for adding a version history log for the "Update Application Amendment" operation. **/
|
||||||
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldApplicationAmendmentEntity).newData(applicationAmendmentRequestEntity).build());
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldApplicationAmendmentEntity).newData(applicationAmendmentRequestEntity).build());
|
||||||
}
|
}
|
||||||
return convertEntityToResponse(applicationAmendmentRequestEntity);
|
return convertEntityToResponse(applicationAmendmentRequestEntity,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ApplicationAmendmentRequestResponse> getAmendmentByApplicationId(HttpServletRequest request, Long applicationId, List<ApplicationAmendmentRequestEnum> statuses) {
|
public List<ApplicationAmendmentRequestResponse> getAmendmentByApplicationId(HttpServletRequest request, Long applicationId, List<ApplicationAmendmentRequestEnum> statuses) {
|
||||||
@@ -1055,7 +1083,7 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
List<ApplicationAmendmentRequestResponse> response = new ArrayList<>();
|
List<ApplicationAmendmentRequestResponse> response = new ArrayList<>();
|
||||||
if (applicationAmendmentRequestEntity != null) {
|
if (applicationAmendmentRequestEntity != null) {
|
||||||
response = applicationAmendmentRequestEntity.stream()
|
response = applicationAmendmentRequestEntity.stream()
|
||||||
.map(this::convertEntityToResponse)
|
.map(entity -> convertEntityToResponse(entity, false))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
@@ -1075,7 +1103,7 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
/** This code is responsible for adding a version history log for the "Update Application Amendment" operation. **/
|
/** This code is responsible for adding a version history log for the "Update Application Amendment" operation. **/
|
||||||
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldApplicationAmendmentEntity).newData(existingApplicationAmendment).build());
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldApplicationAmendmentEntity).newData(existingApplicationAmendment).build());
|
||||||
}
|
}
|
||||||
ApplicationAmendmentRequestResponse response = convertEntityToResponse(existingApplicationAmendment);
|
ApplicationAmendmentRequestResponse response = convertEntityToResponse(existingApplicationAmendment,false);
|
||||||
log.info("Amendment status updated successfully: {}", response);
|
log.info("Amendment status updated successfully: {}", response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import net.gepafin.tendermanagement.model.request.ApplicationFormFieldRequestBea
|
|||||||
import net.gepafin.tendermanagement.model.request.ApplicationRequest;
|
import net.gepafin.tendermanagement.model.request.ApplicationRequest;
|
||||||
import net.gepafin.tendermanagement.model.request.ApplicationRequestBean;
|
import net.gepafin.tendermanagement.model.request.ApplicationRequestBean;
|
||||||
import net.gepafin.tendermanagement.model.request.EmailLogRequest;
|
import net.gepafin.tendermanagement.model.request.EmailLogRequest;
|
||||||
|
import net.gepafin.tendermanagement.model.request.NotificationReq;
|
||||||
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
|
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
|
||||||
import net.gepafin.tendermanagement.model.response.*;
|
import net.gepafin.tendermanagement.model.response.*;
|
||||||
import net.gepafin.tendermanagement.repositories.*;
|
import net.gepafin.tendermanagement.repositories.*;
|
||||||
@@ -162,6 +163,21 @@ public class ApplicationDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ApplicationEvaluationService applicationEvaluationService;
|
private ApplicationEvaluationService applicationEvaluationService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationDao notificationDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserRepository userRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RoleRepository roleRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ApplicationAmendmentRequestRepository applicationAmendmentRequestRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ApplicationEvaluationRepository applicationEvaluationRepository;
|
||||||
|
|
||||||
public ApplicationResponseBean createApplication(HttpServletRequest request, ApplicationRequestBean applicationRequestBean, Long formId, Long applicationId) {
|
public ApplicationResponseBean createApplication(HttpServletRequest request, ApplicationRequestBean applicationRequestBean, Long formId, Long applicationId) {
|
||||||
FormEntity formEntity = formService.validateForm(formId);
|
FormEntity formEntity = formService.validateForm(formId);
|
||||||
// callService.validatePublishedCall(formEntity.getCall().getId());
|
// callService.validatePublishedCall(formEntity.getCall().getId());
|
||||||
@@ -387,6 +403,16 @@ public class ApplicationDao {
|
|||||||
responseBean.setStatus(applicationEntity.getStatus());
|
responseBean.setStatus(applicationEntity.getStatus());
|
||||||
responseBean.setComments(applicationEntity.getComments());
|
responseBean.setComments(applicationEntity.getComments());
|
||||||
responseBean.setCompanyId(applicationEntity.getCompanyId());
|
responseBean.setCompanyId(applicationEntity.getCompanyId());
|
||||||
|
Optional<AssignedApplicationsEntity> assignedApplicationsOptional =
|
||||||
|
assignedApplicationsRepository.findByApplicationIdAndIsDeletedFalse(applicationEntity.getId());
|
||||||
|
if(assignedApplicationsOptional.isPresent()){
|
||||||
|
responseBean.setAssignedUserId(assignedApplicationsOptional.get().getUserId());
|
||||||
|
UserEntity user = userService.validateUser(assignedApplicationsOptional.get().getUserId());
|
||||||
|
String firstName = user.getFirstName() != null ? user.getFirstName() : "";
|
||||||
|
String lastName = user.getLastName() != null ? user.getLastName() : "";
|
||||||
|
String userName = String.join(" ", firstName, lastName).trim();
|
||||||
|
responseBean.setAssignedUserName(userName);
|
||||||
|
}
|
||||||
CompanyEntity company=companyService.validateCompany(applicationEntity.getCompanyId());
|
CompanyEntity company=companyService.validateCompany(applicationEntity.getCompanyId());
|
||||||
responseBean.setCompanyName(company.getCompanyName());
|
responseBean.setCompanyName(company.getCompanyName());
|
||||||
if(applicationEntity.getProtocol() != null) {
|
if(applicationEntity.getProtocol() != null) {
|
||||||
@@ -841,6 +867,8 @@ public class ApplicationDao {
|
|||||||
applicationEntity.setStatus(ApplicationStatusTypeEnum.SUBMIT.getValue());
|
applicationEntity.setStatus(ApplicationStatusTypeEnum.SUBMIT.getValue());
|
||||||
applicationEntity.setSubmissionDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));
|
applicationEntity.setSubmissionDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));
|
||||||
applicationEntity = applicationRepository.save(applicationEntity);
|
applicationEntity = applicationRepository.save(applicationEntity);
|
||||||
|
Map<String ,String> placeHolders=notificationDao.sendNotificationToBeneficiary(applicationEntity,NotificationTypeEnum.APPLICATION_SUBMISSION);
|
||||||
|
notificationDao.sendNotificationToSuperUser(applicationEntity,placeHolders,NotificationTypeEnum.APPLICATION_SUBMISSION);
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for "Update application status" operation. **/
|
/** This code is responsible for adding a version history log for "Update application status" operation. **/
|
||||||
loggingUtil.addVersionHistory(
|
loggingUtil.addVersionHistory(
|
||||||
@@ -953,6 +981,7 @@ public class ApplicationDao {
|
|||||||
private void sendMailToUserAndCompany(UserEntity userEntity, ApplicationEntity applicationEntity) {
|
private void sendMailToUserAndCompany(UserEntity userEntity, ApplicationEntity applicationEntity) {
|
||||||
CallEntity call =applicationEntity.getCall();
|
CallEntity call =applicationEntity.getCall();
|
||||||
CompanyEntity company=companyService.validateCompany(applicationEntity.getCompanyId());
|
CompanyEntity company=companyService.validateCompany(applicationEntity.getCompanyId());
|
||||||
|
UserWithCompanyEntity userWithCompany=companyService.getUserWithCompany(userEntity.getId(),company.getId());
|
||||||
ProtocolEntity protocol= applicationEntity.getProtocol();
|
ProtocolEntity protocol= applicationEntity.getProtocol();
|
||||||
HubEntity hub = hubService.valdateHub(applicationEntity.getHubId());
|
HubEntity hub = hubService.valdateHub(applicationEntity.getHubId());
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
|
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
|
||||||
@@ -984,8 +1013,8 @@ public class ApplicationDao {
|
|||||||
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(email),emailLogRequest);
|
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(email),emailLogRequest);
|
||||||
List<String> recipientEmails = new ArrayList<>();
|
List<String> recipientEmails = new ArrayList<>();
|
||||||
// recipientEmails.add(email);
|
// recipientEmails.add(email);
|
||||||
String companyEmail = company.getEmail();
|
String companyEmail = userWithCompany.getEmail();
|
||||||
String contactEmail = company.getContactEmail();
|
String contactEmail = userWithCompany.getContactEmail();
|
||||||
|
|
||||||
if (companyEmail != null && !companyEmail.isEmpty()) {
|
if (companyEmail != null && !companyEmail.isEmpty()) {
|
||||||
recipientEmails.add(companyEmail);
|
recipientEmails.add(companyEmail);
|
||||||
@@ -1203,47 +1232,43 @@ public class ApplicationDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public byte[] downloadApplicationDocumentsAsZip(HttpServletRequest request, Long applicationId) {
|
public byte[] downloadApplicationDocumentsAsZip(HttpServletRequest request, Long applicationId) {
|
||||||
|
|
||||||
ApplicationEntity applicationEntity = validateApplication(applicationId);
|
ApplicationEntity applicationEntity = validateApplication(applicationId);
|
||||||
validateAssignedUser(request, applicationId);
|
validateAssignedUser(request, applicationId);
|
||||||
|
|
||||||
Set<Long> documentIds = extractDocumentIdsFromApplicationForms(applicationId);
|
Set<Long> documentIds = extractDocumentIdsFromApplicationForms(applicationId);
|
||||||
List<DocumentEntity> documents = documentRepository.findAllByIdInAndIsDeletedFalse(documentIds);
|
List<DocumentEntity> documents = documentRepository.findAllByIdInAndIsDeletedFalse(documentIds);
|
||||||
|
ApplicationSignedDocumentEntity signedDocument = applicationSignedDocumentRepository.findByApplicationIdAndStatus(applicationId,
|
||||||
ApplicationSignedDocumentEntity signedDocument = applicationSignedDocumentRepository
|
ApplicationSignedDocumentStatusEnum.ACTIVE.getValue());
|
||||||
.findByApplicationIdAndStatus(applicationId, ApplicationSignedDocumentStatusEnum.ACTIVE.getValue());
|
List<DocumentEntity> amendmentDocuments = fetchAmendmentDocuments(applicationId);
|
||||||
if (documents.isEmpty() && signedDocument == null) {
|
List<DocumentEntity> evaluationDocuments = fetchEvaluationDocuments(applicationId);
|
||||||
|
if (documents.isEmpty() && signedDocument == null && amendmentDocuments.isEmpty() && evaluationDocuments.isEmpty()) {
|
||||||
throw new ResourceNotFoundException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.DOCUMENT_NOT_FOUND));
|
throw new ResourceNotFoundException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.DOCUMENT_NOT_FOUND));
|
||||||
}
|
}
|
||||||
return createZipWithDocuments(applicationEntity, documents, signedDocument, applicationId);
|
return createZipWithDocuments(applicationEntity, documents, signedDocument, amendmentDocuments, evaluationDocuments, applicationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateAssignedUser(HttpServletRequest request, Long applicationId) {
|
private void validateAssignedUser(HttpServletRequest request, Long applicationId) {
|
||||||
AssignedApplicationsEntity assignedApplications = assignedApplicationsRepository
|
|
||||||
.findByApplicationIdAndIsDeletedFalse(applicationId).orElse(null);
|
AssignedApplicationsEntity assignedApplications = assignedApplicationsRepository.findByApplicationIdAndIsDeletedFalse(applicationId).orElse(null);
|
||||||
if (assignedApplications != null) {
|
if (assignedApplications != null) {
|
||||||
validator.validatePreInstructor(request, assignedApplications.getUserId());
|
validator.validatePreInstructor(request, assignedApplications.getUserId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<Long> extractDocumentIdsFromApplicationForms(Long applicationId) {
|
private Set<Long> extractDocumentIdsFromApplicationForms(Long applicationId) {
|
||||||
|
|
||||||
Set<Long> documentIds = new HashSet<>();
|
Set<Long> documentIds = new HashSet<>();
|
||||||
List<ApplicationFormEntity> applicationForms = applicationFormRepository.findByApplicationId(applicationId);
|
List<ApplicationFormEntity> applicationForms = applicationFormRepository.findByApplicationId(applicationId);
|
||||||
|
|
||||||
applicationForms.forEach(applicationForm -> {
|
applicationForms.forEach(applicationForm -> {
|
||||||
FormEntity formEntity = applicationForm.getForm();
|
FormEntity formEntity = applicationForm.getForm();
|
||||||
if (formEntity != null) {
|
if (formEntity != null) {
|
||||||
List<ContentResponseBean> contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent();
|
List<ContentResponseBean> contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent();
|
||||||
contentResponseBeans.stream()
|
contentResponseBeans.stream().filter(content -> "fileupload".equals(content.getName())).forEach(content -> {
|
||||||
.filter(content -> "fileupload".equals(content.getName()))
|
Optional<ApplicationFormFieldEntity> formField = applicationFormFieldRepository.findByFieldIdAndApplicationFormIdAndApplicationFormApplicationId(
|
||||||
.forEach(content -> {
|
|
||||||
Optional<ApplicationFormFieldEntity> formField = applicationFormFieldRepository
|
|
||||||
.findByFieldIdAndApplicationFormIdAndApplicationFormApplicationId(
|
|
||||||
content.getId(), applicationForm.getId(), applicationId);
|
content.getId(), applicationForm.getId(), applicationId);
|
||||||
formField.ifPresent(field -> {
|
formField.ifPresent(field -> {
|
||||||
if (field.getFieldValue() != null) {
|
if (field.getFieldValue() != null) {
|
||||||
Arrays.stream(field.getFieldValue().split(","))
|
Arrays.stream(field.getFieldValue().split(",")).map(String::trim).map(Long::valueOf).forEach(documentIds::add);
|
||||||
.map(String::trim)
|
|
||||||
.map(Long::valueOf)
|
|
||||||
.forEach(documentIds::add);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1252,41 +1277,76 @@ public class ApplicationDao {
|
|||||||
return documentIds;
|
return documentIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addDocumentToZip(ZipOutputStream zos, String s3Folder, String filePath, String fileName) {
|
private List<DocumentEntity> fetchAmendmentDocuments(Long applicationId) {
|
||||||
|
|
||||||
|
List<ApplicationAmendmentRequestEntity> amendmentRequests = applicationAmendmentRequestRepository.findByApplicationIdAndIsDeletedFalse(applicationId);
|
||||||
|
Set<Long> amendmentIds = amendmentRequests.stream().map(ApplicationAmendmentRequestEntity::getId).collect(Collectors.toSet());
|
||||||
|
return documentRepository.findBySourceIdInAndSourceAndIsDeletedFalse(amendmentIds, DocumentSourceTypeEnum.AMENDMENT.getValue());
|
||||||
|
}
|
||||||
|
private List<DocumentEntity> fetchEvaluationDocuments(Long applicationId) {
|
||||||
|
|
||||||
|
Optional<ApplicationEvaluationEntity> evaluationEntity = applicationEvaluationRepository.findByApplicationIdAndIsDeletedFalse(applicationId);
|
||||||
|
if (evaluationEntity.isPresent()) {
|
||||||
|
Long evaluationId = evaluationEntity.get().getId();
|
||||||
|
return documentRepository.findBySourceIdInAndSourceAndIsDeletedFalse(Collections.singleton(evaluationId), DocumentSourceTypeEnum.EVALUATION.getValue());
|
||||||
|
}
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
private String fetchProtocolNumberForAmendment(Long amendmentRequestId) {
|
||||||
|
|
||||||
|
ApplicationAmendmentRequestEntity amendmentRequest = applicationAmendmentRequestRepository.findByIdAndIsDeletedFalse(amendmentRequestId).orElse(null);
|
||||||
|
if (amendmentRequest != null && amendmentRequest.getProtocol() != null) {
|
||||||
|
return amendmentRequest.getProtocol().getProtocolNumber().toString();
|
||||||
|
}
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
private void addDocumentToZip(ZipOutputStream zos, String s3Folder, String filePath, String fullPath) {
|
||||||
|
|
||||||
try (InputStream fileInputStream = amazonS3Service.getFile(s3Folder, filePath)) {
|
try (InputStream fileInputStream = amazonS3Service.getFile(s3Folder, filePath)) {
|
||||||
zos.putNextEntry(new ZipEntry(fileName));
|
zos.putNextEntry(new ZipEntry(fullPath));
|
||||||
IOUtils.copy(fileInputStream, zos);
|
IOUtils.copy(fileInputStream, zos);
|
||||||
zos.closeEntry();
|
zos.closeEntry();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("Error downloading or adding document to ZIP: " + fileName, e);
|
throw new RuntimeException("Error downloading or adding document to ZIP: " + fullPath, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private byte[] createZipWithDocuments(ApplicationEntity applicationEntity, List<DocumentEntity> documents, ApplicationSignedDocumentEntity signedDocument,
|
||||||
|
List<DocumentEntity> amendmentDocuments, List<DocumentEntity> evaluationDocuments, Long applicationId) {
|
||||||
|
|
||||||
private byte[] createZipWithDocuments(ApplicationEntity applicationEntity, List<DocumentEntity> documents,
|
try (ByteArrayOutputStream zipOutputStream = new ByteArrayOutputStream(); ZipOutputStream zos = new ZipOutputStream(zipOutputStream)) {
|
||||||
ApplicationSignedDocumentEntity signedDocument, Long applicationId) {
|
Long callId = applicationEntity.getCall().getId();
|
||||||
try (ByteArrayOutputStream zipOutputStream = new ByteArrayOutputStream();
|
// Add Application Documents
|
||||||
ZipOutputStream zos = new ZipOutputStream(zipOutputStream)) {
|
String appS3Folder = s3PathConfig.generateDocumentPath(DocumentSourceTypeEnum.APPLICATION, callId, applicationId, 0L);
|
||||||
|
|
||||||
String s3Folder = s3PathConfig.generateDocumentPath(DocumentSourceTypeEnum.APPLICATION, applicationEntity.getCall().getId(), applicationId,0L);
|
|
||||||
|
|
||||||
for (DocumentEntity document : documents) {
|
for (DocumentEntity document : documents) {
|
||||||
String fileName = Utils.extractFileName(document.getFilePath());
|
String fileName = Utils.extractFileName(document.getFilePath());
|
||||||
addDocumentToZip(zos, s3Folder, document.getFilePath(), fileName);
|
addDocumentToZip(zos, appS3Folder, document.getFilePath(), fileName);
|
||||||
}
|
}
|
||||||
|
// Add Signed Document
|
||||||
if (signedDocument != null) {
|
if (signedDocument != null) {
|
||||||
String signedDocS3Folder = s3PathConfig.generateDocumentPathForOther(DocOtherSourceTypeEnum.USER_SIGNED_DOCUMENT, applicationEntity.getCall().getId(), applicationId,0L);
|
String signedFolder = "SIGNED_DOCUMENT/";
|
||||||
String signedDocFileName = signedDocument.getFileName();
|
String signedDocS3Folder = s3PathConfig.generateDocumentPathForOther(DocOtherSourceTypeEnum.USER_SIGNED_DOCUMENT, callId, applicationId, 0L);
|
||||||
addDocumentToZip(zos, signedDocS3Folder, signedDocument.getFilePath(), signedDocFileName);
|
String fileName = signedDocument.getFileName();
|
||||||
|
addDocumentToZip(zos, signedDocS3Folder, signedDocument.getFilePath(), signedFolder + fileName);
|
||||||
|
}
|
||||||
|
// Add Amendment (Soccorso) Documents
|
||||||
|
for (DocumentEntity amendmentDocument : amendmentDocuments) {
|
||||||
|
String protocolNumber = fetchProtocolNumberForAmendment(amendmentDocument.getSourceId());
|
||||||
|
String amendmentFolder = "SOCCORSO_" + protocolNumber + "/";
|
||||||
|
String amendmentS3Folder = s3PathConfig.generateDocumentPath(DocumentSourceTypeEnum.AMENDMENT, callId, applicationId, amendmentDocument.getSourceId());
|
||||||
|
String fileName = Utils.extractFileName(amendmentDocument.getFilePath());
|
||||||
|
addDocumentToZip(zos, amendmentS3Folder, amendmentDocument.getFilePath(), amendmentFolder + fileName);
|
||||||
|
}
|
||||||
|
// Add Evaluation Documents
|
||||||
|
for (DocumentEntity evaluationDocument : evaluationDocuments) {
|
||||||
|
String evaluationFolder = "EVALUATION/";
|
||||||
|
String evaluationS3Folder = s3PathConfig.generateDocumentPath(DocumentSourceTypeEnum.EVALUATION, callId, applicationId, evaluationDocument.getSourceId());
|
||||||
|
String fileName = Utils.extractFileName(evaluationDocument.getFilePath());
|
||||||
|
addDocumentToZip(zos, evaluationS3Folder, evaluationDocument.getFilePath(), evaluationFolder + fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
zos.finish();
|
zos.finish();
|
||||||
return zipOutputStream.toByteArray();
|
return zipOutputStream.toByteArray();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("Error while creating ZIP file", e);
|
throw new RuntimeException("Error while creating ZIP file", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,12 @@ public class ApplicationEvaluationDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CompanyService companyService;
|
private CompanyService companyService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationDao notificationDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserRepository userRepository;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private Validator validator;
|
private Validator validator;
|
||||||
|
|
||||||
@@ -560,7 +566,16 @@ public class ApplicationEvaluationDao {
|
|||||||
response.setAssignedAt(assignedApplications.getAssignedAt());
|
response.setAssignedAt(assignedApplications.getAssignedAt());
|
||||||
}
|
}
|
||||||
response.setEvaluationEndDate(entity.getEndDate());
|
response.setEvaluationEndDate(entity.getEndDate());
|
||||||
|
Optional<AssignedApplicationsEntity> assignedApplicationsOptional =
|
||||||
|
assignedApplicationsRepository.findByApplicationIdAndIsDeletedFalse(application.getId());
|
||||||
|
if(assignedApplicationsOptional.isPresent()){
|
||||||
|
response.setAssignedUserId(assignedApplicationsOptional.get().getUserId());
|
||||||
|
UserEntity assignedUser = userService.validateUser(assignedApplicationsOptional.get().getUserId());
|
||||||
|
String assignedUserFirstName = assignedUser.getFirstName() != null ? assignedUser.getFirstName() : "";
|
||||||
|
String assignedUserLastName = assignedUser.getLastName() != null ? assignedUser.getLastName() : "";
|
||||||
|
String userName = String.join(" ", assignedUserFirstName, assignedUserLastName).trim();
|
||||||
|
response.setAssignedUserName(userName);
|
||||||
|
}
|
||||||
LocalDateTime callEndDate = application.getCall().getEndDate();
|
LocalDateTime callEndDate = application.getCall().getEndDate();
|
||||||
response.setCallEndDate(callEndDate);
|
response.setCallEndDate(callEndDate);
|
||||||
if (application.getCompanyId() != null) {
|
if (application.getCompanyId() != null) {
|
||||||
@@ -581,7 +596,7 @@ public class ApplicationEvaluationDao {
|
|||||||
Optional<AssignedApplicationsEntity> assignedApplications =
|
Optional<AssignedApplicationsEntity> assignedApplications =
|
||||||
assignedApplicationsRepository.findByIdAndIsDeletedFalse(assignedApplicationId);
|
assignedApplicationsRepository.findByIdAndIsDeletedFalse(assignedApplicationId);
|
||||||
ApplicationEvaluationEntity oldApplicationEvaluation = null;
|
ApplicationEvaluationEntity oldApplicationEvaluation = null;
|
||||||
VersionActionTypeEnum actionType = VersionActionTypeEnum.INSERT;
|
VersionActionTypeEnum actionType;
|
||||||
if (existingEntityOptional.isPresent()) {
|
if (existingEntityOptional.isPresent()) {
|
||||||
entity = existingEntityOptional.get();
|
entity = existingEntityOptional.get();
|
||||||
oldApplicationEvaluation = Utils.getClonedEntityForData(entity);
|
oldApplicationEvaluation = Utils.getClonedEntityForData(entity);
|
||||||
@@ -599,8 +614,15 @@ public class ApplicationEvaluationDao {
|
|||||||
setIfUpdated(entity::getMotivation, entity::setMotivation, req.getMotivation());
|
setIfUpdated(entity::getMotivation, entity::setMotivation, req.getMotivation());
|
||||||
actionType = VersionActionTypeEnum.UPDATE;
|
actionType = VersionActionTypeEnum.UPDATE;
|
||||||
} else {
|
} else {
|
||||||
|
AssignedApplicationsEntity assignedApplicationsEntity = assignedApplicationsService.validateAssignedApplication(assignedApplicationId);
|
||||||
|
ApplicationEntity application = applicationService.validateApplication(assignedApplicationsEntity.getApplication().getId());
|
||||||
entity = convertToEntity(user, req, assignedApplicationId);
|
entity = convertToEntity(user, req, assignedApplicationId);
|
||||||
actionType = VersionActionTypeEnum.INSERT;
|
actionType = VersionActionTypeEnum.INSERT;
|
||||||
|
|
||||||
|
Map<String, String> placeHolders = notificationDao.sendNotificationToBeneficiary(application, NotificationTypeEnum.EVALUATION_CREATION);
|
||||||
|
notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.EVALUATION_CREATION);
|
||||||
|
notificationDao.sendNotificationToInstructor(placeHolders,entity,NotificationTypeEnum.EVALUATION_CREATION);
|
||||||
|
|
||||||
}
|
}
|
||||||
ApplicationStatusForEvaluation status = req.getApplicationStatus();
|
ApplicationStatusForEvaluation status = req.getApplicationStatus();
|
||||||
// Fetch all amendment request entities associated with the evaluation ID
|
// Fetch all amendment request entities associated with the evaluation ID
|
||||||
@@ -1804,6 +1826,11 @@ public class ApplicationEvaluationDao {
|
|||||||
if (Boolean.TRUE.equals(statusType.equals((ApplicationStatusTypeEnum.REJECTED.getValue())))) {
|
if (Boolean.TRUE.equals(statusType.equals((ApplicationStatusTypeEnum.REJECTED.getValue())))) {
|
||||||
emailNotificationDao.sendInadmissibilityEmailForRejectedApplication(application,existingEntity);
|
emailNotificationDao.sendInadmissibilityEmailForRejectedApplication(application,existingEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, String> placeHolders = notificationDao.sendNotificationToBeneficiary(application, NotificationTypeEnum.EVALUATION_RESULT);
|
||||||
|
notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.EVALUATION_RESULT);
|
||||||
|
notificationDao.sendNotificationToInstructor(placeHolders,existingEntity,NotificationTypeEnum.EVALUATION_RESULT);
|
||||||
|
|
||||||
return convertToResponse(entity);
|
return convertToResponse(entity);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -16,14 +16,18 @@ import net.gepafin.tendermanagement.entities.ApplicationEntity;
|
|||||||
import net.gepafin.tendermanagement.entities.CompanyEntity;
|
import net.gepafin.tendermanagement.entities.CompanyEntity;
|
||||||
import net.gepafin.tendermanagement.entities.DocumentEntity;
|
import net.gepafin.tendermanagement.entities.DocumentEntity;
|
||||||
import net.gepafin.tendermanagement.entities.HubEntity;
|
import net.gepafin.tendermanagement.entities.HubEntity;
|
||||||
|
import net.gepafin.tendermanagement.entities.UserEntity;
|
||||||
import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum;
|
import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum;
|
||||||
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.NotificationTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.RoleStatusEnum;
|
||||||
import net.gepafin.tendermanagement.enums.VersionActionTypeEnum;
|
import net.gepafin.tendermanagement.enums.VersionActionTypeEnum;
|
||||||
import net.gepafin.tendermanagement.model.request.AppointmentCreationRequest;
|
import net.gepafin.tendermanagement.model.request.AppointmentCreationRequest;
|
||||||
import net.gepafin.tendermanagement.model.request.AppointmentNdgRequest;
|
import net.gepafin.tendermanagement.model.request.AppointmentNdgRequest;
|
||||||
import net.gepafin.tendermanagement.model.request.AppointmentVisuraListRequest;
|
import net.gepafin.tendermanagement.model.request.AppointmentVisuraListRequest;
|
||||||
import net.gepafin.tendermanagement.model.request.AppointmentVisuraRequest;
|
import net.gepafin.tendermanagement.model.request.AppointmentVisuraRequest;
|
||||||
import net.gepafin.tendermanagement.model.request.CreateAppointmentRequest;
|
import net.gepafin.tendermanagement.model.request.CreateAppointmentRequest;
|
||||||
|
import net.gepafin.tendermanagement.model.request.NotificationReq;
|
||||||
import net.gepafin.tendermanagement.model.request.UploadDocToExternalSystemRequest;
|
import net.gepafin.tendermanagement.model.request.UploadDocToExternalSystemRequest;
|
||||||
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
|
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
|
||||||
import net.gepafin.tendermanagement.model.response.AppointmentCreationResponse;
|
import net.gepafin.tendermanagement.model.response.AppointmentCreationResponse;
|
||||||
@@ -34,6 +38,7 @@ import net.gepafin.tendermanagement.repositories.ApplicationRepository;
|
|||||||
import net.gepafin.tendermanagement.repositories.CompanyRepository;
|
import net.gepafin.tendermanagement.repositories.CompanyRepository;
|
||||||
import net.gepafin.tendermanagement.repositories.DocumentRepository;
|
import net.gepafin.tendermanagement.repositories.DocumentRepository;
|
||||||
import net.gepafin.tendermanagement.repositories.HubRepository;
|
import net.gepafin.tendermanagement.repositories.HubRepository;
|
||||||
|
import net.gepafin.tendermanagement.repositories.UserRepository;
|
||||||
import net.gepafin.tendermanagement.service.ApplicationService;
|
import net.gepafin.tendermanagement.service.ApplicationService;
|
||||||
import net.gepafin.tendermanagement.service.CompanyService;
|
import net.gepafin.tendermanagement.service.CompanyService;
|
||||||
import net.gepafin.tendermanagement.service.feignClient.AppointmentApiService;
|
import net.gepafin.tendermanagement.service.feignClient.AppointmentApiService;
|
||||||
@@ -58,6 +63,7 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -130,6 +136,12 @@ public class AppointmentDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TokenProvider tokenProvider;
|
private TokenProvider tokenProvider;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationDao notificationDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserRepository userRepository;
|
||||||
|
|
||||||
private final Map<Long, ExecutorService> executorMap = new ConcurrentHashMap<>();
|
private final Map<Long, ExecutorService> executorMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private final ConcurrentHashMap<Long, ExecutorService> threadForDocumentMap = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<Long, ExecutorService> threadForDocumentMap = new ConcurrentHashMap<>();
|
||||||
@@ -312,6 +324,8 @@ public class AppointmentDao {
|
|||||||
company.setNdg(ndg);
|
company.setNdg(ndg);
|
||||||
companyRepository.save(company);
|
companyRepository.save(company);
|
||||||
applicationRepository.save(application);
|
applicationRepository.save(application);
|
||||||
|
Map<String ,String> placeHolders=notificationDao.sendNotificationToBeneficiary(application,NotificationTypeEnum.NDG_GENERATION);
|
||||||
|
notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.NDG_GENERATION);
|
||||||
|
|
||||||
// /** This code is responsible for adding a version history log for the "update application ndg code, status, and Id visura" operation. **/
|
// /** This code is responsible for adding a version history log for the "update application ndg code, status, and Id visura" operation. **/
|
||||||
// loggingUtil.addVersionHistory(
|
// loggingUtil.addVersionHistory(
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ import java.util.zip.ZipOutputStream;
|
|||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import net.gepafin.tendermanagement.entities.*;
|
import net.gepafin.tendermanagement.entities.*;
|
||||||
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.NotificationTypeEnum;
|
||||||
import net.gepafin.tendermanagement.enums.VersionActionTypeEnum;
|
import net.gepafin.tendermanagement.enums.VersionActionTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.model.request.NotificationReq;
|
||||||
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
|
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
|
||||||
import net.gepafin.tendermanagement.model.response.*;
|
import net.gepafin.tendermanagement.model.response.*;
|
||||||
import net.gepafin.tendermanagement.repositories.*;
|
import net.gepafin.tendermanagement.repositories.*;
|
||||||
@@ -49,6 +51,7 @@ import net.gepafin.tendermanagement.web.rest.api.errors.Status;
|
|||||||
|
|
||||||
import static net.gepafin.tendermanagement.enums.RoleStatusEnum.ROLE_SUPER_ADMIN;
|
import static net.gepafin.tendermanagement.enums.RoleStatusEnum.ROLE_SUPER_ADMIN;
|
||||||
import static net.gepafin.tendermanagement.util.Utils.setIfUpdated;
|
import static net.gepafin.tendermanagement.util.Utils.setIfUpdated;
|
||||||
|
import static org.hibernate.internal.util.collections.CollectionHelper.listOf;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class CallDao {
|
public class CallDao {
|
||||||
@@ -108,6 +111,15 @@ public class CallDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private HttpServletRequest request;
|
private HttpServletRequest request;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationDao notificationDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BeneficiaryRepository beneficiaryRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationTypeRepository notificationTypeRepository;
|
||||||
|
|
||||||
public CallResponse createCallStep1(CreateCallRequestStep1 createCallRequest, UserEntity userEntity) {
|
public CallResponse createCallStep1(CreateCallRequestStep1 createCallRequest, UserEntity userEntity) {
|
||||||
createCallRequest.setRegionId(userEntity.getRoleEntity().getRegion().getId());
|
createCallRequest.setRegionId(userEntity.getRoleEntity().getRegion().getId());
|
||||||
CallEntity callEntity = convertToCallEntity(createCallRequest, userEntity);
|
CallEntity callEntity = convertToCallEntity(createCallRequest, userEntity);
|
||||||
@@ -829,6 +841,16 @@ public class CallDao {
|
|||||||
callEntity.setStatus(statusReq.getValue());
|
callEntity.setStatus(statusReq.getValue());
|
||||||
callEntity = callRepository.save(callEntity);
|
callEntity = callRepository.save(callEntity);
|
||||||
|
|
||||||
|
//Creating notification.
|
||||||
|
List<Long> userIds = beneficiaryRepository.findUserIdsByHubIdAndBeneficiaryId(callEntity.getHub().getId());
|
||||||
|
Map<String, String> placeholders = new HashMap<>();
|
||||||
|
placeholders.put("{{call_name}}", callEntity.getName());
|
||||||
|
userIds.forEach(userId -> {
|
||||||
|
List<Long> companyIds = notificationDao.getAllCompanyIdsForUser(userId);
|
||||||
|
NotificationReq notificationReq = notificationDao.createNotificationReq(NotificationTypeEnum.CALL_CREATED.getValue(), placeholders, userId, null, companyIds);
|
||||||
|
notificationDao.sendNotification(notificationReq);
|
||||||
|
});
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for the "update call status" operation **/
|
/** This code is responsible for adding a version history log for the "update call status" operation **/
|
||||||
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldCallEntity).newData(callEntity).build());
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldCallEntity).newData(callEntity).build());
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package net.gepafin.tendermanagement.dao;
|
|||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import net.gepafin.tendermanagement.entities.*;
|
import net.gepafin.tendermanagement.entities.*;
|
||||||
@@ -66,7 +67,7 @@ public class CompanyDao {
|
|||||||
if (existingCompany != null) {
|
if (existingCompany != null) {
|
||||||
UserWithCompanyEntity existingRelation = userWithCompanyRepository.findByUserIdAndCompanyIdAndIsDeletedFalse(userEntity.getId(), existingCompany.getId()).orElse(null);
|
UserWithCompanyEntity existingRelation = userWithCompanyRepository.findByUserIdAndCompanyIdAndIsDeletedFalse(userEntity.getId(), existingCompany.getId()).orElse(null);
|
||||||
if (existingRelation == null) {
|
if (existingRelation == null) {
|
||||||
userWithCompanyEntity = createUserWithCompanyRelation(userEntity, existingCompany, companyRequest.getIsLegalRepresentant());
|
userWithCompanyEntity = createUserWithCompanyRelation(userEntity, existingCompany, companyRequest.getIsLegalRepresentant(),companyRequest);
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for "adding user with company" operation. **/
|
/** This code is responsible for adding a version history log for "adding user with company" operation. **/
|
||||||
loggingUtil.addVersionHistory(
|
loggingUtil.addVersionHistory(
|
||||||
@@ -83,7 +84,7 @@ public class CompanyDao {
|
|||||||
/** This code is responsible for adding a version history log for "creating company" operation. **/
|
/** This code is responsible for adding a version history log for "creating company" operation. **/
|
||||||
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.INSERT).oldData(null).newData(companyData).build());
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.INSERT).oldData(null).newData(companyData).build());
|
||||||
|
|
||||||
userWithCompanyEntity = createUserWithCompanyRelation(userEntity, companyEntity, companyRequest.getIsLegalRepresentant());
|
userWithCompanyEntity = createUserWithCompanyRelation(userEntity, companyEntity, companyRequest.getIsLegalRepresentant(),companyRequest);
|
||||||
|
|
||||||
return convertCompanyEntityToCompanyResponse(companyEntity, userWithCompanyEntity);
|
return convertCompanyEntityToCompanyResponse(companyEntity, userWithCompanyEntity);
|
||||||
}
|
}
|
||||||
@@ -107,7 +108,7 @@ public class CompanyDao {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private UserWithCompanyEntity createUserWithCompanyRelation(UserEntity userEntity, CompanyEntity companyEntity, Boolean isLegalRepresentant) {
|
private UserWithCompanyEntity createUserWithCompanyRelation(UserEntity userEntity, CompanyEntity companyEntity, Boolean isLegalRepresentant,CompanyRequest companyRequest) {
|
||||||
|
|
||||||
UserWithCompanyEntity userWithCompanyEntity = new UserWithCompanyEntity();
|
UserWithCompanyEntity userWithCompanyEntity = new UserWithCompanyEntity();
|
||||||
if (userEntity.getBeneficiary() != null) {
|
if (userEntity.getBeneficiary() != null) {
|
||||||
@@ -117,6 +118,11 @@ public class CompanyDao {
|
|||||||
userWithCompanyEntity.setCompanyId(companyEntity.getId());
|
userWithCompanyEntity.setCompanyId(companyEntity.getId());
|
||||||
userWithCompanyEntity.setUserId(userEntity.getId());
|
userWithCompanyEntity.setUserId(userEntity.getId());
|
||||||
userWithCompanyEntity.setIsLegalRepresentant(isLegalRepresentant);
|
userWithCompanyEntity.setIsLegalRepresentant(isLegalRepresentant);
|
||||||
|
userWithCompanyEntity.setEmail(companyRequest.getEmail());
|
||||||
|
userWithCompanyEntity.setPec(companyRequest.getPec());
|
||||||
|
userWithCompanyEntity.setContactName(companyRequest.getContactName());
|
||||||
|
userWithCompanyEntity.setContactEmail(companyRequest.getContactEmail());
|
||||||
|
userWithCompanyEntity.setJson(Utils.convertMapIntoJsonString(companyRequest.getVatCheckResponse()) );
|
||||||
UserWithCompanyEntity userWithCompany = userWithCompanyRepository.save(userWithCompanyEntity);
|
UserWithCompanyEntity userWithCompany = userWithCompanyRepository.save(userWithCompanyEntity);
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for the "adding user with company" operation. **/
|
/** This code is responsible for adding a version history log for the "adding user with company" operation. **/
|
||||||
@@ -135,12 +141,8 @@ public class CompanyDao {
|
|||||||
entity.setProvince(request.getProvince());
|
entity.setProvince(request.getProvince());
|
||||||
entity.setCap(request.getCap());
|
entity.setCap(request.getCap());
|
||||||
entity.setCountry(request.getCountry());
|
entity.setCountry(request.getCountry());
|
||||||
entity.setPec(request.getPec());
|
|
||||||
entity.setEmail(request.getEmail());
|
|
||||||
entity.setNumberOfEmployees(request.getNumberOfEmployees());
|
entity.setNumberOfEmployees(request.getNumberOfEmployees());
|
||||||
entity.setAnnualRevenue(request.getAnnualRevenue());
|
entity.setAnnualRevenue(request.getAnnualRevenue());
|
||||||
entity.setContactName(request.getContactName());
|
|
||||||
entity.setContactEmail(request.getContactEmail());
|
|
||||||
entity.setHub(userEntity.getHub());
|
entity.setHub(userEntity.getHub());
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
@@ -157,8 +159,8 @@ public class CompanyDao {
|
|||||||
response.setProvince(entity.getProvince());
|
response.setProvince(entity.getProvince());
|
||||||
response.setCap(entity.getCap());
|
response.setCap(entity.getCap());
|
||||||
response.setCountry(entity.getCountry());
|
response.setCountry(entity.getCountry());
|
||||||
response.setPec(entity.getPec());
|
response.setPec(userWithCompanyEntity.getPec());
|
||||||
response.setEmail(entity.getEmail());
|
response.setEmail(userWithCompanyEntity.getEmail());
|
||||||
response.setNumberOfEmployees(entity.getNumberOfEmployees());
|
response.setNumberOfEmployees(entity.getNumberOfEmployees());
|
||||||
response.setAnnualRevenue(entity.getAnnualRevenue());
|
response.setAnnualRevenue(entity.getAnnualRevenue());
|
||||||
if(userWithCompanyEntity!=null) {
|
if(userWithCompanyEntity!=null) {
|
||||||
@@ -166,8 +168,8 @@ public class CompanyDao {
|
|||||||
}
|
}
|
||||||
response.setCreatedDate(entity.getCreatedDate());
|
response.setCreatedDate(entity.getCreatedDate());
|
||||||
response.setUpdatedDate(entity.getUpdatedDate());
|
response.setUpdatedDate(entity.getUpdatedDate());
|
||||||
response.setContactName(entity.getContactName());
|
response.setContactName(userWithCompanyEntity.getContactName());
|
||||||
response.setContactEmail(entity.getContactEmail());
|
response.setContactEmail(userWithCompanyEntity.getContactEmail());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +180,6 @@ public class CompanyDao {
|
|||||||
CompanyEntity oldCompanyData = Utils.getClonedEntityForData(companyEntity);
|
CompanyEntity oldCompanyData = Utils.getClonedEntityForData(companyEntity);
|
||||||
|
|
||||||
setIfUpdated(companyEntity::getCompanyName, companyEntity::setCompanyName, companyRequest.getCompanyName());
|
setIfUpdated(companyEntity::getCompanyName, companyEntity::setCompanyName, companyRequest.getCompanyName());
|
||||||
setIfUpdated(companyEntity::getVatNumber, companyEntity::setVatNumber, companyRequest.getVatNumber());
|
|
||||||
setIfUpdated(companyEntity::getCodiceFiscale, companyEntity::setCodiceFiscale, companyRequest.getCodiceFiscale());
|
setIfUpdated(companyEntity::getCodiceFiscale, companyEntity::setCodiceFiscale, companyRequest.getCodiceFiscale());
|
||||||
setIfUpdated(companyEntity::getAddress, companyEntity::setAddress, companyRequest.getAddress());
|
setIfUpdated(companyEntity::getAddress, companyEntity::setAddress, companyRequest.getAddress());
|
||||||
setIfUpdated(companyEntity::getPhoneNumber, companyEntity::setPhoneNumber, companyRequest.getPhoneNumber());
|
setIfUpdated(companyEntity::getPhoneNumber, companyEntity::setPhoneNumber, companyRequest.getPhoneNumber());
|
||||||
@@ -186,12 +187,17 @@ public class CompanyDao {
|
|||||||
setIfUpdated(companyEntity::getProvince, companyEntity::setProvince, companyRequest.getProvince());
|
setIfUpdated(companyEntity::getProvince, companyEntity::setProvince, companyRequest.getProvince());
|
||||||
setIfUpdated(companyEntity::getCap, companyEntity::setCap, companyRequest.getCap());
|
setIfUpdated(companyEntity::getCap, companyEntity::setCap, companyRequest.getCap());
|
||||||
setIfUpdated(companyEntity::getCountry, companyEntity::setCountry, companyRequest.getCountry());
|
setIfUpdated(companyEntity::getCountry, companyEntity::setCountry, companyRequest.getCountry());
|
||||||
setIfUpdated(companyEntity::getPec, companyEntity::setPec, companyRequest.getPec());
|
|
||||||
setIfUpdated(companyEntity::getEmail, companyEntity::setEmail, companyRequest.getEmail());
|
|
||||||
setIfUpdated(companyEntity::getNumberOfEmployees, companyEntity::setNumberOfEmployees, companyRequest.getNumberOfEmployees());
|
setIfUpdated(companyEntity::getNumberOfEmployees, companyEntity::setNumberOfEmployees, companyRequest.getNumberOfEmployees());
|
||||||
setIfUpdated(companyEntity::getAnnualRevenue, companyEntity::setAnnualRevenue, companyRequest.getAnnualRevenue());
|
setIfUpdated(companyEntity::getAnnualRevenue, companyEntity::setAnnualRevenue, companyRequest.getAnnualRevenue());
|
||||||
setIfUpdated(companyEntity::getContactName, companyEntity::setContactName, companyRequest.getContactName());
|
//
|
||||||
setIfUpdated(companyEntity::getContactEmail, companyEntity::setContactEmail, companyRequest.getContactEmail());
|
// if(StringUtils.isNotBlank(companyRequest.getVatNumber())) {
|
||||||
|
// CompanyEntity existingCompany = companyRepository.findByVatNumberAndHubId(companyRequest.getVatNumber(), userEntity.getHub().getId());
|
||||||
|
// if(existingCompany!=null){
|
||||||
|
// throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.VATNUMBER_ALREADY_EXISTS));
|
||||||
|
// }
|
||||||
|
// companyEntity.setVatNumber(companyRequest.getVatNumber());
|
||||||
|
//
|
||||||
|
// }
|
||||||
companyRepository.save(companyEntity);
|
companyRepository.save(companyEntity);
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for the "Update company" operation. **/
|
/** This code is responsible for adding a version history log for the "Update company" operation. **/
|
||||||
@@ -201,8 +207,15 @@ public class CompanyDao {
|
|||||||
UserWithCompanyEntity userWithCompanyEntity = getUserWithCompany(userEntity.getId(), companyId);
|
UserWithCompanyEntity userWithCompanyEntity = getUserWithCompany(userEntity.getId(), companyId);
|
||||||
//cloned entity for old data
|
//cloned entity for old data
|
||||||
UserWithCompanyEntity oldUserWithCompanyData = Utils.getClonedEntityForData(userWithCompanyEntity);
|
UserWithCompanyEntity oldUserWithCompanyData = Utils.getClonedEntityForData(userWithCompanyEntity);
|
||||||
|
if(StringUtils.isNotBlank(companyRequest.getVatNumber())) {
|
||||||
Utils.setIfUpdated(userWithCompanyEntity::getIsLegalRepresentant, userWithCompanyEntity::setIsLegalRepresentant, companyRequest.getIsLegalRepresentant());
|
String responseJson = companyRequest.getVatCheckResponse() != null ? Utils.convertMapIntoJsonString(companyRequest.getVatCheckResponse()) : null;
|
||||||
|
setIfUpdated(userWithCompanyEntity::getJson, userWithCompanyEntity::setJson, responseJson);
|
||||||
|
}
|
||||||
|
setIfUpdated(userWithCompanyEntity::getPec, userWithCompanyEntity::setPec, userWithCompanyEntity.getPec());
|
||||||
|
setIfUpdated(userWithCompanyEntity::getEmail, userWithCompanyEntity::setEmail, userWithCompanyEntity.getEmail());
|
||||||
|
setIfUpdated(userWithCompanyEntity::getContactName, userWithCompanyEntity::setContactName, companyRequest.getContactName());
|
||||||
|
setIfUpdated(userWithCompanyEntity::getContactEmail, userWithCompanyEntity::setContactEmail, companyRequest.getContactEmail());
|
||||||
|
setIfUpdated(userWithCompanyEntity::getIsLegalRepresentant, userWithCompanyEntity::setIsLegalRepresentant, companyRequest.getIsLegalRepresentant());
|
||||||
userWithCompanyEntity = userWithCompanyRepository.save(userWithCompanyEntity);
|
userWithCompanyEntity = userWithCompanyRepository.save(userWithCompanyEntity);
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for the "Update company" operation. **/
|
/** This code is responsible for adding a version history log for the "Update company" operation. **/
|
||||||
@@ -277,36 +290,56 @@ public class CompanyDao {
|
|||||||
throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.CANNOT_DELETE_COMPANY_WITH_APPLICATION_SUBMITT));
|
throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.CANNOT_DELETE_COMPANY_WITH_APPLICATION_SUBMITT));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(ApplicationEntity application:userApplications){
|
userApplications = userApplications.stream()
|
||||||
|
.peek(application -> {
|
||||||
ApplicationEntity oldApplication = Utils.getClonedEntityForData(application);
|
ApplicationEntity oldApplication = Utils.getClonedEntityForData(application);
|
||||||
application.setIsDeleted(Boolean.TRUE);
|
application.setIsDeleted(Boolean.TRUE);
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for the "Soft delete application" operation. **/
|
|
||||||
loggingUtil.addVersionHistory(
|
|
||||||
VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.SOFT_DELETE).oldData(oldApplication).newData(application).build());
|
|
||||||
|
|
||||||
}
|
|
||||||
applicationRepository.saveAll(userApplications);
|
|
||||||
|
|
||||||
for(FaqEntity faq:faqs){
|
|
||||||
FaqEntity oldFaq = Utils.getClonedEntityForData(faq);
|
|
||||||
faq.setIsDeleted(Boolean.TRUE);
|
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for the "Soft delete Faq" operation. **/
|
/** This code is responsible for adding a version history log for the "Soft delete Faq" operation. **/
|
||||||
loggingUtil.addVersionHistory(
|
loggingUtil.addVersionHistory(
|
||||||
VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.SOFT_DELETE).oldData(oldFaq).newData(faq).build());
|
VersionHistoryRequest.builder()
|
||||||
}
|
.request(request)
|
||||||
|
.actionType(VersionActionTypeEnum.SOFT_DELETE)
|
||||||
|
.oldData(oldApplication)
|
||||||
|
.newData(application)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
|
applicationRepository.saveAll(userApplications);
|
||||||
|
|
||||||
|
faqs = faqs.stream()
|
||||||
|
.peek(faq -> {
|
||||||
|
FaqEntity oldFaq = Utils.getClonedEntityForData(faq);
|
||||||
|
faq.setIsDeleted(Boolean.TRUE);
|
||||||
|
/** This code is responsible for adding a version history log for the "Soft delete Faq" operation. **/
|
||||||
|
loggingUtil.addVersionHistory(
|
||||||
|
VersionHistoryRequest.builder()
|
||||||
|
.request(request)
|
||||||
|
.actionType(VersionActionTypeEnum.SOFT_DELETE)
|
||||||
|
.oldData(oldFaq)
|
||||||
|
.newData(faq)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
faqRepository.saveAll(faqs);
|
faqRepository.saveAll(faqs);
|
||||||
|
|
||||||
for(BeneficiaryPreferredCallEntity beneficiaryPreferredCall:preferredCallEntities){
|
preferredCallEntities = preferredCallEntities.stream()
|
||||||
|
.peek(beneficiaryPreferredCall -> {
|
||||||
BeneficiaryPreferredCallEntity oldPreferredCall = Utils.getClonedEntityForData(beneficiaryPreferredCall);
|
BeneficiaryPreferredCallEntity oldPreferredCall = Utils.getClonedEntityForData(beneficiaryPreferredCall);
|
||||||
beneficiaryPreferredCall.setIsDeleted(Boolean.TRUE);
|
beneficiaryPreferredCall.setIsDeleted(Boolean.TRUE);
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for the "Soft Delete BeneficiaryPreferredCall" operation. **/
|
/** This code is responsible for adding a version history log for the "Soft Delete BeneficiaryPreferredCall" operation. **/
|
||||||
loggingUtil.addVersionHistory(
|
loggingUtil.addVersionHistory(
|
||||||
VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.SOFT_DELETE).oldData(oldPreferredCall).newData(beneficiaryPreferredCall).build());
|
VersionHistoryRequest.builder()
|
||||||
|
.request(request)
|
||||||
}
|
.actionType(VersionActionTypeEnum.SOFT_DELETE)
|
||||||
|
.oldData(oldPreferredCall)
|
||||||
|
.newData(beneficiaryPreferredCall)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
beneficiaryPreferredCallRepository.saveAll(preferredCallEntities);
|
beneficiaryPreferredCallRepository.saveAll(preferredCallEntities);
|
||||||
|
|
||||||
if(userCompanyDelegationEntity!=null){
|
if(userCompanyDelegationEntity!=null){
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package net.gepafin.tendermanagement.dao;
|
package net.gepafin.tendermanagement.dao;
|
||||||
|
|
||||||
import net.gepafin.tendermanagement.entities.CompanyEntity;
|
import net.gepafin.tendermanagement.entities.*;
|
||||||
import net.gepafin.tendermanagement.entities.UserEntity;
|
|
||||||
import net.gepafin.tendermanagement.entities.UserWithCompanyEntity;
|
|
||||||
import net.gepafin.tendermanagement.enums.CallStatusEnum;
|
import net.gepafin.tendermanagement.enums.CallStatusEnum;
|
||||||
import net.gepafin.tendermanagement.enums.RoleStatusEnum;
|
import net.gepafin.tendermanagement.enums.RoleStatusEnum;
|
||||||
import net.gepafin.tendermanagement.enums.UserStatusEnum;
|
import net.gepafin.tendermanagement.enums.UserStatusEnum;
|
||||||
@@ -20,6 +18,8 @@ import java.time.LocalDate;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class DashboardDao {
|
public class DashboardDao {
|
||||||
@@ -38,6 +38,9 @@ public class DashboardDao {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CompanyService companyService;
|
private CompanyService companyService;
|
||||||
|
@Autowired
|
||||||
|
private BeneficiaryPreferredCallRepository beneficiaryPreferredCallRepository;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ApplicationEvaluationRepository applicationEvaluationRepository;
|
private ApplicationEvaluationRepository applicationEvaluationRepository;
|
||||||
@@ -114,11 +117,23 @@ public class DashboardDao {
|
|||||||
CompanyEntity company) {
|
CompanyEntity company) {
|
||||||
BeneficiaryWidgetResponseBean beneficiaryWidgetResponseBean = BeneficiaryWidgetResponseBean.builder()
|
BeneficiaryWidgetResponseBean beneficiaryWidgetResponseBean = BeneficiaryWidgetResponseBean.builder()
|
||||||
.numberOfApplications(0L).numberOfCalls(0L).numberOfIntegratedDocuments(0L).build();
|
.numberOfApplications(0L).numberOfCalls(0L).numberOfIntegratedDocuments(0L).build();
|
||||||
Long activeCalls = callRepository.countByStatusAndHubId(CallStatusEnum.PUBLISH.getValue(), userEntity.getHub().getId());
|
|
||||||
if (activeCalls != null) {
|
|
||||||
beneficiaryWidgetResponseBean.setNumberOfCalls(activeCalls);
|
|
||||||
}
|
|
||||||
UserWithCompanyEntity userWithCompanyEntity = companyService.getUserWithCompany(userEntity.getId(), company.getId());
|
UserWithCompanyEntity userWithCompanyEntity = companyService.getUserWithCompany(userEntity.getId(), company.getId());
|
||||||
|
|
||||||
|
List<BeneficiaryPreferredCallEntity> preferredCalls = beneficiaryPreferredCallRepository
|
||||||
|
.findByUserIdAndUserWithCompanyIdAndIsDeletedFalse(userEntity.getId(), userWithCompanyEntity.getId());
|
||||||
|
|
||||||
|
if (preferredCalls != null && !preferredCalls.isEmpty()) {
|
||||||
|
List<Long> callIds = preferredCalls.stream()
|
||||||
|
.map(BeneficiaryPreferredCallEntity::getCallId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<CallEntity> callEntities = callRepository.findByIdIn(callIds);
|
||||||
|
long activeCallsCount = callEntities.stream()
|
||||||
|
.filter(call -> CallStatusEnum.PUBLISH.getValue().equals(call.getStatus())
|
||||||
|
&& userEntity.getHub().getId().equals(call.getHub().getId()))
|
||||||
|
.count();
|
||||||
|
|
||||||
|
beneficiaryWidgetResponseBean.setNumberOfCalls(activeCallsCount);
|
||||||
|
}
|
||||||
Long activeApplication = applicationRepository.countSubmittedApplicationsByUserId(userEntity.getId(),
|
Long activeApplication = applicationRepository.countSubmittedApplicationsByUserId(userEntity.getId(),
|
||||||
userWithCompanyEntity.getId());
|
userWithCompanyEntity.getId());
|
||||||
if (activeApplication != null) {
|
if (activeApplication != null) {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import net.gepafin.tendermanagement.enums.RecipientTypeEnum;
|
|||||||
import net.gepafin.tendermanagement.model.request.EmailConfig;
|
import net.gepafin.tendermanagement.model.request.EmailConfig;
|
||||||
import net.gepafin.tendermanagement.model.request.EmailLogRequest;
|
import net.gepafin.tendermanagement.model.request.EmailLogRequest;
|
||||||
import net.gepafin.tendermanagement.model.response.AmendmentFormFieldResponse;
|
import net.gepafin.tendermanagement.model.response.AmendmentFormFieldResponse;
|
||||||
|
import net.gepafin.tendermanagement.model.response.EmailContentResponse;
|
||||||
import net.gepafin.tendermanagement.model.response.SystemEmailTemplateResponse;
|
import net.gepafin.tendermanagement.model.response.SystemEmailTemplateResponse;
|
||||||
import net.gepafin.tendermanagement.repositories.*;
|
import net.gepafin.tendermanagement.repositories.*;
|
||||||
import net.gepafin.tendermanagement.service.*;
|
import net.gepafin.tendermanagement.service.*;
|
||||||
@@ -61,9 +62,6 @@ public class EmailNotificationDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ApplicationFormRepository applicationFormRepository;
|
private ApplicationFormRepository applicationFormRepository;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ApplicationFormFieldRepository applicationFormFieldRepository;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ApplicationEvaluationRepository applicationEvaluationRepository;
|
private ApplicationEvaluationRepository applicationEvaluationRepository;
|
||||||
|
|
||||||
@@ -77,7 +75,19 @@ public class EmailNotificationDao {
|
|||||||
// String service = determineService(applicationEntity.getHubId());
|
// String service = determineService(applicationEntity.getHubId());
|
||||||
// String legalMail = service.equals("Gepafin S.p.a.") ? "bandi.gepafin@legalmail.it" : "bandi.sviluppumbria@legalmail.it";
|
// String legalMail = service.equals("Gepafin S.p.a.") ? "bandi.gepafin@legalmail.it" : "bandi.sviluppumbria@legalmail.it";
|
||||||
|
|
||||||
|
EmailContentResponse emailContent = prepareEmailContent(applicationEntity, templateType, hubEntity, bodyPlaceholders);
|
||||||
|
UserEntity userEntity = userService.validateUser(applicationEntity.getUserId());
|
||||||
|
sendEmails(applicationEntity, userEntity, additionalRecipients,amendmentId,emailContent.getSystemEmailTemplateResponse(),emailContent.getSubject(),emailContent.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
public EmailContentResponse prepareEmailContent(
|
||||||
|
ApplicationEntity applicationEntity,
|
||||||
|
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum templateType,
|
||||||
|
HubEntity hubEntity,
|
||||||
|
Map<String, String> bodyPlaceholders
|
||||||
|
) {
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(templateType, hubEntity, null);
|
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(templateType, hubEntity, null);
|
||||||
|
|
||||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||||
CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
|
CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
|
||||||
subjectPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
|
subjectPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
|
||||||
@@ -85,15 +95,18 @@ public class EmailNotificationDao {
|
|||||||
// 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 = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
|
String body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
|
||||||
UserEntity userEntity = userService.validateUser(applicationEntity.getUserId());
|
|
||||||
sendEmails(applicationEntity, userEntity, additionalRecipients,amendmentId,systemEmailTemplateResponse,subject,body);
|
return new EmailContentResponse(subject, body, systemEmailTemplateResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendEmails(ApplicationEntity applicationEntity, UserEntity userEntity, List<String> additionalRecipients,Long amendmentId,SystemEmailTemplateResponse systemEmailTemplateResponse,String subject,String body) {
|
private void sendEmails(ApplicationEntity applicationEntity, UserEntity userEntity, List<String> additionalRecipients,Long amendmentId,SystemEmailTemplateResponse systemEmailTemplateResponse,String subject,String body) {
|
||||||
|
|
||||||
Optional<ApplicationEvaluationEntity> applicationEvaluationEntity = applicationEvaluationRepository.findByApplicationIdAndIsDeletedFalse(applicationEntity.getId());
|
Optional<ApplicationEvaluationEntity> applicationEvaluationEntity = applicationEvaluationRepository.findByApplicationIdAndIsDeletedFalse(applicationEntity.getId());
|
||||||
CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
|
CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
|
||||||
String companyEmail = company.getEmail();
|
|
||||||
String contactEmail = company.getContactEmail();
|
UserWithCompanyEntity userWithCompany=companyService.getUserWithCompany(userEntity.getId(),company.getId());
|
||||||
|
String companyEmail = userWithCompany.getEmail();
|
||||||
|
String contactEmail = userWithCompany.getContactEmail();
|
||||||
|
|
||||||
if (companyEmail != null && !companyEmail.isEmpty()) {
|
if (companyEmail != null && !companyEmail.isEmpty()) {
|
||||||
EmailLogRequest emailLogRequest = emailLogDao.createEmailLogRequest(systemEmailTemplateResponse.getEmailScenario(), RecipientTypeEnum.COMPANY,company.getId() ,
|
EmailLogRequest emailLogRequest = emailLogDao.createEmailLogRequest(systemEmailTemplateResponse.getEmailScenario(), RecipientTypeEnum.COMPANY,company.getId() ,
|
||||||
@@ -150,6 +163,11 @@ public class EmailNotificationDao {
|
|||||||
public void sendMailToNotifyBeneficiaryRegardingNewAmendment(ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity) {
|
public void sendMailToNotifyBeneficiaryRegardingNewAmendment(ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity) {
|
||||||
|
|
||||||
ApplicationEntity applicationEntity = applicationService.validateApplication(applicationAmendmentRequestEntity.getApplicationId());
|
ApplicationEntity applicationEntity = applicationService.validateApplication(applicationAmendmentRequestEntity.getApplicationId());
|
||||||
|
Map<String, String> bodyPlaceholders = prepareEmailPlaceholders(applicationEntity, applicationAmendmentRequestEntity);
|
||||||
|
sendEmail(applicationEntity, SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.DOCUMENTATION_INTEGRATION_REQUEST, bodyPlaceholders, null,
|
||||||
|
applicationAmendmentRequestEntity.getId());
|
||||||
|
}
|
||||||
|
public Map<String, String> prepareEmailPlaceholders(ApplicationEntity applicationEntity, ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity){
|
||||||
Map<String, String> bodyPlaceholders = new HashMap<>();
|
Map<String, String> bodyPlaceholders = new HashMap<>();
|
||||||
bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
|
bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
|
||||||
bodyPlaceholders.put("{{protocol_number}}", applicationEntity.getProtocol().getProtocolNumber().toString());
|
bodyPlaceholders.put("{{protocol_number}}", applicationEntity.getProtocol().getProtocolNumber().toString());
|
||||||
@@ -185,8 +203,7 @@ public class EmailNotificationDao {
|
|||||||
|
|
||||||
|
|
||||||
bodyPlaceholders.put("{{note}}", applicationAmendmentRequestEntity.getNote());
|
bodyPlaceholders.put("{{note}}", applicationAmendmentRequestEntity.getNote());
|
||||||
sendEmail(applicationEntity, SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.DOCUMENTATION_INTEGRATION_REQUEST, bodyPlaceholders, null,
|
return bodyPlaceholders;
|
||||||
applicationAmendmentRequestEntity.getId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<AmendmentFormFieldResponse> getIdAndLabelFromResult(List<Map<String, Object>> result) {
|
public List<AmendmentFormFieldResponse> getIdAndLabelFromResult(List<Map<String, Object>> result) {
|
||||||
|
|||||||
@@ -0,0 +1,278 @@
|
|||||||
|
package net.gepafin.tendermanagement.dao;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.gepafin.tendermanagement.config.Translator;
|
||||||
|
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||||
|
import net.gepafin.tendermanagement.entities.ApplicationEntity;
|
||||||
|
import net.gepafin.tendermanagement.entities.ApplicationEvaluationEntity;
|
||||||
|
import net.gepafin.tendermanagement.entities.NotificationEntity;
|
||||||
|
import net.gepafin.tendermanagement.entities.NotificationTypeEntity;
|
||||||
|
import net.gepafin.tendermanagement.entities.UserEntity;
|
||||||
|
import net.gepafin.tendermanagement.entities.UserWithCompanyEntity;
|
||||||
|
import net.gepafin.tendermanagement.enums.NotificationEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.NotificationTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.RoleStatusEnum;
|
||||||
|
import net.gepafin.tendermanagement.model.request.NotificationReq;
|
||||||
|
import net.gepafin.tendermanagement.model.response.NotificationResponse;
|
||||||
|
import net.gepafin.tendermanagement.repositories.NotificationRepository;
|
||||||
|
import net.gepafin.tendermanagement.repositories.NotificationTypeRepository;
|
||||||
|
import net.gepafin.tendermanagement.repositories.UserRepository;
|
||||||
|
import net.gepafin.tendermanagement.repositories.UserWithCompanyRepository;
|
||||||
|
import net.gepafin.tendermanagement.service.ApplicationService;
|
||||||
|
import net.gepafin.tendermanagement.util.DateTimeUtil;
|
||||||
|
import net.gepafin.tendermanagement.util.Utils;
|
||||||
|
import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException;
|
||||||
|
import net.gepafin.tendermanagement.web.rest.api.errors.Status;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.messaging.simp.SimpMessagingTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static org.hibernate.internal.util.collections.CollectionHelper.listOf;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class NotificationDao {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SimpMessagingTemplate messagingTemplate;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationRepository notificationRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationTypeRepository notificationTypeRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserWithCompanyRepository userWithCompanyRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserRepository userRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CompanyDao companyDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ApplicationService applicationService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserDao userDao;
|
||||||
|
|
||||||
|
public NotificationResponse sendNotification(NotificationReq notificationReq) {
|
||||||
|
|
||||||
|
// Ensure userId is properly set in notificationReq if not already
|
||||||
|
Long userId = notificationReq.getUserId();
|
||||||
|
if (userId == null) {
|
||||||
|
log.error("User ID is missing in the notification request.");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
NotificationEntity notificationEntity = saveNotification(notificationReq);
|
||||||
|
log.info("Sending notification to user {} with content: {}", userId, notificationReq.getMessage());
|
||||||
|
List<Long> companyIds = notificationReq.getCompanyIds();
|
||||||
|
|
||||||
|
if (companyIds == null || companyIds.isEmpty()) {
|
||||||
|
sendToUser(userId, notificationEntity);
|
||||||
|
} else {
|
||||||
|
sendToCompanies(userId, companyIds, notificationEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertNotificationEntityToNotificationResponse(notificationEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private NotificationEntity saveNotification(NotificationReq notificationReq) {
|
||||||
|
|
||||||
|
return notificationRepository.save(convertNotificationRequestToNotificationEntity(notificationReq));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendToUser(Long userId, NotificationEntity notificationEntity) {
|
||||||
|
|
||||||
|
String userChannel = GepafinConstant.COMMON_SINGLE_CHANNEL_PREFIX + userId;
|
||||||
|
log.info("Channel for User {}", userChannel);
|
||||||
|
NotificationResponse notificationResponse = convertNotificationEntityToNotificationResponse(notificationEntity);
|
||||||
|
messagingTemplate.convertAndSend(userChannel, notificationResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendToCompanies(Long userId, List<Long> companyIds, NotificationEntity notificationEntity) {
|
||||||
|
// Send notification to each company provided in the companyIds list
|
||||||
|
companyIds.forEach(companyId -> {
|
||||||
|
UserWithCompanyEntity userWithCompany = userWithCompanyRepository.findByUserIdAndCompanyIdAndIsDeletedFalseForNotification(userId, companyId);
|
||||||
|
String companyChannel = Utils.createChannelForUserAndCompany(userId, companyId);
|
||||||
|
log.info("Channel for User and Company {}, {}", userId, companyChannel);
|
||||||
|
if (userWithCompany == null) {
|
||||||
|
throw new CustomValidationException(Status.BAD_REQUEST, GepafinConstant.USER_WITH_COMPANY_NOT_FOUND);
|
||||||
|
}
|
||||||
|
notificationEntity.setUserWithCompany(userWithCompany);
|
||||||
|
notificationRepository.save(notificationEntity);
|
||||||
|
NotificationResponse notificationResponse = convertNotificationEntityToNotificationResponse(notificationEntity);
|
||||||
|
messagingTemplate.convertAndSend(companyChannel, notificationResponse);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private NotificationResponse convertNotificationEntityToNotificationResponse(NotificationEntity notificationEntity) {
|
||||||
|
|
||||||
|
NotificationResponse notificationResponse = new NotificationResponse();
|
||||||
|
notificationResponse.setId(notificationEntity.getId());
|
||||||
|
notificationResponse.setUserId(notificationEntity.getUserId());
|
||||||
|
notificationResponse.setStatus(notificationEntity.getStatus());
|
||||||
|
notificationResponse.setMessage(notificationEntity.getMessage());
|
||||||
|
notificationResponse.setCreatedDate(notificationEntity.getCreatedDate());
|
||||||
|
notificationResponse.setUpdatedDate(notificationEntity.getUpdatedDate());
|
||||||
|
notificationResponse.setRedirectUrl(notificationEntity.getNotificationType());
|
||||||
|
notificationResponse.setCompanyId(notificationEntity.getUserWithCompany() != null ? notificationEntity.getUserWithCompany().getCompanyId() : null);
|
||||||
|
notificationResponse.setNotificationType(notificationEntity.getNotificationType());
|
||||||
|
notificationResponse.setTitle(notificationEntity.getTitle());
|
||||||
|
return notificationResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
private NotificationEntity convertNotificationRequestToNotificationEntity(NotificationReq notificationReq) {
|
||||||
|
|
||||||
|
NotificationEntity notificationEntity = new NotificationEntity();
|
||||||
|
String message = notificationReq.getMessage();
|
||||||
|
notificationEntity.setNotificationType(notificationReq.getNotificationType());
|
||||||
|
notificationEntity.setUserId(notificationReq.getUserId());
|
||||||
|
notificationEntity.setStatus(NotificationEnum.UNREAD.getValue());
|
||||||
|
notificationEntity.setIsDeleted(Boolean.FALSE);
|
||||||
|
notificationEntity.setUserWithCompany(notificationReq.getUserWithCompanyEntity() != null ? notificationReq.getUserWithCompanyEntity() : null);
|
||||||
|
notificationEntity.setMessage(message);
|
||||||
|
notificationEntity.setTitle(notificationReq.getTitle());
|
||||||
|
return notificationEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NotificationReq createNotificationReq(String notificationType, Map<String, String> placeholders, Long userId, UserWithCompanyEntity userWithCompanyEntity,
|
||||||
|
List<Long> companyIds) {
|
||||||
|
// Create NotificationReq object
|
||||||
|
NotificationReq notificationReq = new NotificationReq();
|
||||||
|
NotificationTypeEntity notificationTypeEntity = notificationTypeRepository.findByNotificationNameAndIsDeletedFalse(notificationType);
|
||||||
|
notificationReq.setNotificationType(notificationType);
|
||||||
|
String message = Utils.replacePlaceholders(notificationTypeEntity.getJsonTemplate(), placeholders);
|
||||||
|
notificationReq.setMessage(message);
|
||||||
|
notificationReq.setUserId(userId);
|
||||||
|
notificationReq.setCompanyIds(companyIds);
|
||||||
|
String title = Utils.replacePlaceholders(notificationTypeEntity.getTitle(), placeholders);
|
||||||
|
notificationReq.setTitle(title);
|
||||||
|
notificationReq.setUserWithCompanyEntity(userWithCompanyEntity);
|
||||||
|
return notificationReq;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> sendNotificationToBeneficiary(ApplicationEntity application, NotificationTypeEnum notificationTypeEnum) {
|
||||||
|
|
||||||
|
Map<String, String> placeHolders = new HashMap<>();
|
||||||
|
placeHolders.put("{{call_name}}", application.getCall().getName());
|
||||||
|
placeHolders.put("{{protocol_number}}", String.valueOf(application.getProtocol().getProtocolNumber()));
|
||||||
|
NotificationReq notificationReq = createNotificationReq(notificationTypeEnum.getValue(), placeHolders, application.getUserId(), application.getUserWithCompany(),
|
||||||
|
listOf(application.getCompanyId()));
|
||||||
|
sendNotification(notificationReq);
|
||||||
|
return placeHolders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendNotificationToInstructor(Map<String, String> placeHolders, ApplicationEvaluationEntity applicationEvaluationEntity, NotificationTypeEnum notificationTypeEnum) {
|
||||||
|
|
||||||
|
Long instructorId = applicationEvaluationEntity.getUserId();
|
||||||
|
ApplicationEntity application = applicationService.validateApplication(applicationEvaluationEntity.getApplicationId());
|
||||||
|
if (instructorId != null) {
|
||||||
|
NotificationReq notificationreq = createNotificationReq(notificationTypeEnum.getValue(), placeHolders, instructorId, application.getUserWithCompany(),
|
||||||
|
null);
|
||||||
|
sendNotification(notificationreq);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void sendNotificationToSuperUser(ApplicationEntity application, Map<String, String> placeHolders, NotificationTypeEnum notificationTypeEnum) {
|
||||||
|
|
||||||
|
List<UserEntity> user = userRepository.findByRoleEntity_RoleTypeAndHubId(RoleStatusEnum.ROLE_SUPER_ADMIN.getValue(), application.getHubId());
|
||||||
|
UserEntity userEntity1 = user.get(0);
|
||||||
|
if (userEntity1 != null) {
|
||||||
|
NotificationReq notificationreq = createNotificationReq(notificationTypeEnum.getValue(), placeHolders, userEntity1.getId(), application.getUserWithCompany(),
|
||||||
|
null);
|
||||||
|
sendNotification(notificationreq);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Long> getAllCompanyIdsForUser(Long userId) {
|
||||||
|
|
||||||
|
return userWithCompanyRepository.findActiveCompanyIdsByUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NotificationResponse getNotificationById(Long id) {
|
||||||
|
|
||||||
|
NotificationEntity notificationEntity = validateNotificationEntity(id);
|
||||||
|
return convertNotificationEntityToNotificationResponse(notificationEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private NotificationEntity validateNotificationEntity(Long id) {
|
||||||
|
|
||||||
|
NotificationEntity notificationEntity = notificationRepository.findByIdAndIsDeletedFalse(id);
|
||||||
|
if (notificationEntity == null) {
|
||||||
|
throw new CustomValidationException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.NOTIFICATION_NOT_FOUND));
|
||||||
|
}
|
||||||
|
return notificationEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NotificationResponse> getNotificationByUserId(Long userId, Long companyId, List<NotificationEnum> statuses) {
|
||||||
|
|
||||||
|
List<NotificationEntity> notificationEntities = notificationRepository.findByUserIdAndIsDeletedFalse(userId);
|
||||||
|
UserWithCompanyEntity userWithCompany = null;
|
||||||
|
List<String> statusStrings = new ArrayList<>();
|
||||||
|
if (companyId != null) {
|
||||||
|
userWithCompany = companyDao.validateUserWithCompny(userId, companyId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (statuses != null) {
|
||||||
|
statusStrings = statuses.stream().map(NotificationEnum::name) // Convert enum to its name as String
|
||||||
|
.toList();
|
||||||
|
notificationEntities = notificationRepository.findByUserIdAndIsDeletedFalseAndStatusIn(userId, statusStrings);
|
||||||
|
|
||||||
|
if (userWithCompany != null) {
|
||||||
|
notificationEntities = notificationRepository.findByUserIdAndUserWithCompanyIdAndIsDeletedFalseAndStatusIn(userId, userWithCompany.getId(), statusStrings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return notificationEntities.stream().map(this::convertNotificationEntityToNotificationResponse).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public NotificationResponse updateNotificationStatus(Long id, NotificationEnum status) {
|
||||||
|
|
||||||
|
NotificationEntity notificationEntity = validateNotificationEntity(id);
|
||||||
|
if (notificationEntity.getStatus().equals(status.getValue())) {
|
||||||
|
throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.NOTIFICATION_ALREADY_IN_THAT_STATE));
|
||||||
|
}
|
||||||
|
notificationEntity.setStatus(status.getValue());
|
||||||
|
notificationEntity.setUpdatedDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));
|
||||||
|
notificationRepository.save(notificationEntity);
|
||||||
|
return convertNotificationEntityToNotificationResponse(notificationEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteNotification(Long id) {
|
||||||
|
|
||||||
|
NotificationEntity notificationEntity = validateNotificationEntity(id);
|
||||||
|
notificationEntity.setIsDeleted(true);
|
||||||
|
notificationRepository.save(notificationEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NotificationResponse> getNotificationByCompanyIdAndUserId(Long userId, Long companyId, List<NotificationEnum> statuses) {
|
||||||
|
|
||||||
|
List<NotificationEntity> notificationEntities = notificationRepository.findByUserIdAndIsDeletedFalse(userId);
|
||||||
|
UserWithCompanyEntity userWithCompany = null;
|
||||||
|
List<String> statusStrings;
|
||||||
|
if (companyId != null) {
|
||||||
|
userWithCompany = companyDao.validateUserWithCompny(userId, companyId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (statuses != null) {
|
||||||
|
statusStrings = statuses.stream().map(NotificationEnum::name)
|
||||||
|
.toList();
|
||||||
|
notificationEntities = notificationRepository.findByUserIdAndIsDeletedFalseAndStatusIn(userId, statusStrings);
|
||||||
|
|
||||||
|
if (userWithCompany != null) {
|
||||||
|
notificationEntities = notificationRepository.findByUserIdAndUserWithCompanyIdAndIsDeletedFalseAndStatusIn(userId, userWithCompany.getId(), statusStrings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return notificationEntities.stream().map(this::convertNotificationEntityToNotificationResponse).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,21 +6,15 @@ import net.gepafin.tendermanagement.config.SamlSuccessHandler;
|
|||||||
import net.gepafin.tendermanagement.config.Translator;
|
import net.gepafin.tendermanagement.config.Translator;
|
||||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||||
import net.gepafin.tendermanagement.entities.*;
|
import net.gepafin.tendermanagement.entities.*;
|
||||||
import net.gepafin.tendermanagement.enums.RoleStatusEnum;
|
import net.gepafin.tendermanagement.enums.*;
|
||||||
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
|
||||||
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
|
||||||
import net.gepafin.tendermanagement.enums.UserStatusEnum;
|
|
||||||
import net.gepafin.tendermanagement.enums.VersionActionTypeEnum;
|
|
||||||
import net.gepafin.tendermanagement.model.request.*;
|
import net.gepafin.tendermanagement.model.request.*;
|
||||||
import net.gepafin.tendermanagement.model.response.CompanyResponse;
|
import net.gepafin.tendermanagement.model.response.*;
|
||||||
import net.gepafin.tendermanagement.model.response.RoleResponseBean;
|
|
||||||
import net.gepafin.tendermanagement.model.response.UserSamlResponse;
|
|
||||||
import net.gepafin.tendermanagement.model.response.UserResponseBean;
|
|
||||||
import net.gepafin.tendermanagement.model.util.JWTToken;
|
import net.gepafin.tendermanagement.model.util.JWTToken;
|
||||||
import net.gepafin.tendermanagement.repositories.BeneficiaryRepository;
|
import net.gepafin.tendermanagement.repositories.BeneficiaryRepository;
|
||||||
import net.gepafin.tendermanagement.repositories.UserRepository;
|
import net.gepafin.tendermanagement.repositories.UserRepository;
|
||||||
import net.gepafin.tendermanagement.service.HubService;
|
import net.gepafin.tendermanagement.service.HubService;
|
||||||
import net.gepafin.tendermanagement.service.RoleService;
|
import net.gepafin.tendermanagement.service.RoleService;
|
||||||
|
import net.gepafin.tendermanagement.service.SystemEmailTemplatesService;
|
||||||
import net.gepafin.tendermanagement.service.impl.AuthenticationService;
|
import net.gepafin.tendermanagement.service.impl.AuthenticationService;
|
||||||
import net.gepafin.tendermanagement.util.LoggingUtil;
|
import net.gepafin.tendermanagement.util.LoggingUtil;
|
||||||
import net.gepafin.tendermanagement.util.Utils;
|
import net.gepafin.tendermanagement.util.Utils;
|
||||||
@@ -39,6 +33,7 @@ import org.springframework.stereotype.Component;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static net.gepafin.tendermanagement.util.Utils.setIfUpdated;
|
import static net.gepafin.tendermanagement.util.Utils.setIfUpdated;
|
||||||
@@ -90,6 +85,18 @@ public class UserDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private HttpServletRequest request;
|
private HttpServletRequest request;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SystemEmailTemplatesService systemEmailTemplatesService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmailLogDao emailLogDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmailNotificationDao emailNotificationDao;
|
||||||
|
|
||||||
|
@Value("${fe.base.url}")
|
||||||
|
private String feBaseUrl;
|
||||||
|
|
||||||
public JWTToken createUser(HttpServletRequest request, String tempToken, UserReq userReq) {
|
public JWTToken createUser(HttpServletRequest request, String tempToken, UserReq userReq) {
|
||||||
|
|
||||||
if (StringUtils.isEmpty(userReq.getHubUuid())) {
|
if (StringUtils.isEmpty(userReq.getHubUuid())) {
|
||||||
@@ -120,9 +127,35 @@ public class UserDao {
|
|||||||
/** This code is responsible for adding a version history log for the "Create user" operation. **/
|
/** This code is responsible for adding a version history log for the "Create user" operation. **/
|
||||||
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.INSERT).newData(userEntity).build());
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.INSERT).newData(userEntity).build());
|
||||||
|
|
||||||
|
if(beneficiary == null){
|
||||||
|
sendEmailToOnboardingUser(userEntity);
|
||||||
|
}
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
public void sendEmailToOnboardingUser(UserEntity userEntity){
|
||||||
|
SystemEmailTemplateResponse emailTemplate = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(
|
||||||
|
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.USER_ONBOARDING, userEntity.getHub(), null);
|
||||||
|
EmailLogRequest emailLogRequest = emailLogDao.createEmailLogRequest(emailTemplate.getEmailScenario(), RecipientTypeEnum.USER, userEntity.getId(), userEntity.getEmail(),
|
||||||
|
userEntity.getId(), null, null, null);
|
||||||
|
String firstName = userEntity.getFirstName() != null ? userEntity.getFirstName() : "";
|
||||||
|
String lastName = userEntity.getLastName() != null ? userEntity.getLastName() : "";
|
||||||
|
String userName = String.join(" ", firstName, lastName).trim();
|
||||||
|
String subject = Utils.replacePlaceholders(emailTemplate.getSubject(), Map.of(
|
||||||
|
"{{user_name}}", userName
|
||||||
|
));
|
||||||
|
String body = Utils.replacePlaceholders(emailTemplate.getHtmlContent(), Map.of(
|
||||||
|
"{{user_name}}", userName,
|
||||||
|
"{{user_email}}", userEntity.getEmail()
|
||||||
|
));
|
||||||
|
|
||||||
|
emailNotificationDao.sendMail(
|
||||||
|
userEntity.getHub().getId(),
|
||||||
|
subject,
|
||||||
|
body,
|
||||||
|
List.of(userEntity.getEmail()),
|
||||||
|
emailLogRequest
|
||||||
|
);
|
||||||
|
}
|
||||||
private BeneficiaryEntity createBeneficiary(RoleEntity roleEntity, UserReq userReq, HubEntity hub) {
|
private BeneficiaryEntity createBeneficiary(RoleEntity roleEntity, UserReq userReq, HubEntity hub) {
|
||||||
BeneficiaryEntity beneficiaryEntity = null;
|
BeneficiaryEntity beneficiaryEntity = null;
|
||||||
if (RoleStatusEnum.ROLE_BENEFICIARY.getValue().equals(roleEntity.getRoleType())) {
|
if (RoleStatusEnum.ROLE_BENEFICIARY.getValue().equals(roleEntity.getRoleType())) {
|
||||||
@@ -164,11 +197,9 @@ public class UserDao {
|
|||||||
Translator.toLocale(GepafinConstant.VALIDATE_EMAIL));
|
Translator.toLocale(GepafinConstant.VALIDATE_EMAIL));
|
||||||
}
|
}
|
||||||
log.info("Creating user with email: {}", userReq.getEmail());
|
log.info("Creating user with email: {}", userReq.getEmail());
|
||||||
if (userRepository.existsByEmailIgnoreCaseAndHubUniqueUuid(userReq.getEmail(), userReq.getHubUuid())) {
|
RoleEntity roleEntity = roleService.validateRole(userReq.getRoleId());
|
||||||
log.error("User creation failed: Email {} already exists", userReq.getEmail());
|
validateDuplicateEmail(userReq.getEmail(), userReq.getHubUuid(), roleEntity.getRoleType());
|
||||||
throw new CustomValidationException(Status.VALIDATION_ERROR,
|
|
||||||
Translator.toLocale(GepafinConstant.EMAIL_ALREADY_EXISTS));
|
|
||||||
}
|
|
||||||
if (Boolean.FALSE.equals(StringUtils.isEmpty(userReq.getCodiceFiscale()))
|
if (Boolean.FALSE.equals(StringUtils.isEmpty(userReq.getCodiceFiscale()))
|
||||||
&& userRepository.existsByBeneficiaryCodiceFiscaleAndHubId(userReq.getCodiceFiscale(), hub.getId())) {
|
&& userRepository.existsByBeneficiaryCodiceFiscaleAndHubId(userReq.getCodiceFiscale(), hub.getId())) {
|
||||||
log.error("User creation failed: CodiceFiscale {} already exists", userReq.getCodiceFiscale());
|
log.error("User creation failed: CodiceFiscale {} already exists", userReq.getCodiceFiscale());
|
||||||
@@ -192,6 +223,29 @@ public class UserDao {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void validateDuplicateEmail(String email, String hubUuid, String roleType) {
|
||||||
|
String beneficiaryRoleType = RoleStatusEnum.ROLE_BENEFICIARY.getValue();
|
||||||
|
|
||||||
|
if (beneficiaryRoleType.equals(roleType)) {
|
||||||
|
Boolean beneficiaryExistsInHub = userRepository.existsByEmailIgnoreCaseForBeneficiaries(
|
||||||
|
email, hubUuid, beneficiaryRoleType);
|
||||||
|
|
||||||
|
if (Boolean.TRUE.equals(beneficiaryExistsInHub)) {
|
||||||
|
throw new CustomValidationException(Status.VALIDATION_ERROR,
|
||||||
|
Translator.toLocale(GepafinConstant.EMAIL_ALREADY_EXISTS));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Boolean existsForNonBeneficiaries = userRepository.existsByEmailIgnoreCaseForNonBeneficiaries(
|
||||||
|
email, hubUuid, beneficiaryRoleType);
|
||||||
|
|
||||||
|
if (Boolean.TRUE.equals(existsForNonBeneficiaries)) {
|
||||||
|
throw new CustomValidationException(Status.VALIDATION_ERROR,
|
||||||
|
Translator.toLocale(GepafinConstant.EMAIL_ALREADY_EXISTS));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void validatePassword(String password, String confirmPassword, String tempToken) {
|
private void validatePassword(String password, String confirmPassword, String tempToken) {
|
||||||
if (StringUtils.isEmpty(password) || StringUtils.isEmpty(confirmPassword)) {
|
if (StringUtils.isEmpty(password) || StringUtils.isEmpty(confirmPassword)) {
|
||||||
if(tempToken == null) {
|
if(tempToken == null) {
|
||||||
@@ -219,7 +273,7 @@ public class UserDao {
|
|||||||
log.info("Current user details: {}", userEntity);
|
log.info("Current user details: {}", userEntity);
|
||||||
log.info("New user details: {}", userReq);
|
log.info("New user details: {}", userReq);
|
||||||
String newStatus = userReq.getStatus() != null ? userReq.getStatus().getValue() : null;
|
String newStatus = userReq.getStatus() != null ? userReq.getStatus().getValue() : null;
|
||||||
if (Boolean.FALSE.equals(userEntity.getStatus().equals(newStatus))) {
|
if (newStatus!=null && Boolean.FALSE.equals(userEntity.getStatus().equals(newStatus))) {
|
||||||
userEntity.setStatus(newStatus);
|
userEntity.setStatus(newStatus);
|
||||||
}
|
}
|
||||||
setIfUpdated(userEntity::getFirstName, userEntity::setFirstName, userReq.getFirstName());
|
setIfUpdated(userEntity::getFirstName, userEntity::setFirstName, userReq.getFirstName());
|
||||||
@@ -228,15 +282,19 @@ public class UserDao {
|
|||||||
setIfUpdated(userEntity::getAddress, userEntity::setAddress, userReq.getAddress());
|
setIfUpdated(userEntity::getAddress, userEntity::setAddress, userReq.getAddress());
|
||||||
setIfUpdated(userEntity::getPhoneNumber, userEntity::setPhoneNumber, userReq.getPhoneNumber());
|
setIfUpdated(userEntity::getPhoneNumber, userEntity::setPhoneNumber, userReq.getPhoneNumber());
|
||||||
setIfUpdated(userEntity::getDateOfBirth, userEntity::setDateOfBirth, userReq.getDateOfBirth());
|
setIfUpdated(userEntity::getDateOfBirth, userEntity::setDateOfBirth, userReq.getDateOfBirth());
|
||||||
|
if (userReq.getRoleId() != null) {
|
||||||
|
RoleEntity roleEntity = roleDao.validateRole(userReq.getRoleId());
|
||||||
|
if((userEntity.getRoleEntity().getRoleType().equals(RoleStatusEnum.ROLE_INSTRUCTOR_MANAGER.getValue()) && roleEntity.getRoleType().equals(RoleStatusEnum.ROLE_PRE_INSTRUCTOR.getValue())) || (userEntity.getRoleEntity().getRoleType().equals(RoleStatusEnum.ROLE_PRE_INSTRUCTOR.getValue()) && roleEntity.getRoleType().equals(RoleStatusEnum.ROLE_INSTRUCTOR_MANAGER.getValue()))) {
|
||||||
|
setIfUpdated(userEntity::getRoleEntity, userEntity::setRoleEntity, roleEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(userEntity.getBeneficiary()!=null) {
|
||||||
setIfUpdated(userEntity.getBeneficiary()::getCodiceFiscale, userEntity.getBeneficiary()::setCodiceFiscale, userReq.getCodiceFiscale());
|
setIfUpdated(userEntity.getBeneficiary()::getCodiceFiscale, userEntity.getBeneficiary()::setCodiceFiscale, userReq.getCodiceFiscale());
|
||||||
setIfUpdated(userEntity.getBeneficiary()::getMarketing, userEntity.getBeneficiary()::setMarketing, userReq.getMarketing());
|
setIfUpdated(userEntity.getBeneficiary()::getMarketing, userEntity.getBeneficiary()::setMarketing, userReq.getMarketing());
|
||||||
setIfUpdated(userEntity.getBeneficiary()::getOffers, userEntity.getBeneficiary()::setOffers, userReq.getOffers());
|
setIfUpdated(userEntity.getBeneficiary()::getOffers, userEntity.getBeneficiary()::setOffers, userReq.getOffers());
|
||||||
setIfUpdated(userEntity.getBeneficiary()::getThirdParty, userEntity.getBeneficiary()::setThirdParty, userReq.getThirdParty());
|
setIfUpdated(userEntity.getBeneficiary()::getThirdParty, userEntity.getBeneficiary()::setThirdParty, userReq.getThirdParty());
|
||||||
if (userReq.getRoleId() != null) {
|
|
||||||
RoleEntity roleEntity = roleDao.validateRole(userReq.getRoleId());
|
|
||||||
setIfUpdated(userEntity::getRoleEntity, userEntity::setRoleEntity, roleEntity);
|
|
||||||
}
|
|
||||||
setIfUpdated(userEntity.getBeneficiary()::getEmailPec, userEntity.getBeneficiary()::setEmailPec, userReq.getEmailPec());
|
setIfUpdated(userEntity.getBeneficiary()::getEmailPec, userEntity.getBeneficiary()::setEmailPec, userReq.getEmailPec());
|
||||||
|
}
|
||||||
userEntity = userRepository.save(userEntity);
|
userEntity = userRepository.save(userEntity);
|
||||||
|
|
||||||
/** This code is responsible for adding a version history log for the "Update user details" operation **/
|
/** This code is responsible for adding a version history log for the "Update user details" operation **/
|
||||||
@@ -362,25 +420,83 @@ public class UserDao {
|
|||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String initiatePasswordReset(InitiatePasswordResetReq resetReq) {
|
public void initiatePasswordReset(InitiatePasswordResetReq resetReq) {
|
||||||
UserEntity user = userRepository
|
UserEntity user = userRepository.findUserExcludingRoleType(
|
||||||
.findByEmailIgnoreCaseAndHubUniqueUuid(resetReq.getEmail(), resetReq.getHubUuid())
|
resetReq.getEmail(),
|
||||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
resetReq.getHubUuid(),
|
||||||
Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG)));
|
RoleStatusEnum.ROLE_BENEFICIARY.getValue()
|
||||||
|
).orElseThrow(() -> new ResourceNotFoundException(
|
||||||
|
Status.NOT_FOUND,
|
||||||
|
Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG)
|
||||||
|
));
|
||||||
|
|
||||||
|
UserEntity oldUserEntity = Utils.getClonedEntityForData(user);
|
||||||
String token = Utils.generateSecureToken();
|
String token = Utils.generateSecureToken();
|
||||||
user.setResetPasswordToken(token);
|
user.setResetPasswordToken(token);
|
||||||
userRepository.save(user);
|
userRepository.save(user);
|
||||||
|
|
||||||
|
/** This code is responsible for adding a version history log for the "Initiate password reset request" operation **/
|
||||||
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldUserEntity).newData(user).build());
|
||||||
|
|
||||||
log.info("Password reset token generated for user: {}", resetReq.getEmail());
|
log.info("Password reset token generated for user: {}", resetReq.getEmail());
|
||||||
return token;
|
|
||||||
|
sendResetPasswordTokenEmail(user, token);
|
||||||
|
}
|
||||||
|
public void sendResetPasswordTokenEmail(UserEntity user, String token) {
|
||||||
|
|
||||||
|
SystemEmailTemplateResponse emailTemplate = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(
|
||||||
|
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.PASSWORD_RESET, user.getHub(), null);
|
||||||
|
String redirectUrl = feBaseUrl;
|
||||||
|
if (Boolean.FALSE.equals(StringUtils.isEmpty(user.getHub().getDomainName()))) {
|
||||||
|
redirectUrl = user.getHub().getDomainName();
|
||||||
|
}
|
||||||
|
|
||||||
|
EmailLogRequest emailLogRequest = emailLogDao.createEmailLogRequest(
|
||||||
|
emailTemplate.getEmailScenario(),
|
||||||
|
RecipientTypeEnum.USER,
|
||||||
|
user.getId(),
|
||||||
|
user.getEmail(),
|
||||||
|
user.getId(),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null);
|
||||||
|
redirectUrl = String.format(
|
||||||
|
user.getHub().getDomainName() + GepafinConstant.RESET_PASSWORD_URL_FORMAT,
|
||||||
|
token,
|
||||||
|
user.getEmail()
|
||||||
|
);
|
||||||
|
String firstName = user.getFirstName() != null ? user.getFirstName() : "";
|
||||||
|
String lastName = user.getLastName() != null ? user.getLastName() : "";
|
||||||
|
String userName = String.join(" ", firstName, lastName).trim();
|
||||||
|
String subject = Utils.replacePlaceholders(emailTemplate.getSubject(), Map.of(
|
||||||
|
"{{user_name}}", userName
|
||||||
|
));
|
||||||
|
String body = Utils.replacePlaceholders(emailTemplate.getHtmlContent(), Map.of(
|
||||||
|
"{{user_name}}", userName,
|
||||||
|
"{{reset_password_link}}", redirectUrl
|
||||||
|
));
|
||||||
|
emailNotificationDao.sendMail(
|
||||||
|
user.getHub().getId(),
|
||||||
|
subject,
|
||||||
|
body,
|
||||||
|
List.of(user.getEmail()),
|
||||||
|
emailLogRequest
|
||||||
|
);
|
||||||
|
|
||||||
|
log.info("Password reset token email sent to: {}", user.getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean resetPassword(ResetPasswordReq resetPasswordReq) {
|
public Boolean resetPassword(ResetPasswordReq resetPasswordReq) {
|
||||||
UserEntity user = userRepository
|
UserEntity user = userRepository.findUserExcludingRoleType(
|
||||||
.findByEmailIgnoreCaseAndHubUniqueUuid(resetPasswordReq.getEmail(), resetPasswordReq.getHubUuid())
|
resetPasswordReq.getEmail(),
|
||||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
resetPasswordReq.getHubUuid(),
|
||||||
Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG)));
|
RoleStatusEnum.ROLE_BENEFICIARY.getValue()
|
||||||
|
).orElseThrow(() -> new ResourceNotFoundException(
|
||||||
|
Status.NOT_FOUND,
|
||||||
|
Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG)
|
||||||
|
));
|
||||||
|
|
||||||
|
UserEntity oldUserEntity = Utils.getClonedEntityForData(user);
|
||||||
if (!resetPasswordReq.getNewPassword().equals(resetPasswordReq.getConfirmPassword())) {
|
if (!resetPasswordReq.getNewPassword().equals(resetPasswordReq.getConfirmPassword())) {
|
||||||
log.info("User creation failed: Passwords do not match for email {}", user.getEmail());
|
log.info("User creation failed: Passwords do not match for email {}", user.getEmail());
|
||||||
throw new CustomValidationException(Status.VALIDATION_ERROR, Translator.toLocale(GepafinConstant.PASSWORD_DOESNT_MATCH));
|
throw new CustomValidationException(Status.VALIDATION_ERROR, Translator.toLocale(GepafinConstant.PASSWORD_DOESNT_MATCH));
|
||||||
@@ -395,25 +511,36 @@ public class UserDao {
|
|||||||
user.setPassword(passwordEncoder.encode(resetPasswordReq.getNewPassword()));
|
user.setPassword(passwordEncoder.encode(resetPasswordReq.getNewPassword()));
|
||||||
user.setResetPasswordToken(null);
|
user.setResetPasswordToken(null);
|
||||||
userRepository.save(user);
|
userRepository.save(user);
|
||||||
|
|
||||||
|
/** This code is responsible for adding a version history log for the "Reset Password " operation **/
|
||||||
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldUserEntity).newData(user).build());
|
||||||
|
|
||||||
log.info("Password successfully reset for user: {}", resetPasswordReq.getEmail());
|
log.info("Password successfully reset for user: {}", resetPasswordReq.getEmail());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean changePassword(UserEntity userEntity, ChangePasswordRequest request) {
|
public Boolean changePassword(UserEntity userEntity, ChangePasswordRequest changePasswordRequest) {
|
||||||
UserEntity user = userRepository
|
UserEntity user = userRepository
|
||||||
.findByEmailIgnoreCaseAndHubUniqueUuid(request.getEmail(), userEntity.getHub().getUniqueUuid())
|
.findUserExcludingRoleType(changePasswordRequest.getEmail(), userEntity.getHub().getUniqueUuid(),RoleStatusEnum.ROLE_BENEFICIARY.getValue())
|
||||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
.orElseThrow(() -> new ResourceNotFoundException(
|
||||||
Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG)));
|
Status.NOT_FOUND,
|
||||||
|
Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG)
|
||||||
if (!passwordEncoder.matches(request.getPassword(), user.getPassword())) {
|
));
|
||||||
|
UserEntity oldUserEntity = Utils.getClonedEntityForData(userEntity);
|
||||||
|
if (!passwordEncoder.matches(changePasswordRequest.getPassword(), user.getPassword())) {
|
||||||
throw new ResourceNotFoundException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.CURRENT_PASSWORD_INCORRECT));
|
throw new ResourceNotFoundException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.CURRENT_PASSWORD_INCORRECT));
|
||||||
}
|
}
|
||||||
if (!request.getNewPassword().equals(request.getConfirmPassword())) {
|
if (!changePasswordRequest.getNewPassword().equals(changePasswordRequest.getConfirmPassword())) {
|
||||||
log.info("User creation failed: Passwords do not match for email {}", user.getEmail());
|
log.info("User creation failed: Passwords do not match for email {}", user.getEmail());
|
||||||
throw new CustomValidationException(Status.VALIDATION_ERROR, Translator.toLocale(GepafinConstant.PASSWORD_DOESNT_MATCH));
|
throw new CustomValidationException(Status.VALIDATION_ERROR, Translator.toLocale(GepafinConstant.PASSWORD_DOESNT_MATCH));
|
||||||
}
|
}
|
||||||
user.setPassword(passwordEncoder.encode(request.getNewPassword()));
|
user.setPassword(passwordEncoder.encode(changePasswordRequest.getNewPassword()));
|
||||||
userRepository.save(user);
|
userRepository.save(user);
|
||||||
|
|
||||||
|
/** This code is responsible for adding a version history log for the "Change user password" operation **/
|
||||||
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.UPDATE).oldData(oldUserEntity).newData(user).build());
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public void logout(HttpServletRequest request, HttpServletResponse response) {
|
public void logout(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|||||||
@@ -4,15 +4,11 @@ import feign.FeignException;
|
|||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import net.gepafin.tendermanagement.config.Translator;
|
import net.gepafin.tendermanagement.config.Translator;
|
||||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||||
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
import net.gepafin.tendermanagement.entities.CompanyEntity;
|
||||||
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
import net.gepafin.tendermanagement.model.response.VatCheckResponseBean;
|
||||||
import net.gepafin.tendermanagement.model.request.UserActionRequest;
|
|
||||||
import net.gepafin.tendermanagement.service.feignClient.VatCheckService;
|
import net.gepafin.tendermanagement.service.feignClient.VatCheckService;
|
||||||
import net.gepafin.tendermanagement.util.LoggingUtil;
|
import net.gepafin.tendermanagement.util.LoggingUtil;
|
||||||
import net.gepafin.tendermanagement.util.Utils;
|
import net.gepafin.tendermanagement.util.Utils;
|
||||||
import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException;
|
|
||||||
import net.gepafin.tendermanagement.web.rest.api.errors.Status;
|
|
||||||
|
|
||||||
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;
|
||||||
@@ -49,10 +45,13 @@ public class VatCheckDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private HttpServletRequest request;
|
private HttpServletRequest request;
|
||||||
|
|
||||||
public Map<String, Object> checkVatNumberApi(String vatNumber) {
|
public VatCheckResponseBean checkVatNumberApi(String vatNumber) {
|
||||||
|
VatCheckResponseBean vatCheckResponseBean = new VatCheckResponseBean();
|
||||||
|
vatCheckResponseBean.setValid(false);
|
||||||
|
vatCheckResponseBean.setMessage(Translator.toLocale(GepafinConstant.INVALID_VATNUMBER));
|
||||||
if (Boolean.TRUE.equals(Boolean.parseBoolean(isVatCheckGloballyDisabled))) {
|
if (Boolean.TRUE.equals(Boolean.parseBoolean(isVatCheckGloballyDisabled))) {
|
||||||
return new HashMap<>();
|
vatCheckResponseBean.setMessage(Translator.toLocale(GepafinConstant.INVALID_VATNUMBER));
|
||||||
|
return vatCheckResponseBean;
|
||||||
}
|
}
|
||||||
Map<String, Object> responseBody = new HashMap<>();
|
Map<String, Object> responseBody = new HashMap<>();
|
||||||
try {
|
try {
|
||||||
@@ -77,22 +76,28 @@ public class VatCheckDao {
|
|||||||
responseBody.remove("id");
|
responseBody.remove("id");
|
||||||
Map<String, Object> data = new LinkedHashMap<>();
|
Map<String, Object> data = new LinkedHashMap<>();
|
||||||
data.put("data", responseBody);
|
data.put("data", responseBody);
|
||||||
return data;
|
vatCheckResponseBean.setValid(true);
|
||||||
|
vatCheckResponseBean.setMessage(Translator.toLocale(GepafinConstant.VALID_VATNUMBER_MSG));
|
||||||
|
vatCheckResponseBean.setVatCheckResponse(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (FeignException ex) {
|
} catch (FeignException ex) {
|
||||||
log.error("Exception occurred while checking vat number: {0}", ex);
|
log.error("Exception occurred while checking vat number: {0}", ex);
|
||||||
Utils.callException(ex.status(), ex);
|
Utils.callException(ex.status(), ex);
|
||||||
}
|
}
|
||||||
return responseBody;
|
return vatCheckResponseBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> checkVatNumber(String vatNumber) {
|
public VatCheckResponseBean checkVatNumber(String vatNumber) {
|
||||||
try {
|
try {
|
||||||
return checkVatNumberApi(vatNumber);
|
return checkVatNumberApi(vatNumber);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new CustomValidationException(Status.VALIDATION_ERROR,
|
log.error("Error in checkVatNumber: {}", e.getMessage());
|
||||||
Translator.toLocale(GepafinConstant.INVALID_VATNUMBER));
|
VatCheckResponseBean vatCheckResponseBean = new VatCheckResponseBean();
|
||||||
|
vatCheckResponseBean.setValid(false);
|
||||||
|
vatCheckResponseBean.setMessage(Translator.toLocale(GepafinConstant.INVALID_VATNUMBER));
|
||||||
|
return vatCheckResponseBean;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,28 +41,19 @@ public class CompanyEntity extends BaseEntity{
|
|||||||
@Column(name = "COUNTRY")
|
@Column(name = "COUNTRY")
|
||||||
private String country;
|
private String country;
|
||||||
|
|
||||||
@Column(name = "PEC")
|
|
||||||
private String pec;
|
|
||||||
|
|
||||||
@Column(name = "EMAIL")
|
|
||||||
private String email;
|
|
||||||
|
|
||||||
@Column(name = "NUMBER_OF_EMPLOYEES")
|
@Column(name = "NUMBER_OF_EMPLOYEES")
|
||||||
private String numberOfEmployees;
|
private String numberOfEmployees;
|
||||||
|
|
||||||
@Column(name = "ANNUAL_REVENUE")
|
@Column(name = "ANNUAL_REVENUE")
|
||||||
private BigDecimal annualRevenue;
|
private BigDecimal annualRevenue;
|
||||||
|
|
||||||
@Column(name = "CONTACT_NAME")
|
|
||||||
private String contactName;
|
|
||||||
|
|
||||||
@Column(name = "CONTACT_EMAIL")
|
|
||||||
private String contactEmail;
|
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "HUB_ID")
|
@JoinColumn(name = "HUB_ID")
|
||||||
private HubEntity hub;
|
private HubEntity hub;
|
||||||
|
|
||||||
|
// @Column(name = "JSON")
|
||||||
|
// private String json;
|
||||||
|
|
||||||
@Column(name = "NDG")
|
@Column(name = "NDG")
|
||||||
private String ndg;
|
private String ndg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package net.gepafin.tendermanagement.entities;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "NOTIFICATION")
|
||||||
|
@Data
|
||||||
|
public class NotificationEntity extends BaseEntity {
|
||||||
|
|
||||||
|
@Column(name = "USER_ID")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Column(name = "MESSAGE")
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
@Column(name = "TITLE")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Column(name = "STATUS")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Column(name = "IS_DELETED")
|
||||||
|
private Boolean isDeleted;
|
||||||
|
|
||||||
|
@Column(name = "NOTIFICATION_TYPE")
|
||||||
|
private String notificationType;
|
||||||
|
|
||||||
|
@Column(name = "REDIRECT_LINK")
|
||||||
|
private String redirectLink;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "USER_WITH_COMPANY_ID")
|
||||||
|
private UserWithCompanyEntity userWithCompany;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package net.gepafin.tendermanagement.entities;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@Table(name = "NOTIFICATION_TYPE")
|
||||||
|
public class NotificationTypeEntity extends BaseEntity {
|
||||||
|
|
||||||
|
@Column(name = "NOTIFICATION_NAME")
|
||||||
|
private String notificationName;
|
||||||
|
|
||||||
|
@Column(name = "JSON_TEMPLATE")
|
||||||
|
private String jsonTemplate;
|
||||||
|
|
||||||
|
@Column(name = "TITLE")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Column(name="IS_DELETED")
|
||||||
|
private Boolean isDeleted;
|
||||||
|
}
|
||||||
@@ -47,6 +47,8 @@ public class SystemEmailTemplatesEntity extends BaseEntity {
|
|||||||
INADMISSIBILITY_NOTIFICATION_DUE_TO_FAILURE("INADMISSIBILITY_NOTIFICATION_DUE_TO_FAILURE"),
|
INADMISSIBILITY_NOTIFICATION_DUE_TO_FAILURE("INADMISSIBILITY_NOTIFICATION_DUE_TO_FAILURE"),
|
||||||
ADMISSIBILITY_NOTIFICATION("ADMISSIBILITY_NOTIFICATION"),
|
ADMISSIBILITY_NOTIFICATION("ADMISSIBILITY_NOTIFICATION"),
|
||||||
AMENDMENT_REMINDER("AMENDMENT_REMINDER"),
|
AMENDMENT_REMINDER("AMENDMENT_REMINDER"),
|
||||||
|
USER_ONBOARDING("USER_ONBOARDING"),
|
||||||
|
PASSWORD_RESET("PASSWORD_RESET"),
|
||||||
INADMISSIBILITY_TEMPLATE("INADMISSIBILITY_NOTIFICATION");
|
INADMISSIBILITY_TEMPLATE("INADMISSIBILITY_NOTIFICATION");
|
||||||
|
|
||||||
private String value;
|
private String value;
|
||||||
|
|||||||
@@ -22,6 +22,22 @@ public class UserWithCompanyEntity extends BaseEntity{
|
|||||||
@Column(name = "IS_LEGAL_REPRESENTANT")
|
@Column(name = "IS_LEGAL_REPRESENTANT")
|
||||||
private Boolean isLegalRepresentant;
|
private Boolean isLegalRepresentant;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "CONTACT_NAME")
|
||||||
|
private String contactName;
|
||||||
|
|
||||||
|
@Column(name = "CONTACT_EMAIL")
|
||||||
|
private String contactEmail;
|
||||||
|
|
||||||
|
@Column(name = "PEC")
|
||||||
|
private String pec;
|
||||||
|
|
||||||
|
@Column(name = "EMAIL")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@Column(name = "JSON")
|
||||||
|
private String json;
|
||||||
|
|
||||||
@Column(name = "IS_DELETED")
|
@Column(name = "IS_DELETED")
|
||||||
private Boolean isDeleted = false;
|
private Boolean isDeleted = false;
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ public enum EmailScenarioTypeEnum {
|
|||||||
APPLICATION_AMENDMENT_EXPIRED("APPLICATION_AMENDMENT_EXPIRED"),
|
APPLICATION_AMENDMENT_EXPIRED("APPLICATION_AMENDMENT_EXPIRED"),
|
||||||
APPLICATION_AMENDMENT_REMINDER("APPLICATION_AMENDMENT_REMINDER"),
|
APPLICATION_AMENDMENT_REMINDER("APPLICATION_AMENDMENT_REMINDER"),
|
||||||
APPLICATION_APPROVED("APPLICATION_APPROVED"),
|
APPLICATION_APPROVED("APPLICATION_APPROVED"),
|
||||||
|
USER_CREATION("USER_CREATION"),
|
||||||
|
PASSWORD_RESET_REQUEST("PASSWORD_RESET_REQUEST"),
|
||||||
APPLICATION_REJECTED("APPLICATION_REJECTED");
|
APPLICATION_REJECTED("APPLICATION_REJECTED");
|
||||||
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package net.gepafin.tendermanagement.enums;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
|
public enum NotificationEnum {
|
||||||
|
//status
|
||||||
|
READ("READ"), UNREAD("UNREAD");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
NotificationEnum(String value) {
|
||||||
|
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonValue
|
||||||
|
public String getValue() {
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package net.gepafin.tendermanagement.enums;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
|
public enum NotificationTypeEnum {
|
||||||
|
CALL_CREATED("CALL_CREATED"),
|
||||||
|
APPLICATION_SUBMISSION("APPLICATION_SUBMISSION"),
|
||||||
|
AMENDMENT_CREATION("AMENDMENT_CREATION"),
|
||||||
|
EVALUATION_RESULT("EVALUATION_RESULT"),
|
||||||
|
AMENDMENT_EXPIRED("AMENDMENT_EXPIRED"),
|
||||||
|
AMENDMENT_CLOSED("AMENDMENT_CLOSED"),
|
||||||
|
NDG_GENERATION("NDG_GENERATION"),
|
||||||
|
EVALUATION_CREATION("EVALUATION_CREATION"),
|
||||||
|
EVALUATION_EXPIRED("EVALUATION_EXPIRED");
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
NotificationTypeEnum(String value) {
|
||||||
|
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonValue
|
||||||
|
public String getValue() {
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,7 +24,9 @@ public enum UserActionContextEnum {
|
|||||||
VALIDATE_EXISTING_USER_WITH_SPID_TOKEN("VALIDATE_EXISTING_USER_WITH_SPID_TOKEN"),
|
VALIDATE_EXISTING_USER_WITH_SPID_TOKEN("VALIDATE_EXISTING_USER_WITH_SPID_TOKEN"),
|
||||||
GET_VALID_USER_DETAILS("GET_VALID_USER_DETAILS"),
|
GET_VALID_USER_DETAILS("GET_VALID_USER_DETAILS"),
|
||||||
GET_ALL_USERS_BY_ROLE("GET_ALL_USERS_BY_ROLE"),
|
GET_ALL_USERS_BY_ROLE("GET_ALL_USERS_BY_ROLE"),
|
||||||
|
CHANGE_USER_PASSWORD("CHANGE_USER_PASSWORD"),
|
||||||
|
INITIATE_PASSWORD_RESET_REQUEST("INITIATE_PASSWORD_RESET_REQUEST"),
|
||||||
|
RESET_USER_PASSWORD("RESET_USER_PASSWORD"),
|
||||||
/** application action context **/
|
/** application action context **/
|
||||||
GET_APPLICATION("GET_APPLICATION"),
|
GET_APPLICATION("GET_APPLICATION"),
|
||||||
CREATE_UPDATE_APPLICATION_FORM("CREATE_UPDATE_APPLICATION_FORM"),
|
CREATE_UPDATE_APPLICATION_FORM("CREATE_UPDATE_APPLICATION_FORM"),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package net.gepafin.tendermanagement.model.request;
|
package net.gepafin.tendermanagement.model.request;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -23,4 +24,5 @@ public class CompanyRequest {
|
|||||||
private Boolean isLegalRepresentant;
|
private Boolean isLegalRepresentant;
|
||||||
private String contactName;
|
private String contactName;
|
||||||
private String contactEmail;
|
private String contactEmail;
|
||||||
|
private Map<String, Object> vatCheckResponse;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package net.gepafin.tendermanagement.model.request;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.gepafin.tendermanagement.entities.UserWithCompanyEntity;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class NotificationReq {
|
||||||
|
|
||||||
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
|
Long id;
|
||||||
|
|
||||||
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
|
Long userId;
|
||||||
|
|
||||||
|
String message;
|
||||||
|
|
||||||
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
|
String notificationType;
|
||||||
|
|
||||||
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
|
String status;
|
||||||
|
|
||||||
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
|
private LocalDateTime createdDate;
|
||||||
|
|
||||||
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
|
private LocalDateTime updatedDate;
|
||||||
|
|
||||||
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
|
private String redirectUrl;
|
||||||
|
|
||||||
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
|
private List<Long> companyIds;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
private UserWithCompanyEntity userWithCompanyEntity;
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package net.gepafin.tendermanagement.model.response;
|
package net.gepafin.tendermanagement.model.response;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import net.gepafin.tendermanagement.entities.ApplicationEvaluationEntity;
|
|
||||||
import net.gepafin.tendermanagement.enums.ApplicationAmendmentRequestEnum;
|
import net.gepafin.tendermanagement.enums.ApplicationAmendmentRequestEnum;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -19,6 +18,7 @@ public class ApplicationAmendmentRequestResponse {
|
|||||||
private Long protocolNumber;
|
private Long protocolNumber;
|
||||||
private String callName;
|
private String callName;
|
||||||
private String beneficiaryName;
|
private String beneficiaryName;
|
||||||
|
private String companyName;
|
||||||
private List<AmendmentFormFieldResponse> formFields;
|
private List<AmendmentFormFieldResponse> formFields;
|
||||||
private List<ApplicationFormFieldResponseBean> applicationFormFields;
|
private List<ApplicationFormFieldResponseBean> applicationFormFields;
|
||||||
private List<DocumentResponseBean> amendmentDocuments;
|
private List<DocumentResponseBean> amendmentDocuments;
|
||||||
@@ -31,4 +31,5 @@ public class ApplicationAmendmentRequestResponse {
|
|||||||
private List<CommunicationResponseBean> commentsList;
|
private List<CommunicationResponseBean> commentsList;
|
||||||
private String internalNote;
|
private String internalNote;
|
||||||
private ApplicationAmendmentRequestEnum status;
|
private ApplicationAmendmentRequestEnum status;
|
||||||
|
private String emailTemplate;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public class ApplicationEvaluationResponse {
|
|||||||
private LocalDateTime createdDate;
|
private LocalDateTime createdDate;
|
||||||
private LocalDateTime updatedDate;
|
private LocalDateTime updatedDate;
|
||||||
private String beneficiary;
|
private String beneficiary;
|
||||||
|
private Long assignedUserId;
|
||||||
|
private String assignedUserName;
|
||||||
private Long protocolNumber;
|
private Long protocolNumber;
|
||||||
private String callName;
|
private String callName;
|
||||||
private String motivation;
|
private String motivation;
|
||||||
|
|||||||
@@ -33,4 +33,8 @@ public class ApplicationResponse{
|
|||||||
|
|
||||||
private Long protocolNumber;
|
private Long protocolNumber;
|
||||||
|
|
||||||
|
private Long assignedUserId;
|
||||||
|
|
||||||
|
private String assignedUserName;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package net.gepafin.tendermanagement.model.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EmailContentResponse {
|
||||||
|
private final String subject;
|
||||||
|
private final String body;
|
||||||
|
private final SystemEmailTemplateResponse systemEmailTemplateResponse;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package net.gepafin.tendermanagement.model.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import net.gepafin.tendermanagement.model.BaseBean;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class NotificationResponse extends BaseBean {
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
private String redirectUrl;
|
||||||
|
|
||||||
|
private String notificationType;
|
||||||
|
}
|
||||||
@@ -40,6 +40,7 @@ public class UserResponseBean extends BaseBean {
|
|||||||
|
|
||||||
private List<CompanyResponse> companies;
|
private List<CompanyResponse> companies;
|
||||||
private Boolean privacy;
|
private Boolean privacy;
|
||||||
|
|
||||||
private Boolean terms;
|
private Boolean terms;
|
||||||
|
|
||||||
private Boolean marketing;
|
private Boolean marketing;
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package net.gepafin.tendermanagement.model.response;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class VatCheckResponseBean {
|
||||||
|
private Boolean valid;
|
||||||
|
private Map<String, Object> vatCheckResponse;
|
||||||
|
private String message;
|
||||||
|
}
|
||||||
@@ -1,11 +1,16 @@
|
|||||||
package net.gepafin.tendermanagement.repositories;
|
package net.gepafin.tendermanagement.repositories;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import net.gepafin.tendermanagement.entities.BeneficiaryEntity;
|
import net.gepafin.tendermanagement.entities.BeneficiaryEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface BeneficiaryRepository extends JpaRepository<BeneficiaryEntity, Long> {
|
public interface BeneficiaryRepository extends JpaRepository<BeneficiaryEntity, Long> {
|
||||||
|
|
||||||
|
@Query("SELECT u.id FROM UserEntity u JOIN u.beneficiary b WHERE b.id = u.beneficiary.id AND b.hubId = :hubId")
|
||||||
|
List<Long> findUserIdsByHubIdAndBeneficiaryId(Long hubId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,4 +47,6 @@ public interface CallRepository extends JpaRepository<CallEntity, Long> {
|
|||||||
BigDecimal findTotalAmountOfPublishedCallsAndHubId(@Param("hubId") Long hubId);
|
BigDecimal findTotalAmountOfPublishedCallsAndHubId(@Param("hubId") Long hubId);
|
||||||
@Query("SELECT c FROM CallEntity c WHERE c.id IN :ids AND c.status IN :status")
|
@Query("SELECT c FROM CallEntity c WHERE c.id IN :ids AND c.status IN :status")
|
||||||
List<CallEntity> findByIdInAndStatusIn(@Param("ids") List<Long> ids, @Param("status") List<String> status);
|
List<CallEntity> findByIdInAndStatusIn(@Param("ids") List<Long> ids, @Param("status") List<String> status);
|
||||||
|
List<CallEntity> findByIdIn(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,5 +33,7 @@ public interface DocumentRepository extends JpaRepository<DocumentEntity, Long>
|
|||||||
List<DocumentEntity> findAllByIsDeleteTrue();
|
List<DocumentEntity> findAllByIsDeleteTrue();
|
||||||
|
|
||||||
List<DocumentEntity> findAllByIdInAndIsDeletedFalse(Set<Long> documentIds);
|
List<DocumentEntity> findAllByIdInAndIsDeletedFalse(Set<Long> documentIds);
|
||||||
|
|
||||||
|
List<DocumentEntity> findBySourceIdInAndSourceAndIsDeletedFalse(Set<Long> sourceId, String type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package net.gepafin.tendermanagement.repositories;
|
||||||
|
|
||||||
|
import net.gepafin.tendermanagement.entities.NotificationEntity;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface NotificationRepository extends JpaRepository<NotificationEntity, Long> {
|
||||||
|
|
||||||
|
NotificationEntity findByIdAndIsDeletedFalse(Long id);
|
||||||
|
|
||||||
|
List<NotificationEntity> findByUserIdAndIsDeletedFalse(Long userId);
|
||||||
|
|
||||||
|
List<NotificationEntity> findByUserIdAndUserWithCompanyIdAndIsDeletedFalseAndStatusIn(Long userId, Long userWithCompanyId, List<String> statuses);
|
||||||
|
|
||||||
|
List<NotificationEntity> findByUserIdAndIsDeletedFalseAndStatusIn(Long userId, List<String> statuses);
|
||||||
|
|
||||||
|
List<NotificationEntity> findByUserWithCompanyIdAndUserIdAndIsDeletedFalse(Long userWithCompanyId, Long userId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package net.gepafin.tendermanagement.repositories;
|
||||||
|
|
||||||
|
import net.gepafin.tendermanagement.entities.NotificationTypeEntity;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface NotificationTypeRepository extends JpaRepository<NotificationTypeEntity, Long> {
|
||||||
|
NotificationTypeEntity findByNotificationNameAndIsDeletedFalse(String value);
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@ package net.gepafin.tendermanagement.repositories;
|
|||||||
|
|
||||||
import net.gepafin.tendermanagement.entities.UserEntity;
|
import net.gepafin.tendermanagement.entities.UserEntity;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -12,9 +14,16 @@ public interface UserRepository extends JpaRepository<UserEntity, Long> {
|
|||||||
|
|
||||||
UserEntity findByBeneficiaryId(Long beneficiaryId);
|
UserEntity findByBeneficiaryId(Long beneficiaryId);
|
||||||
|
|
||||||
Optional<UserEntity> findByEmailIgnoreCaseAndHubUniqueUuid(String email, String hubUuid);
|
// Optional<UserEntity> findByEmailIgnoreCaseAndHubUniqueUuid(String email, String hubUuid);
|
||||||
|
|
||||||
boolean existsByEmailIgnoreCaseAndHubUniqueUuid(String email, String hubUuid);
|
@Query("SELECT u FROM UserEntity u WHERE LOWER(u.email) = LOWER(:email) AND u.hub.uniqueUuid = :hubUuid AND u.roleEntity.roleType <> :roleType")
|
||||||
|
Optional<UserEntity> findUserExcludingRoleType(
|
||||||
|
@Param("email") String email,
|
||||||
|
@Param("hubUuid") String hubUuid,
|
||||||
|
@Param("roleType") String roleType
|
||||||
|
);
|
||||||
|
|
||||||
|
// boolean existsByEmailIgnoreCaseAndHubUniqueUuid(String email, String hubUuid);
|
||||||
|
|
||||||
List<UserEntity> findByRoleEntityIdInAndHubId(List<Long> roleIds, Long hubId);
|
List<UserEntity> findByRoleEntityIdInAndHubId(List<Long> roleIds, Long hubId);
|
||||||
|
|
||||||
@@ -24,5 +33,29 @@ public interface UserRepository extends JpaRepository<UserEntity, Long> {
|
|||||||
|
|
||||||
Optional<UserEntity> findByBeneficiaryCodiceFiscaleAndHubId(String codiceFiscale, Long hubId);
|
Optional<UserEntity> findByBeneficiaryCodiceFiscaleAndHubId(String codiceFiscale, Long hubId);
|
||||||
|
|
||||||
|
// Boolean existsByBeneficiaryCodiceFiscaleAndHubId(String codiceFiscale, Long hubId);
|
||||||
|
|
||||||
|
@Query("SELECT COUNT(u) > 0 " +
|
||||||
|
"FROM UserEntity u " +
|
||||||
|
"WHERE LOWER(u.email) = LOWER(:email) " +
|
||||||
|
"AND u.hub.uniqueUuid = :hubUuid " +
|
||||||
|
"AND u.roleEntity.roleType <> :beneficiaryRoleType")
|
||||||
|
Boolean existsByEmailIgnoreCaseForNonBeneficiaries(@Param("email") String email,
|
||||||
|
@Param("hubUuid") String hubUuid,
|
||||||
|
@Param("beneficiaryRoleType") String beneficiaryRoleType);
|
||||||
|
|
||||||
|
@Query("SELECT COUNT(u) > 0 " +
|
||||||
|
"FROM UserEntity u " +
|
||||||
|
"WHERE LOWER(u.email) = LOWER(:email) " +
|
||||||
|
"AND u.hub.uniqueUuid = :hubUuid " +
|
||||||
|
"AND u.roleEntity.roleType = :beneficiaryRoleType")
|
||||||
|
Boolean existsByEmailIgnoreCaseForBeneficiaries(@Param("email") String email,
|
||||||
|
@Param("hubUuid") String hubUuid,
|
||||||
|
@Param("beneficiaryRoleType") String beneficiaryRoleType);
|
||||||
|
|
||||||
|
|
||||||
boolean existsByBeneficiaryCodiceFiscaleAndHubId(String codiceFiscale, Long hubId);
|
boolean existsByBeneficiaryCodiceFiscaleAndHubId(String codiceFiscale, Long hubId);
|
||||||
|
|
||||||
|
List<UserEntity> findByRoleEntity_RoleTypeAndHubId(String roleType, Long hubId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package net.gepafin.tendermanagement.repositories;
|
package net.gepafin.tendermanagement.repositories;
|
||||||
|
|
||||||
import java.util.List;
|
import net.gepafin.tendermanagement.entities.UserWithCompanyEntity;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.data.repository.query.Param;
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
import net.gepafin.tendermanagement.entities.UserWithCompanyEntity;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public interface UserWithCompanyRepository extends JpaRepository<UserWithCompanyEntity, Long> {
|
public interface UserWithCompanyRepository extends JpaRepository<UserWithCompanyEntity, Long> {
|
||||||
|
|
||||||
@@ -19,4 +17,7 @@ public interface UserWithCompanyRepository extends JpaRepository<UserWithCompany
|
|||||||
|
|
||||||
Optional<UserWithCompanyEntity> findByUserIdAndCompanyIdAndIsDeletedFalse(Long userId, Long companyId);
|
Optional<UserWithCompanyEntity> findByUserIdAndCompanyIdAndIsDeletedFalse(Long userId, Long companyId);
|
||||||
|
|
||||||
|
@Query("SELECT u FROM UserWithCompanyEntity u WHERE u.userId = :userId AND u.companyId = :companyId AND u.isDeleted = false")
|
||||||
|
UserWithCompanyEntity findByUserIdAndCompanyIdAndIsDeletedFalseForNotification(Long userId, Long companyId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +1,42 @@
|
|||||||
package net.gepafin.tendermanagement.scheduler;
|
package net.gepafin.tendermanagement.scheduler;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import java.time.LocalTime;
|
import net.gepafin.tendermanagement.dao.ApplicationAmendmentRequestDao;
|
||||||
import java.util.List;
|
import net.gepafin.tendermanagement.dao.NotificationDao;
|
||||||
import java.util.Set;
|
import net.gepafin.tendermanagement.entities.ApplicationAmendmentRequestEntity;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import net.gepafin.tendermanagement.entities.ApplicationEntity;
|
import net.gepafin.tendermanagement.entities.ApplicationEntity;
|
||||||
|
import net.gepafin.tendermanagement.entities.ApplicationEvaluationEntity;
|
||||||
import net.gepafin.tendermanagement.entities.AssignedApplicationsEntity;
|
import net.gepafin.tendermanagement.entities.AssignedApplicationsEntity;
|
||||||
import net.gepafin.tendermanagement.enums.*;
|
import net.gepafin.tendermanagement.enums.ApplicationAmendmentRequestEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.ApplicationEvaluationStatusTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.AssignedApplicationEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.NotificationTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.VersionActionTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.model.request.UserActionRequest;
|
||||||
|
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
|
||||||
|
import net.gepafin.tendermanagement.repositories.ApplicationAmendmentRequestRepository;
|
||||||
import net.gepafin.tendermanagement.repositories.ApplicationEvaluationRepository;
|
import net.gepafin.tendermanagement.repositories.ApplicationEvaluationRepository;
|
||||||
import net.gepafin.tendermanagement.repositories.ApplicationRepository;
|
import net.gepafin.tendermanagement.repositories.ApplicationRepository;
|
||||||
import net.gepafin.tendermanagement.repositories.AssignedApplicationsRepository;
|
import net.gepafin.tendermanagement.repositories.AssignedApplicationsRepository;
|
||||||
import net.gepafin.tendermanagement.service.ApplicationService;
|
import net.gepafin.tendermanagement.service.ApplicationService;
|
||||||
|
import net.gepafin.tendermanagement.util.DateTimeUtil;
|
||||||
|
import net.gepafin.tendermanagement.util.LoggingUtil;
|
||||||
|
import net.gepafin.tendermanagement.util.Utils;
|
||||||
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;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import java.time.LocalTime;
|
||||||
import net.gepafin.tendermanagement.dao.ApplicationAmendmentRequestDao;
|
import java.util.List;
|
||||||
import net.gepafin.tendermanagement.entities.ApplicationAmendmentRequestEntity;
|
import java.util.Map;
|
||||||
import net.gepafin.tendermanagement.entities.ApplicationEvaluationEntity;
|
import java.util.Set;
|
||||||
import net.gepafin.tendermanagement.model.request.UserActionRequest;
|
import java.util.stream.Collectors;
|
||||||
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
|
|
||||||
import net.gepafin.tendermanagement.repositories.ApplicationAmendmentRequestRepository;
|
|
||||||
import net.gepafin.tendermanagement.util.DateTimeUtil;
|
|
||||||
import net.gepafin.tendermanagement.util.LoggingUtil;
|
|
||||||
import net.gepafin.tendermanagement.util.Utils;
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class ApplicationAmendmentScheduler {
|
public class ApplicationAmendmentScheduler {
|
||||||
@@ -47,6 +54,9 @@ public class ApplicationAmendmentScheduler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private LoggingUtil loggingUtil;
|
private LoggingUtil loggingUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationDao notificationDao;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AssignedApplicationsRepository assignedApplicationsRepository;
|
private AssignedApplicationsRepository assignedApplicationsRepository;
|
||||||
|
|
||||||
@@ -90,8 +100,10 @@ public class ApplicationAmendmentScheduler {
|
|||||||
try {
|
try {
|
||||||
ApplicationAmendmentRequestEntity oldAmendmentRequestEntity = Utils.getClonedEntityForData(request);
|
ApplicationAmendmentRequestEntity oldAmendmentRequestEntity = Utils.getClonedEntityForData(request);
|
||||||
request.setStatus(ApplicationAmendmentRequestEnum.EXPIRED.getValue());
|
request.setStatus(ApplicationAmendmentRequestEnum.EXPIRED.getValue());
|
||||||
|
ApplicationEntity application=oldAmendmentRequestEntity.getApplicationEvaluationEntity().getAssignedApplicationsEntity().getApplication();
|
||||||
request = applicationAmendmentRepository.save(request);
|
request = applicationAmendmentRepository.save(request);
|
||||||
|
Map<String ,String> placeHolders=notificationDao.sendNotificationToBeneficiary(application,NotificationTypeEnum.AMENDMENT_EXPIRED);
|
||||||
|
notificationDao.sendNotificationToInstructor(placeHolders,oldAmendmentRequestEntity.getApplicationEvaluationEntity(),NotificationTypeEnum.AMENDMENT_EXPIRED);
|
||||||
/** This code is responsible for adding a version history log for the "Update Application Amendment" operation. **/
|
/** This code is responsible for adding a version history log for the "Update Application Amendment" operation. **/
|
||||||
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(httpServletRequest).actionType(VersionActionTypeEnum.UPDATE).oldData(oldAmendmentRequestEntity).newData(request).build());
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(httpServletRequest).actionType(VersionActionTypeEnum.UPDATE).oldData(oldAmendmentRequestEntity).newData(request).build());
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package net.gepafin.tendermanagement.scheduler;
|
package net.gepafin.tendermanagement.scheduler;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import net.gepafin.tendermanagement.dao.NotificationDao;
|
||||||
|
import net.gepafin.tendermanagement.entities.ApplicationEntity;
|
||||||
import net.gepafin.tendermanagement.entities.ApplicationEvaluationEntity;
|
import net.gepafin.tendermanagement.entities.ApplicationEvaluationEntity;
|
||||||
import net.gepafin.tendermanagement.enums.ApplicationEvaluationStatusTypeEnum;
|
import net.gepafin.tendermanagement.enums.ApplicationEvaluationStatusTypeEnum;
|
||||||
|
import net.gepafin.tendermanagement.enums.NotificationTypeEnum;
|
||||||
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
||||||
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
||||||
import net.gepafin.tendermanagement.enums.VersionActionTypeEnum;
|
import net.gepafin.tendermanagement.enums.VersionActionTypeEnum;
|
||||||
@@ -22,6 +25,7 @@ import org.springframework.stereotype.Component;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class ApplicationEvaluationScheduler {
|
public class ApplicationEvaluationScheduler {
|
||||||
@@ -35,6 +39,9 @@ public class ApplicationEvaluationScheduler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private HttpServletRequest httpServletRequest;
|
private HttpServletRequest httpServletRequest;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationDao notificationDao;
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(ApplicationEvaluationScheduler.class);
|
private static final Logger log = LoggerFactory.getLogger(ApplicationEvaluationScheduler.class);
|
||||||
|
|
||||||
@Scheduled(cron = "0 0 2 * * ?") // Runs daily at midnight
|
@Scheduled(cron = "0 0 2 * * ?") // Runs daily at midnight
|
||||||
@@ -76,10 +83,15 @@ public class ApplicationEvaluationScheduler {
|
|||||||
|
|
||||||
ApplicationEvaluationEntity oldApplicationEvaluationEntity = Utils
|
ApplicationEvaluationEntity oldApplicationEvaluationEntity = Utils
|
||||||
.getClonedEntityForData(evaluation);
|
.getClonedEntityForData(evaluation);
|
||||||
|
ApplicationEntity application=evaluation.getAssignedApplicationsEntity().getApplication();
|
||||||
evaluation.setStatus(ApplicationEvaluationStatusTypeEnum.EXPIRED.getValue());
|
evaluation.setStatus(ApplicationEvaluationStatusTypeEnum.EXPIRED.getValue());
|
||||||
evaluation = applicationEvaluationRepository.save(evaluation);
|
evaluation = applicationEvaluationRepository.save(evaluation);
|
||||||
|
|
||||||
|
Map<String, String> placeHolders = notificationDao.sendNotificationToBeneficiary(application, NotificationTypeEnum.EVALUATION_EXPIRED);
|
||||||
|
notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.EVALUATION_EXPIRED);
|
||||||
|
notificationDao.sendNotificationToInstructor(placeHolders,evaluation,NotificationTypeEnum.EVALUATION_EXPIRED);
|
||||||
|
|
||||||
|
|
||||||
// Logging version history for the update operation
|
// Logging version history for the update operation
|
||||||
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(httpServletRequest)
|
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(httpServletRequest)
|
||||||
.actionType(VersionActionTypeEnum.UPDATE).oldData(oldApplicationEvaluationEntity)
|
.actionType(VersionActionTypeEnum.UPDATE).oldData(oldApplicationEvaluationEntity)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import net.gepafin.tendermanagement.model.response.VatCheckResponseBean;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
@@ -26,7 +27,7 @@ public interface CompanyService {
|
|||||||
|
|
||||||
List<CompanyResponse> getCompanyByUserId(HttpServletRequest request, Long userId);
|
List<CompanyResponse> getCompanyByUserId(HttpServletRequest request, Long userId);
|
||||||
|
|
||||||
Map<String, Object> checkVatNumber(HttpServletRequest request, String vatNumber);
|
VatCheckResponseBean checkVatNumber(HttpServletRequest request, String vatNumber);
|
||||||
|
|
||||||
CompanyEntity validateCompany(Long companyId);
|
CompanyEntity validateCompany(Long companyId);
|
||||||
|
|
||||||
@@ -44,5 +45,4 @@ public interface CompanyService {
|
|||||||
UserWithCompanyEntity getUserWithCompanyEntity(Long userId,Long companyId);
|
UserWithCompanyEntity getUserWithCompanyEntity(Long userId,Long companyId);
|
||||||
void removeCompanyFromList(HttpServletRequest request, Long companyId);
|
void removeCompanyFromList(HttpServletRequest request, Long companyId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package net.gepafin.tendermanagement.service;
|
||||||
|
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import net.gepafin.tendermanagement.enums.NotificationEnum;
|
||||||
|
import net.gepafin.tendermanagement.model.request.NotificationReq;
|
||||||
|
import net.gepafin.tendermanagement.model.response.NotificationResponse;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface NotificationService {
|
||||||
|
NotificationResponse sendNotification(Long userId, NotificationReq notificationReq, Long companyId);
|
||||||
|
|
||||||
|
public NotificationResponse getNotificationById(HttpServletRequest servletRequest, Long id);
|
||||||
|
|
||||||
|
public List<NotificationResponse> getNotificationByUserId(HttpServletRequest servletRequest, Long userId, Long companyId, List<NotificationEnum> statuses);
|
||||||
|
|
||||||
|
public NotificationResponse updateNotificationStatus(HttpServletRequest request, Long id, NotificationEnum status);
|
||||||
|
|
||||||
|
public void deleteNotification(HttpServletRequest request, Long id);
|
||||||
|
|
||||||
|
public List<NotificationResponse> getNotificationsByCompanyIdAndUserId(Long userId, Long companyId, List<NotificationEnum> statuses);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@ public interface UserService {
|
|||||||
|
|
||||||
UserEntity validateUser(Long userId);
|
UserEntity validateUser(Long userId);
|
||||||
|
|
||||||
String initiatePasswordReset(InitiatePasswordResetReq resetReq);
|
void initiatePasswordReset(InitiatePasswordResetReq resetReq);
|
||||||
|
|
||||||
Boolean resetPassword(ResetPasswordReq resetPasswordReq);
|
Boolean resetPassword(ResetPasswordReq resetPasswordReq);
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ import net.gepafin.tendermanagement.entities.HubEntity;
|
|||||||
import net.gepafin.tendermanagement.entities.LoginAttemptEntity;
|
import net.gepafin.tendermanagement.entities.LoginAttemptEntity;
|
||||||
import net.gepafin.tendermanagement.entities.SamlResponseEntity;
|
import net.gepafin.tendermanagement.entities.SamlResponseEntity;
|
||||||
import net.gepafin.tendermanagement.entities.UserEntity;
|
import net.gepafin.tendermanagement.entities.UserEntity;
|
||||||
import net.gepafin.tendermanagement.enums.LoginAttemptResultEnum;
|
import net.gepafin.tendermanagement.enums.*;
|
||||||
import net.gepafin.tendermanagement.enums.LoginAttemptTypeEnum;
|
|
||||||
import net.gepafin.tendermanagement.enums.UserStatusEnum;
|
|
||||||
import net.gepafin.tendermanagement.enums.VersionActionTypeEnum;
|
|
||||||
import net.gepafin.tendermanagement.model.request.LoginReq;
|
import net.gepafin.tendermanagement.model.request.LoginReq;
|
||||||
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
|
import net.gepafin.tendermanagement.model.request.VersionHistoryRequest;
|
||||||
import net.gepafin.tendermanagement.model.response.CompanyResponse;
|
import net.gepafin.tendermanagement.model.response.CompanyResponse;
|
||||||
@@ -40,6 +37,7 @@ import org.springframework.security.authentication.AuthenticationManager;
|
|||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
|
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -95,15 +93,22 @@ public class AuthenticationService {
|
|||||||
LoginAttemptEntity loginAttemptEntity = prepareLoginAttemptEntity(loginReq, request);
|
LoginAttemptEntity loginAttemptEntity = prepareLoginAttemptEntity(loginReq, request);
|
||||||
try {
|
try {
|
||||||
log.info("Attempting login for email: {}", loginReq.getEmail());
|
log.info("Attempting login for email: {}", loginReq.getEmail());
|
||||||
|
user = userRepository.findUserExcludingRoleType(
|
||||||
|
loginReq.getEmail(),
|
||||||
|
loginReq.getHubUuid(),
|
||||||
|
RoleStatusEnum.ROLE_BENEFICIARY.getValue()
|
||||||
|
).orElseThrow(() -> new ResourceNotFoundException(
|
||||||
|
Status.NOT_FOUND,
|
||||||
|
Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG)
|
||||||
|
));
|
||||||
|
|
||||||
String emailWithHubId = loginReq.getEmail()+":"+loginReq.getHubUuid();
|
String emailWithHubId = loginReq.getEmail()+":"+loginReq.getHubUuid();
|
||||||
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(
|
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(
|
||||||
emailWithHubId, loginReq.getPassword());
|
emailWithHubId, loginReq.getPassword());
|
||||||
Authentication authentication = this.authenticationManager.authenticate(authenticationToken);
|
Authentication authentication = this.authenticationManager.authenticate(authenticationToken);
|
||||||
SecurityContextHolder.getContext().setAuthentication(authentication);
|
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||||
log.info("Authentication successful for email: {}", loginReq.getEmail());
|
log.info("Authentication successful for email: {}", loginReq.getEmail());
|
||||||
user = userRepository.findByEmailIgnoreCaseAndHubUniqueUuid(loginReq.getEmail(), loginReq.getHubUuid())
|
|
||||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
|
||||||
Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG)));
|
|
||||||
loginAttemptEntity.setUserId(user.getId());
|
loginAttemptEntity.setUserId(user.getId());
|
||||||
if (Boolean.FALSE.equals(UserStatusEnum.ACTIVE.getValue().equals(user.getStatus()))) {
|
if (Boolean.FALSE.equals(UserStatusEnum.ACTIVE.getValue().equals(user.getStatus()))) {
|
||||||
throw new ResourceNotFoundException(Status.NOT_FOUND,
|
throw new ResourceNotFoundException(Status.NOT_FOUND,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import net.gepafin.tendermanagement.model.response.VatCheckResponseBean;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -78,7 +79,7 @@ public class CompanyServiceImpl implements CompanyService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public Map<String, Object> checkVatNumber(HttpServletRequest request, String vatNumber) {
|
public VatCheckResponseBean checkVatNumber(HttpServletRequest request, String vatNumber) {
|
||||||
return vatCheckDao.checkVatNumber(vatNumber);
|
return vatCheckDao.checkVatNumber(vatNumber);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package net.gepafin.tendermanagement.service.impl;
|
||||||
|
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.gepafin.tendermanagement.dao.NotificationDao;
|
||||||
|
import net.gepafin.tendermanagement.enums.NotificationEnum;
|
||||||
|
import net.gepafin.tendermanagement.model.request.NotificationReq;
|
||||||
|
import net.gepafin.tendermanagement.model.response.NotificationResponse;
|
||||||
|
import net.gepafin.tendermanagement.service.NotificationService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.hibernate.internal.util.collections.CollectionHelper.listOf;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class NotificationServiceImpl implements NotificationService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationDao notificationDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NotificationResponse sendNotification(Long userId, NotificationReq notificationReq, Long companyId) {
|
||||||
|
|
||||||
|
log.info("Sending notification to user {} with content: {}", userId, notificationReq.getMessage());
|
||||||
|
notificationReq.setUserId(userId);
|
||||||
|
notificationReq.setCompanyIds(listOf(companyId));
|
||||||
|
return notificationDao.sendNotification(notificationReq);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NotificationResponse getNotificationById(HttpServletRequest servletRequest, Long id) {
|
||||||
|
|
||||||
|
return notificationDao.getNotificationById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<NotificationResponse> getNotificationByUserId(HttpServletRequest servletRequest, Long userId, Long companyId, List<NotificationEnum> statuses) {
|
||||||
|
|
||||||
|
return notificationDao.getNotificationByUserId(userId, companyId, statuses);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NotificationResponse updateNotificationStatus(HttpServletRequest request, Long id, NotificationEnum status) {
|
||||||
|
|
||||||
|
return notificationDao.updateNotificationStatus(id, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteNotification(HttpServletRequest request, Long id) {
|
||||||
|
|
||||||
|
notificationDao.deleteNotification(id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<NotificationResponse> getNotificationsByCompanyIdAndUserId(Long userId, Long companyId, List<NotificationEnum> statuses) {
|
||||||
|
return notificationDao.getNotificationByCompanyIdAndUserId(userId, companyId, statuses);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -77,8 +77,8 @@ public class UserServiceImpl implements UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String initiatePasswordReset(InitiatePasswordResetReq resetReq) {
|
public void initiatePasswordReset(InitiatePasswordResetReq resetReq) {
|
||||||
return userDao.initiatePasswordReset(resetReq);
|
userDao.initiatePasswordReset(resetReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -19,19 +19,15 @@ import com.fasterxml.jackson.annotation.PropertyAccessor;
|
|||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import io.jsonwebtoken.Claims;
|
|
||||||
import jakarta.persistence.ManyToMany;
|
import jakarta.persistence.ManyToMany;
|
||||||
import jakarta.persistence.ManyToOne;
|
import jakarta.persistence.ManyToOne;
|
||||||
import jakarta.persistence.OneToMany;
|
import jakarta.persistence.OneToMany;
|
||||||
import jakarta.persistence.OneToOne;
|
import jakarta.persistence.OneToOne;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import net.gepafin.tendermanagement.config.Translator;
|
|
||||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||||
import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException;
|
|
||||||
import org.apache.commons.collections4.MapUtils;
|
import org.apache.commons.collections4.MapUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
@@ -48,7 +44,6 @@ import net.gepafin.tendermanagement.web.rest.api.errors.FeignClientForbiddenExce
|
|||||||
import net.gepafin.tendermanagement.web.rest.api.errors.FeignClientNotFoundException;
|
import net.gepafin.tendermanagement.web.rest.api.errors.FeignClientNotFoundException;
|
||||||
import net.gepafin.tendermanagement.web.rest.api.errors.FeignClientUnauthorizedException;
|
import net.gepafin.tendermanagement.web.rest.api.errors.FeignClientUnauthorizedException;
|
||||||
import net.gepafin.tendermanagement.web.rest.api.errors.FeignClientValidationException;
|
import net.gepafin.tendermanagement.web.rest.api.errors.FeignClientValidationException;
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.mock.web.MockHttpServletRequest;
|
import org.springframework.mock.web.MockHttpServletRequest;
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
@@ -211,7 +206,7 @@ public class Utils {
|
|||||||
return new String(decodedBytes, StandardCharsets.UTF_8);
|
return new String(decodedBytes, StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String generateSecureToken() {
|
public static String generateSecureSamlToken() {
|
||||||
SecureRandom secureRandom = new SecureRandom();
|
SecureRandom secureRandom = new SecureRandom();
|
||||||
byte[] tokenBytes = new byte[24];
|
byte[] tokenBytes = new byte[24];
|
||||||
secureRandom.nextBytes(tokenBytes);
|
secureRandom.nextBytes(tokenBytes);
|
||||||
@@ -219,7 +214,14 @@ public class Utils {
|
|||||||
log.debug("Generated secure token: {}", token);
|
log.debug("Generated secure token: {}", token);
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
public static String generateSecureToken() {
|
||||||
|
SecureRandom secureRandom = new SecureRandom();
|
||||||
|
byte[] tokenBytes = new byte[5];
|
||||||
|
secureRandom.nextBytes(tokenBytes);
|
||||||
|
String token = Base64.getUrlEncoder().withoutPadding().encodeToString(tokenBytes);
|
||||||
|
log.debug("Generated secure token: {}", token);
|
||||||
|
return token;
|
||||||
|
}
|
||||||
public static Map<String, List<Object>> convertStringIntoMap(String jsonString) {
|
public static Map<String, List<Object>> convertStringIntoMap(String jsonString) {
|
||||||
try {
|
try {
|
||||||
return mapper.readValue(jsonString, new TypeReference<Map<String, List<Object>>>() {
|
return mapper.readValue(jsonString, new TypeReference<Map<String, List<Object>>>() {
|
||||||
@@ -691,4 +693,8 @@ public class Utils {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String createChannelForUserAndCompany(Long userId, Long companyId) {
|
||||||
|
return GepafinConstant.COMMON_SINGLE_CHANNEL_PREFIX + userId + GepafinConstant.COMPANY_PREFIX + companyId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ public interface CommunicationApi {
|
|||||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||||
@PostMapping(value = "/{amendmentId}", produces = { "application/json" })
|
@PostMapping(value = "/{amendmentId}", produces = { "application/json" })
|
||||||
@PreAuthorize("hasRole('ROLE_PRE_INSTRUCTOR') || hasRole('ROLE_BENEFICIARY')")
|
@PreAuthorize("hasRole('ROLE_PRE_INSTRUCTOR') || hasRole('ROLE_BENEFICIARY') || hasRole('ROLE_INSTRUCTOR_MANAGER')")
|
||||||
ResponseEntity<Response<CommunicationResponseBean>> addCommentToAmendmentRequest(HttpServletRequest request,
|
ResponseEntity<Response<CommunicationResponseBean>> addCommentToAmendmentRequest(HttpServletRequest request,
|
||||||
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @PathVariable(value = "amendmentId") Long amendmentId);
|
@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 = {
|
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||||
@PutMapping(value = "/{amendmentId}/{commentId}", produces = { "application/json" })
|
@PutMapping(value = "/{amendmentId}/{commentId}", produces = { "application/json" })
|
||||||
@PreAuthorize("hasRole('ROLE_PRE_INSTRUCTOR') || hasRole('ROLE_BENEFICIARY')")
|
@PreAuthorize("hasRole('ROLE_PRE_INSTRUCTOR') || hasRole('ROLE_BENEFICIARY') || hasRole('ROLE_INSTRUCTOR_MANAGER')")
|
||||||
ResponseEntity<Response<CommunicationResponseBean>> updateCommunicationAmendment(HttpServletRequest request,
|
ResponseEntity<Response<CommunicationResponseBean>> updateCommunicationAmendment(HttpServletRequest request,
|
||||||
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @PathVariable(value = "amendmentId") Long amendmentId, @PathVariable(value = "commentId") Long commentId);
|
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @PathVariable(value = "amendmentId") Long amendmentId, @PathVariable(value = "commentId") Long commentId);
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.web.rest.api;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import net.gepafin.tendermanagement.model.response.VatCheckResponseBean;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
@@ -94,7 +95,7 @@ public interface CompanyApi {
|
|||||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||||
@GetMapping(value = "/vatNumber", produces = { "application/json" })
|
@GetMapping(value = "/vatNumber", produces = { "application/json" })
|
||||||
ResponseEntity<Response<Map<String,Object>>> checkVatNumber(HttpServletRequest request,
|
ResponseEntity<Response<VatCheckResponseBean>> checkVatNumber(HttpServletRequest request,
|
||||||
@Parameter(description = "The vatNumber of company", required = true) @RequestParam("vatNumber") String vatNumber);
|
@Parameter(description = "The vatNumber of company", required = true) @RequestParam("vatNumber") String vatNumber);
|
||||||
|
|
||||||
@Operation(summary = "Api to download company delegation template", responses = { @ApiResponse(responseCode = "200", description = "OK"),
|
@Operation(summary = "Api to download company delegation template", responses = { @ApiResponse(responseCode = "200", description = "OK"),
|
||||||
|
|||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package net.gepafin.tendermanagement.web.rest.api;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
|
import io.swagger.v3.oas.annotations.media.ExampleObject;
|
||||||
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import net.gepafin.tendermanagement.enums.NotificationEnum;
|
||||||
|
import net.gepafin.tendermanagement.model.request.NotificationReq;
|
||||||
|
import net.gepafin.tendermanagement.model.response.NotificationResponse;
|
||||||
|
import net.gepafin.tendermanagement.model.util.Response;
|
||||||
|
import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface NotificationApi {
|
||||||
|
@Operation(summary = "Api to send notification.", 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 = "/user/{userId}/sent", consumes = "application/json", produces = "application/json")
|
||||||
|
ResponseEntity<Response<NotificationResponse>> sendNotification(HttpServletRequest request, @RequestBody NotificationReq notificationReq,
|
||||||
|
@Parameter(description = "The user id", required = true) @PathVariable("userId") Long userId,
|
||||||
|
@Parameter(description = "The company id", required = false) @RequestParam(value = "companyId", required = false) Long companyId);
|
||||||
|
|
||||||
|
@Operation(summary = "Api to get notification by id", 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) })) })
|
||||||
|
@GetMapping(value = "/{id}", produces = "application/json")
|
||||||
|
ResponseEntity<Response<NotificationResponse>> getNotificationById(HttpServletRequest request,
|
||||||
|
@Parameter(description = "The notification id", required = true) @PathVariable(value = "id", required = true) Long id);
|
||||||
|
|
||||||
|
@Operation(summary = "Api to get notification by user id", 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) })) })
|
||||||
|
@GetMapping(value = "/user/{userId}", produces = "application/json")
|
||||||
|
ResponseEntity<Response<List<NotificationResponse>>> getNotificationByUserId(HttpServletRequest request,
|
||||||
|
@Parameter(description = "The user id", required = true) @PathVariable(value = "userId", required = true) Long userId,
|
||||||
|
@Parameter(description = "The company id", required = false) @RequestParam(value = "companyId", required = false) Long companyId,
|
||||||
|
@Parameter(description = "The notification status", required = false) @RequestParam(value = "status", required = false) List<NotificationEnum> statuses);
|
||||||
|
|
||||||
|
@Operation(summary = "Api to update notification status", 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) })) })
|
||||||
|
@PutMapping(value = "/{id}", produces = "application/json")
|
||||||
|
ResponseEntity<Response<NotificationResponse>> updateNotificationStatus(HttpServletRequest request,
|
||||||
|
@Parameter(description = "The notification id", required = true) @PathVariable(value = "id", required = true) Long id,
|
||||||
|
@Parameter(description = "The notification status", required = true) @RequestParam(value = "status", required = true) NotificationEnum status);
|
||||||
|
|
||||||
|
@Operation(summary = "Api to delete notification", 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) })) })
|
||||||
|
@DeleteMapping(value = "/{id}", produces = "application/json")
|
||||||
|
ResponseEntity<Response<Void>> deleteNotification(HttpServletRequest request,
|
||||||
|
@Parameter(description = "The notification id", required = true) @PathVariable(value = "id", required = true) Long id);
|
||||||
|
|
||||||
|
@Operation(summary = "API to get notifications by user ID and company ID", 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) })) })
|
||||||
|
@GetMapping(value = "/user/{userId}/company/{companyId}/notifications", produces = "application/json")
|
||||||
|
ResponseEntity<Response<List<NotificationResponse>>> getNotificationsByUserIdAndCompanyId(HttpServletRequest request,
|
||||||
|
@Parameter(description = "The user id", required = true) @PathVariable(value = "userId") Long userId,
|
||||||
|
@Parameter(description = "The company ID", required = true) @PathVariable(value = "companyId") Long companyId,
|
||||||
|
@Parameter(description = "The notification status", required = false) @RequestParam(value = "status", required = false) List<NotificationEnum> statuses);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -59,6 +59,7 @@ public interface UserApi {
|
|||||||
@RequestMapping(value = "/{userId}",
|
@RequestMapping(value = "/{userId}",
|
||||||
produces = {"application/json"},
|
produces = {"application/json"},
|
||||||
method = RequestMethod.PUT)
|
method = RequestMethod.PUT)
|
||||||
|
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN')")
|
||||||
default ResponseEntity<Response<UserResponseBean>> updateUser(HttpServletRequest request,
|
default ResponseEntity<Response<UserResponseBean>> updateUser(HttpServletRequest request,
|
||||||
@Parameter(description = "The user id", required = true) @PathVariable("userId") Long userId,
|
@Parameter(description = "The user id", required = true) @PathVariable("userId") Long userId,
|
||||||
@Parameter(description = "User request object", required = true) @Valid @RequestBody UpdateUserReq userReq) {
|
@Parameter(description = "User request object", required = true) @Valid @RequestBody UpdateUserReq userReq) {
|
||||||
@@ -118,7 +119,7 @@ public interface UserApi {
|
|||||||
@RequestMapping(value = "/reset-password/initiate",
|
@RequestMapping(value = "/reset-password/initiate",
|
||||||
produces = {"application/json"},
|
produces = {"application/json"},
|
||||||
method = RequestMethod.POST)
|
method = RequestMethod.POST)
|
||||||
ResponseEntity<Response<String>> initiatePasswordReset(
|
ResponseEntity<Response<Void>> initiatePasswordReset(HttpServletRequest request,
|
||||||
@Parameter(description = "Initiate password reset request object", required = true) @Valid @RequestBody InitiatePasswordResetReq initiatePasswordResetReq);
|
@Parameter(description = "Initiate password reset request object", required = true) @Valid @RequestBody InitiatePasswordResetReq initiatePasswordResetReq);
|
||||||
|
|
||||||
@Operation(summary = "Api to reset password",
|
@Operation(summary = "Api to reset password",
|
||||||
@@ -131,7 +132,7 @@ public interface UserApi {
|
|||||||
@RequestMapping(value = "/reset-password",
|
@RequestMapping(value = "/reset-password",
|
||||||
produces = {"application/json"},
|
produces = {"application/json"},
|
||||||
method = RequestMethod.POST)
|
method = RequestMethod.POST)
|
||||||
ResponseEntity<Response<Boolean>> resetPassword(
|
ResponseEntity<Response<Boolean>> resetPassword(HttpServletRequest request,
|
||||||
@Parameter(description = "Reset password request object", required = true) @Valid @RequestBody ResetPasswordReq resetPasswordReq);
|
@Parameter(description = "Reset password request object", required = true) @Valid @RequestBody ResetPasswordReq resetPasswordReq);
|
||||||
@Operation(summary = "Api to change user password",
|
@Operation(summary = "Api to change user password",
|
||||||
responses = {
|
responses = {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.util.Map;
|
|||||||
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
||||||
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
||||||
import net.gepafin.tendermanagement.model.request.UserActionRequest;
|
import net.gepafin.tendermanagement.model.request.UserActionRequest;
|
||||||
|
import net.gepafin.tendermanagement.model.response.VatCheckResponseBean;
|
||||||
import net.gepafin.tendermanagement.util.LoggingUtil;
|
import net.gepafin.tendermanagement.util.LoggingUtil;
|
||||||
import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException;
|
import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -112,15 +113,15 @@ public class CompanyApiController implements CompanyApi{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Response<Map<String,Object>>> checkVatNumber(HttpServletRequest request, String vatNumber) {
|
public ResponseEntity<Response<VatCheckResponseBean>> checkVatNumber(HttpServletRequest request, String vatNumber) {
|
||||||
log.info("check VatNumber with: {}", vatNumber);
|
log.info("check VatNumber with: {}", vatNumber);
|
||||||
|
|
||||||
/** This code is responsible for creating user action logs for the "Check vat number" operation. **/
|
/** This code is responsible for creating user action logs for the "Check vat number" operation. **/
|
||||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.CHECK_COMPANY_VAT_NUMBER).build());
|
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.CHECK_COMPANY_VAT_NUMBER).build());
|
||||||
|
|
||||||
Map<String,Object> data = companyService.checkVatNumber(request, vatNumber);
|
VatCheckResponseBean vatCheckResponseBean = companyService.checkVatNumber(request, vatNumber);
|
||||||
return ResponseEntity.status(HttpStatus.OK)
|
return ResponseEntity.status(HttpStatus.OK)
|
||||||
.body(new Response<>(data, Status.SUCCESS, Translator.toLocale(GepafinConstant.CHECK_VATNUMBER_SUCCESS_MSG)));
|
.body(new Response<>(vatCheckResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.CHECK_VATNUMBER_SUCCESS_MSG)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package net.gepafin.tendermanagement.web.rest.api.impl;
|
|||||||
|
|
||||||
import net.gepafin.tendermanagement.entities.RoleEntity;
|
import net.gepafin.tendermanagement.entities.RoleEntity;
|
||||||
import net.gepafin.tendermanagement.entities.UserEntity;
|
import net.gepafin.tendermanagement.entities.UserEntity;
|
||||||
|
import net.gepafin.tendermanagement.enums.RoleStatusEnum;
|
||||||
import net.gepafin.tendermanagement.repositories.UserRepository;
|
import net.gepafin.tendermanagement.repositories.UserRepository;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -35,7 +36,10 @@ public class CustomUserDetailsService implements UserDetailsService {
|
|||||||
String email = loginParts[0];
|
String email = loginParts[0];
|
||||||
String hubId = loginParts[1];
|
String hubId = loginParts[1];
|
||||||
|
|
||||||
UserEntity user = userRepository.findByEmailIgnoreCaseAndHubUniqueUuid(email, hubId)
|
UserEntity user = userRepository.findUserExcludingRoleType(
|
||||||
|
email,
|
||||||
|
hubId,
|
||||||
|
RoleStatusEnum.ROLE_BENEFICIARY.getValue())
|
||||||
.orElseThrow(
|
.orElseThrow(
|
||||||
() -> new UsernameNotFoundException("User " + email + " was not found in the database"));
|
() -> new UsernameNotFoundException("User " + email + " was not found in the database"));
|
||||||
return createSpringSecurityUser(user);
|
return createSpringSecurityUser(user);
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package net.gepafin.tendermanagement.web.rest.api.impl;
|
||||||
|
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import net.gepafin.tendermanagement.config.Translator;
|
||||||
|
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||||
|
import net.gepafin.tendermanagement.enums.NotificationEnum;
|
||||||
|
import net.gepafin.tendermanagement.model.request.NotificationReq;
|
||||||
|
import net.gepafin.tendermanagement.model.response.NotificationResponse;
|
||||||
|
import net.gepafin.tendermanagement.model.util.Response;
|
||||||
|
import net.gepafin.tendermanagement.service.NotificationService;
|
||||||
|
import net.gepafin.tendermanagement.web.rest.api.NotificationApi;
|
||||||
|
import net.gepafin.tendermanagement.web.rest.api.errors.Status;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("${openapi.gepafin.base-path:/v1/notification}")
|
||||||
|
public class NotificationApiController implements NotificationApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NotificationService notificationService;
|
||||||
|
|
||||||
|
public ResponseEntity<Response<NotificationResponse>> sendNotification(HttpServletRequest request, NotificationReq notificationReq, Long userId, Long companyId) {
|
||||||
|
|
||||||
|
NotificationResponse notificationData = notificationService.sendNotification(userId, notificationReq, companyId);
|
||||||
|
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(new Response<>(notificationData, Status.SUCCESS, Translator.toLocale(GepafinConstant.NOTIFICATION_SENT_SUCCESSFULLY)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Response<NotificationResponse>> getNotificationById(HttpServletRequest request, Long id) {
|
||||||
|
|
||||||
|
NotificationResponse notificationResponse = notificationService.getNotificationById(request, id);
|
||||||
|
return ResponseEntity.status(HttpStatus.OK)
|
||||||
|
.body(new Response<>(notificationResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.NOTIFICATION_FETCHED_SUCCESSFULLY)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Response<List<NotificationResponse>>> getNotificationByUserId(HttpServletRequest request, Long userId, Long companyId, List<NotificationEnum> statuses) {
|
||||||
|
|
||||||
|
List<NotificationResponse> notificationResponses = notificationService.getNotificationByUserId(request, userId, companyId, statuses);
|
||||||
|
return ResponseEntity.status(HttpStatus.OK)
|
||||||
|
.body(new Response<List<NotificationResponse>>(notificationResponses, Status.SUCCESS, Translator.toLocale(GepafinConstant.NOTIFICATION_FETCHED_SUCCESSFULLY)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Response<NotificationResponse>> updateNotificationStatus(HttpServletRequest request, Long id, NotificationEnum notificationEnums) {
|
||||||
|
|
||||||
|
NotificationResponse notificationResponse = notificationService.updateNotificationStatus(request, id, notificationEnums);
|
||||||
|
return ResponseEntity.status(HttpStatus.OK)
|
||||||
|
.body(new Response<>(notificationResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.NOTIFICATION_UPDATED_SUCCESSFULLY)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Response<Void>> deleteNotification(HttpServletRequest request, Long id) {
|
||||||
|
|
||||||
|
notificationService.deleteNotification(request, id);
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.NOTIFICATION_DELETED_SUCCESSFULLY)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Response<List<NotificationResponse>>> getNotificationsByUserIdAndCompanyId(HttpServletRequest request,Long userId, Long companyId, List<NotificationEnum> statuses) {
|
||||||
|
List<NotificationResponse> notificationResponses = notificationService.getNotificationsByCompanyIdAndUserId(userId, companyId, statuses);
|
||||||
|
return ResponseEntity.status(HttpStatus.OK)
|
||||||
|
.body(new Response<>(notificationResponses, Status.SUCCESS, Translator.toLocale(GepafinConstant.NOTIFICATION_FETCHED_SUCCESSFULLY)));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -125,20 +125,35 @@ public class UserApiController implements UserApi {
|
|||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Response<Boolean>> changePassword(HttpServletRequest httpServletRequest, @Valid @RequestBody ChangePasswordRequest request) {
|
public ResponseEntity<Response<Boolean>> changePassword(HttpServletRequest httpServletRequest, @Valid @RequestBody ChangePasswordRequest request) {
|
||||||
log.info("Change Password attempt for email: {}", request.getEmail());
|
log.info("Change Password attempt for email: {}", request.getEmail());
|
||||||
|
|
||||||
|
/** This code is responsible for "Change user password" operation. **/
|
||||||
|
loggingUtil.logUserAction(UserActionRequest.builder().request(httpServletRequest).actionType(UserActionLogsEnum.UPDATE)
|
||||||
|
.actionContext(UserActionContextEnum.CHANGE_USER_PASSWORD).build());
|
||||||
|
|
||||||
userService.changePassword(httpServletRequest, request);
|
userService.changePassword(httpServletRequest, request);
|
||||||
return ResponseEntity.ok(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.SUCCESS_PASSWORD_CHANGED)));
|
return ResponseEntity.ok(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.SUCCESS_PASSWORD_CHANGED)));
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Response<String>> initiatePasswordReset(InitiatePasswordResetReq request) {
|
public ResponseEntity<Response<Void>> initiatePasswordReset(HttpServletRequest httpServletRequest,InitiatePasswordResetReq request) {
|
||||||
log.info("Initiating password reset for email: {}", request.getEmail());
|
log.info("Initiating password reset for email: {}", request.getEmail());
|
||||||
String resetToken = userService.initiatePasswordReset(request);
|
|
||||||
|
/** This code is responsible for "Initiating Password Reset Request" operation. **/
|
||||||
|
loggingUtil.logUserAction(UserActionRequest.builder().request(httpServletRequest).actionType(UserActionLogsEnum.UPDATE)
|
||||||
|
.actionContext(UserActionContextEnum.INITIATE_PASSWORD_RESET_REQUEST).build());
|
||||||
|
|
||||||
|
userService.initiatePasswordReset(request);
|
||||||
log.info("Password reset token generated for email: {}", request.getEmail());
|
log.info("Password reset token generated for email: {}", request.getEmail());
|
||||||
return ResponseEntity.ok(new Response<>(resetToken, Status.SUCCESS, Translator.toLocale(GepafinConstant.RESET_PASSWORD_INITIATED)));
|
return ResponseEntity.ok(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.RESET_PASSWORD_INITIATED)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Response<Boolean>> resetPassword(ResetPasswordReq request) {
|
public ResponseEntity<Response<Boolean>> resetPassword(HttpServletRequest httpServletRequest,ResetPasswordReq request) {
|
||||||
log.info("Resetting password for username: {}", request.getEmail());
|
log.info("Resetting password for username: {}", request.getEmail());
|
||||||
|
|
||||||
|
/** This code is responsible for "Resest user password" operation. **/
|
||||||
|
loggingUtil.logUserAction(UserActionRequest.builder().request(httpServletRequest).actionType(UserActionLogsEnum.UPDATE)
|
||||||
|
.actionContext(UserActionContextEnum.RESET_USER_PASSWORD).build());
|
||||||
|
|
||||||
Boolean success = userService.resetPassword(request);
|
Boolean success = userService.resetPassword(request);
|
||||||
if (success) {
|
if (success) {
|
||||||
log.info("Password reset successfully for username: {}", request.getEmail());
|
log.info("Password reset successfully for username: {}", request.getEmail());
|
||||||
|
|||||||
@@ -23,3 +23,11 @@ appointment.portal.password=u13nzaAP1P0rtal
|
|||||||
appointment.portal.source=GEPAFINPORTAL
|
appointment.portal.source=GEPAFINPORTAL
|
||||||
appointment.portal.context=GEPAFINPORTAL
|
appointment.portal.context=GEPAFINPORTAL
|
||||||
flagDaFirmare=false
|
flagDaFirmare=false
|
||||||
|
|
||||||
|
# RabbitMQ properties for STOMP broker relay for Notification
|
||||||
|
#spring.rabbitmq.host=rabbitmq.bflows.ai
|
||||||
|
spring.rabbitmq.host=172.18.0.7
|
||||||
|
spring.rabbitmq.port=61613
|
||||||
|
spring.rabbitmq.username=guest
|
||||||
|
spring.rabbitmq.password=guest
|
||||||
|
spring.rabbitmq.virtual-host=/
|
||||||
@@ -21,3 +21,10 @@ appointment.portal.password=u13nzaAP1P0rtal
|
|||||||
appointment.portal.source=GEPAFINPORTAL
|
appointment.portal.source=GEPAFINPORTAL
|
||||||
appointment.portal.context=GEPAFINPORTAL
|
appointment.portal.context=GEPAFINPORTAL
|
||||||
flagDaFirmare=false
|
flagDaFirmare=false
|
||||||
|
|
||||||
|
# RabbitMQ properties for STOMP broker relay for Notification
|
||||||
|
spring.rabbitmq.host=localhost
|
||||||
|
spring.rabbitmq.port=61613
|
||||||
|
spring.rabbitmq.username=guest
|
||||||
|
spring.rabbitmq.password=guest
|
||||||
|
spring.rabbitmq.virtual-host=/
|
||||||
@@ -29,4 +29,11 @@ appointment.portal.user=UtenzaAPIPortal@621
|
|||||||
appointment.portal.password=u13nzaAP1P0rtal
|
appointment.portal.password=u13nzaAP1P0rtal
|
||||||
appointment.portal.source=GEPAFINPORTAL
|
appointment.portal.source=GEPAFINPORTAL
|
||||||
appointment.portal.context=GEPAFINPORTAL
|
appointment.portal.context=GEPAFINPORTAL
|
||||||
flagDaFirmare=false
|
flagDaFirmare=true
|
||||||
|
|
||||||
|
# RabbitMQ properties for STOMP broker relay for Notification
|
||||||
|
spring.rabbitmq.host=rabbitmq.bflows.ai
|
||||||
|
spring.rabbitmq.port=61613
|
||||||
|
spring.rabbitmq.username=guest
|
||||||
|
spring.rabbitmq.password=guest
|
||||||
|
spring.rabbitmq.virtual-host=/
|
||||||
@@ -12,3 +12,17 @@ gepafin_email=test@test.test
|
|||||||
rinaldo_email=test@test.test
|
rinaldo_email=test@test.test
|
||||||
carlo_email=test@test.test
|
carlo_email=test@test.test
|
||||||
default.hub.uuid=p4lk3bcx1RStqTaIVVbXs
|
default.hub.uuid=p4lk3bcx1RStqTaIVVbXs
|
||||||
|
|
||||||
|
appointment.base.url=https://demo.galileonetwork.it/gateway/rest
|
||||||
|
appointment.portal.user=UtenzaAPIPortal@621
|
||||||
|
appointment.portal.password=u13nzaAP1P0rtal
|
||||||
|
appointment.portal.source=GEPAFINPORTAL
|
||||||
|
appointment.portal.context=GEPAFINPORTAL
|
||||||
|
flagDaFirmare=false
|
||||||
|
|
||||||
|
# RabbitMQ properties for STOMP broker relay for Notification
|
||||||
|
spring.rabbitmq.host=rabbitmq.bflows.ai
|
||||||
|
spring.rabbitmq.port=61613
|
||||||
|
spring.rabbitmq.username=guest
|
||||||
|
spring.rabbitmq.password=guest
|
||||||
|
spring.rabbitmq.virtual-host=/
|
||||||
@@ -68,3 +68,4 @@ default.hub.pdf.banner=https://mementoresources.s3.amazonaws.com/gepafin/staging
|
|||||||
#feign client config
|
#feign client config
|
||||||
spring.cloud.openfeign.client.config.default.connectTimeout=300000
|
spring.cloud.openfeign.client.config.default.connectTimeout=300000
|
||||||
spring.cloud.openfeign.client.config.default.readTimeout=300000
|
spring.cloud.openfeign.client.config.default.readTimeout=300000
|
||||||
|
spring.rabbitmq.connection-timeout=120000
|
||||||
@@ -1961,7 +1961,17 @@
|
|||||||
</column>
|
</column>
|
||||||
</addColumn>
|
</addColumn>
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
<changeSet id="02-12-2024_1" 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_user_28_11_2024.sql"/>
|
||||||
|
<sqlFile dbms="postgresql"
|
||||||
|
path="db/dump/insert_system_email_template_for_reset_password_28_11_2024.sql"/>
|
||||||
|
</changeSet>
|
||||||
<changeSet id="03-12-2024_1" author="Piyush">
|
<changeSet id="03-12-2024_1" author="Piyush">
|
||||||
<sqlFile dbms="postgresql"
|
<sqlFile dbms="postgresql"
|
||||||
path="db/dump/update_system_email_template_for_updating_amendment_mail_notification_mail_03_12_2024_1.sql"/>
|
path="db/dump/update_system_email_template_for_updating_amendment_mail_notification_mail_03_12_2024_1.sql"/>
|
||||||
@@ -1971,6 +1981,19 @@
|
|||||||
<sqlFile dbms="postgresql"
|
<sqlFile dbms="postgresql"
|
||||||
path="db/dump/update_system_email_template_for_updating_amendment_mail_notification_mail_04_12_2024_1.sql"/>
|
path="db/dump/update_system_email_template_for_updating_amendment_mail_notification_mail_04_12_2024_1.sql"/>
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
<!-- <changeSet id="19-12-2024_1" author="Nisha Kashyap">-->
|
||||||
|
<!-- <addColumn tableName="USER_WITH_COMPANY">-->
|
||||||
|
<!-- <column name="contact_name" type="VARCHAR(255)"/>-->
|
||||||
|
<!-- <column name="contact_email" type="VARCHAR(255)"/>-->
|
||||||
|
<!-- <column name="PEC" type="VARCHAR(255)"/>-->
|
||||||
|
<!-- <column name="EMAIL" type="VARCHAR(255)"/>-->
|
||||||
|
<!-- <column name="JSON" type="TEXT"/>-->
|
||||||
|
<!-- </addColumn>-->
|
||||||
|
<!-- <dropColumn tableName="COMPANY" columnName="contact_name"/>-->
|
||||||
|
<!-- <dropColumn tableName="COMPANY" columnName="contact_email"/>-->
|
||||||
|
<!-- <dropColumn tableName="COMPANY" columnName="PEC"/>-->
|
||||||
|
<!-- <dropColumn tableName="COMPANY" columnName="EMAIL"/>-->
|
||||||
|
<!--</changeSet>-->
|
||||||
|
|
||||||
<changeSet id="04-12-2024_3" author="Piyush">
|
<changeSet id="04-12-2024_3" author="Piyush">
|
||||||
<addColumn tableName="hub">
|
<addColumn tableName="hub">
|
||||||
@@ -2074,4 +2097,70 @@
|
|||||||
<column name="ACTIVE_DAYS" type="INTEGER"></column>
|
<column name="ACTIVE_DAYS" type="INTEGER"></column>
|
||||||
</addColumn>
|
</addColumn>
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="13-12-2024_1" author="Piyush Kag">
|
||||||
|
<createTable tableName="notification">
|
||||||
|
<column autoIncrement="true" name="id" type="INTEGER">
|
||||||
|
<constraints nullable="false" primaryKey="true"
|
||||||
|
primaryKeyName="pk_notification"/>
|
||||||
|
</column>
|
||||||
|
<column name="message" type="TEXT"/>
|
||||||
|
<column name="status" type="TEXT"/>
|
||||||
|
<column name="notification_type" type="TEXT"/>
|
||||||
|
<column name="is_deleted" type="BOOLEAN" defaultValueBoolean="false"/>
|
||||||
|
<column name="user_id" type="INTEGER"/>
|
||||||
|
<column name="redirect_link" type="TEXT"/>
|
||||||
|
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
|
||||||
|
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
|
||||||
|
</createTable>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="13-12-2024_2" author="Piyush Kag">
|
||||||
|
<createTable tableName="notification_type">
|
||||||
|
<column autoIncrement="true" name="id" type="INTEGER">
|
||||||
|
<constraints nullable="false" primaryKey="true"
|
||||||
|
primaryKeyName="pk_notification_type"/>
|
||||||
|
</column>
|
||||||
|
<column name="notification_name" type="TEXT"/>
|
||||||
|
<column name="title" type="TEXT"/>
|
||||||
|
<column name="json_template" type="TEXT"/>
|
||||||
|
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
|
||||||
|
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
|
||||||
|
<column name="is_deleted" type="BOOLEAN" defaultValueBoolean="false">
|
||||||
|
<constraints nullable="false"/>
|
||||||
|
</column>
|
||||||
|
</createTable>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="13-12-2024_4" author="Piyush Kag">
|
||||||
|
<sqlFile dbms="postgresql"
|
||||||
|
path="db/dump/insert_json_template_for_notification_13_12_2024.sql"/>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="23-12-2024_1" author="Piyush Kag">
|
||||||
|
<addColumn tableName="notification">
|
||||||
|
<column name="USER_WITH_COMPANY_ID" type="INTEGER">
|
||||||
|
<constraints nullable="true" foreignKeyName="fk_USER_WITH_COMPANY_NOTIFICATION" references="user_with_company(id)"/>
|
||||||
|
</column>
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="23-12-2024_2" author="Piyush Kag">
|
||||||
|
<addColumn tableName="notification">
|
||||||
|
<column name="title" type="TEXT"/>
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="31-12-2024" author="Piyush Kag">
|
||||||
|
<sqlFile dbms="postgresql"
|
||||||
|
path="db/dump/update_json_template_for_notification_31_12_2024.sql"/>
|
||||||
|
</changeSet>
|
||||||
|
<changeSet id="03-01-2024_NK_125210" author="Nisha Kashyap">
|
||||||
|
<sql>
|
||||||
|
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
|
||||||
|
</sql>
|
||||||
|
<sqlFile dbms="postgresql"
|
||||||
|
path="db/dump/update_form_field_data_03_01_2025.sql"/>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
INSERT INTO notification_type (notification_name,title, json_template,created_date,updated_date,is_deleted) VALUES
|
||||||
|
('CALL_CREATED', 'Un Nuovo Bando È Stato Pubblicato','Un nuovo bando intitolato {{call_name}} è stato pubblicato. Controllalo e invia le candidature prima della scadenza.','2024-12-19T10:16:26.472Z','2024-12-19T10:16:26.472Z','false'),
|
||||||
|
('APPLICATION_SUBMISSION','Candidatura Inviata con Successo per la Valutazione', 'La richiesta per {{call_name}} ai sensi del protocollo n. {{protocol_number}} è stata presentata con successo. È ora in fase di valutazione.','2024-12-19T10:16:26.472Z','2024-12-19T10:16:26.472Z','false'),
|
||||||
|
('AMENDMENT_CREATION','È Stato Creato un Emendamento per la Richiesta', 'È stato creato un emendamento per la richiesta in {{call_name}} ai sensi del protocollo n. {{protocol_number}}. Esamina le modifiche e procedi di conseguenza.','2024-12-19T10:16:26.472Z','2024-12-19T10:16:26.472Z','false'),
|
||||||
|
('EVALUATION_RESULT','Il Risultato della Valutazione per la Richiesta È Disponibile','Il risultato della valutazione per la richiesta ai sensi del protocollo n. {{protocol_number}} è ora disponibile.','2024-12-19T10:16:26.472Z','2024-12-19T10:16:26.472Z','false'),
|
||||||
|
('AMENDMENT_EXPIRED','L Emendamento per la Richiesta È Scaduto', 'L’emendamento per la richiesta in {{call_name}} ai sensi del protocollo n. {{protocol_number}} è scaduto.','2024-12-19T10:16:26.472Z','2024-12-19T10:16:26.472Z','false'),
|
||||||
|
('AMENDMENT_CLOSED','L Emendamento È Stato Chiuso ed È Ora Inattivo','L’emendamento per {{call_name}} ai sensi del protocollo n. {{protocol_number}} è stato chiuso ed è ora inattivo.','2024-12-19T10:16:26.472Z','2024-12-19T10:16:26.472Z','false'),
|
||||||
|
('NDG_GENERATION','È Stato Generato un Nuovo NDG per la Richiesta','È stato generato un nuovo NDG per {{call_name}} ai sensi del protocollo n. {{protocol_number}}.','2024-12-19T10:16:26.472Z','2024-12-19T10:16:26.472Z','false'),
|
||||||
|
('EVALUATION_CREATION','La Richiesta È Stata Assegnata per la Valutazione','La richiesta in {{call_name}} ai sensi del protocollo n. {{protocol_number}} è stata assegnata alla fase di valutazione.','2024-12-19T10:16:26.472Z','2024-12-19T10:16:26.472Z','false'),
|
||||||
|
('EVALUATION_EXPIRED','La Valutazione per la Richiesta È Scaduta','La valutazione per la richiesta in {{call_name}} ai sensi del protocollo n. {{protocol_number}} è scaduta.','2024-12-19T10:16:26.472Z','2024-12-19T10:16:26.472Z','false');
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
INSERT INTO gepafin_schema.system_email_template
|
||||||
|
(template_name, "type", html_content, subject, "json", "system", is_deleted, created_date, updated_date,email_scenario)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'Password Reset Link Email (Italian)',
|
||||||
|
'PASSWORD_RESET',
|
||||||
|
'<table border="0" style="background: #f5f5f5; text-align: center; width: 100%; max-width: 600px; padding: 20px;" align="center" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<p style="font-weight: 600; color: #000; font-family: open sans; font-size: 26px; margin: 0; padding-bottom: 20px;">Richiesta di Reimpostazione Password</p>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody align="left">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p style="margin: 8px 0px;">Gentile {{user_name}},</p>
|
||||||
|
<p style="margin: 8px 0px;">Hai richiesto di reimpostare la tua password.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p style="margin: 8px 0px;">Cordiali saluti,</p>
|
||||||
|
<p style="margin: 8px 0px;"><strong>{{email_signature}}</strong></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="padding-top: 20px;">
|
||||||
|
<!-- Button added here -->
|
||||||
|
<a href="{{reset_password_link}}" style="background-color: #007bff;
|
||||||
|
color: #fff;
|
||||||
|
font-family: open sans;
|
||||||
|
border-radius: 5px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 280px;
|
||||||
|
padding: 12px 25px;">Reimposta la Password</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>',
|
||||||
|
'Richiesta di Reimpostazione Password',
|
||||||
|
NULL,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
CURRENT_TIMESTAMP,
|
||||||
|
CURRENT_TIMESTAMP,
|
||||||
|
'PASSWORD_RESET_REQUEST');
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
INSERT INTO gepafin_schema.system_email_template
|
||||||
|
(template_name, "type", html_content, subject, "json", "system", is_deleted, created_date, updated_date, email_scenario)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'Welcome Email for New User',
|
||||||
|
'USER_ONBOARDING',
|
||||||
|
'<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>Benvenuto!</strong></p>
|
||||||
|
<p>Ciao {{user_name}},</p>
|
||||||
|
<p>Siamo lieti di averti con noi. Di seguito trovi alcune informazioni utili:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Nome Utente:</strong> {{user_email}}</li>
|
||||||
|
</ul>
|
||||||
|
<p>Per accedere, utilizza il tuo indirizzo email registrato. Se hai bisogno di supporto, non esitare a contattarci.</p>
|
||||||
|
<p>Distinti saluti,</p>
|
||||||
|
<p><strong>{{email_signature}}</strong></p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>',
|
||||||
|
'Welcome - {{user_name}}',
|
||||||
|
NULL,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
CURRENT_TIMESTAMP,
|
||||||
|
CURRENT_TIMESTAMP,
|
||||||
|
'USER_CREATION'
|
||||||
|
);
|
||||||
101
src/main/resources/db/dump/update_form_field_data_03_01_2025.sql
Normal file
101
src/main/resources/db/dump/update_form_field_data_03_01_2025.sql
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
INSERT INTO FORM_FIELD (SORT_ORDER, NAME, LABEL, DESCRIPTION, SETTINGS, VALIDATORS, CREATED_DATE, UPDATED_DATE)
|
||||||
|
VALUES
|
||||||
|
(1, 'textinput', 'Testo Breve', 'Per risposte concise (nomi, titoli, brevi descrizioni)',
|
||||||
|
'[{"name": "label", "value": "Testo Breve"}, {"name": "placeholder", "value": ""}]',
|
||||||
|
'{"isRequired": false, "minLength": null, "maxLength": null, "pattern": null, "custom": null}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(2, 'textarea', 'Testo Lungo', 'Campo di testo esteso per paragrafi, descrizioni, proposte',
|
||||||
|
'[{"name": "label", "value": "Testo Lungo"}, {"name": "placeholder", "value": ""}]',
|
||||||
|
'{"isRequired": false, "minLength": null, "maxLength": null, "pattern": null, "custom": null}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(3, 'wysiwyg', 'Campo di Testo Formattato', 'Editor avanzato per testo con formattazione',
|
||||||
|
'[{"name": "label", "value": "Testo Formattato"}, {"name": "placeholder", "value": ""}]',
|
||||||
|
'{"isRequired": false, "minLength": null, "maxLength": null, "pattern": null, "custom": null}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(4, 'numberinput', 'Campo Numerico', 'Per l''inserimento di valori numerici (quantità, importi, percentuali)',
|
||||||
|
'[{"name": "label", "value": "Numero"}, {"name": "placeholder", "value": "0"}, {"name": "step", "value": "0"},{"name": "isRequestedAmount","value": false}]',
|
||||||
|
'{"isRequired": false, "min": null, "max": null, "pattern": null, "custom": null}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(5, 'radio', 'Scelta Singola', 'Gruppo di opzioni per selezione singola',
|
||||||
|
'[{"name": "label", "value": "Scelta Singola"}, {"name": "options", "value": []}]',
|
||||||
|
'{"isRequired": false, "custom": null}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(6, 'select', 'Menu a Tendina', 'Selezione da opzioni predefinite',
|
||||||
|
'[{"name": "label", "value": "Menu a Tendina"}, {"name": "options", "value": []}]',
|
||||||
|
'{"isRequired": false, "custom": null}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(7, 'checkboxes', 'Scelta Multipla', 'Gruppo di opzioni per selezione singola o multipla',
|
||||||
|
'[{"name": "label", "value": "Scelta Multipla"}, {"name": "options", "value": []}]',
|
||||||
|
'{"isRequired": false, "min": null, "max": null, "custom": null}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(8, 'switch', 'Casella di Spunta', 'Per selezioni binarie, accettazioni, conferme',
|
||||||
|
'[{"name": "label", "value": "Casella di Spunta"}]',
|
||||||
|
'{"isRequired": false}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(9, 'datepicker', 'Data', 'Selezione di data',
|
||||||
|
'[{"name": "label", "value": "Data"}]',
|
||||||
|
'{"isRequired": false}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(10, 'fileupload', 'Caricamento File', 'Per l''upload di documenti o immagini',
|
||||||
|
'[{"name": "label", "value": "Caricamento File"}, {"name": "mime", "value": []}]',
|
||||||
|
'{"isRequired": false, "maxSize": 100000}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(11, 'textinput', 'Campo Partita IVA', 'Specifico per l''inserimento del numero di Partita IVA',
|
||||||
|
'[{"name": "label", "value": "Partita IVA"}, {"name": "placeholder", "value": ""}]',
|
||||||
|
'{"isRequired": true, "custom": "isPIVA"}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(12, 'textinput', 'Campo Codice Fiscale','Specifico per l''inserimento del Codice Fiscale italiano per persone fisiche e giuridiche',
|
||||||
|
'[{"name": "label", "value": "Codice Fiscale"}, {"name": "placeholder", "value": ""}]',
|
||||||
|
'{"isRequired": true, "custom": "isCodiceFiscale"}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(13, 'textinput', 'Campo CAP','Per l''inserimento del Codice di Avviamento Postale',
|
||||||
|
'[{"name": "label", "value": "CAP"}, {"name": "placeholder", "value": ""}]',
|
||||||
|
'{"isRequired": true, "custom": "isCAP"}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(14, 'textinput', 'Campo IBAN', 'Per l''inserimento del codice IBAN',
|
||||||
|
'[{"name": "label", "value": "IBAN"}, {"name": "placeholder", "value": ""}]',
|
||||||
|
'{"isRequired": true, "custom": "isIBAN"}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(15, 'textinput', 'Campo Email', 'Per l''inserimento di indirizzi email standard (non PEC)',
|
||||||
|
'[{"name": "label", "value": "Campo Email"}, {"name": "placeholder", "value": "nome@esempio.it"}]',
|
||||||
|
'{"isRequired": false, "custom": "isEmail"}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(16, 'textinput', 'Campo PEC', 'Specifico per l''inserimento di un indirizzo di Posta Elettronica Certificata',
|
||||||
|
'[{"name": "label", "value": "Campo PEC"}, {"name": "placeholder", "value": "nome@pec.it"}]',
|
||||||
|
'{"isRequired": false, "custom": "isEmailPEC"}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(17, 'textinput', 'Campo URL', 'Per l''inserimento di indirizzi web',
|
||||||
|
'[{"name": "label", "value": "Indirizzo URL"}, {"name": "placeholder", "value": ""}]',
|
||||||
|
'{"isRequired": false, "custom": "isUrl"}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(18, 'textinput', 'Marca da bollo', 'Per inserire codice di marca da bollo',
|
||||||
|
'[{"name": "label", "value": "Marca da bollo"}, {"name": "placeholder", "value": "Numero identificativo"}]',
|
||||||
|
'{"isRequired": false, "custom": "isMarcaDaBollo"}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(19, 'paragraph', 'Paragrafo', 'Semplice testo formattato',
|
||||||
|
'[{"name": "text", "value": ""}]',
|
||||||
|
'{}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||||
|
|
||||||
|
(20, 'table', 'Tabella', 'Tabella',
|
||||||
|
'[{"name": "label", "value": "Tabella"}, {"name": "table_columns", "value": []}]',
|
||||||
|
'{}',
|
||||||
|
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
UPDATE notification_type
|
||||||
|
SET
|
||||||
|
title = 'Un Nuovo Bando È Stato Pubblicato',
|
||||||
|
json_template = 'Un nuovo bando intitolato {{call_name}} è stato pubblicato. Controllalo e invia le candidature prima della scadenza.'
|
||||||
|
WHERE
|
||||||
|
notification_name = 'CALL_CREATED';
|
||||||
|
|
||||||
|
UPDATE notification_type
|
||||||
|
SET
|
||||||
|
title = 'Richiesta Finanziamento Inviata con Successo per la Valutazione',
|
||||||
|
json_template = 'La richiesta per {{call_name}} ai sensi del protocollo n. {{protocol_number}} è stata presentata con successo. È ora in fase di valutazione.'
|
||||||
|
WHERE
|
||||||
|
notification_name = 'APPLICATION_SUBMISSION';
|
||||||
|
|
||||||
|
UPDATE notification_type
|
||||||
|
SET
|
||||||
|
title = 'È Stato Creato un Soccorso Istruttorio per la Richiesta',
|
||||||
|
json_template = 'È stato creato un soccorso istruttorio per la richiesta in {{call_name}} ai sensi del protocollo n. {{protocol_number}}. Esamina le richieste e procedi di conseguenza.'
|
||||||
|
WHERE
|
||||||
|
notification_name = 'AMENDMENT_CREATION';
|
||||||
|
|
||||||
|
UPDATE notification_type
|
||||||
|
SET
|
||||||
|
title = 'Il Risultato della Valutazione per la Richiesta È Disponibile',
|
||||||
|
json_template = 'Il risultato della valutazione per la richiesta ai sensi del protocollo n. {{protocol_number}} è ora disponibile.'
|
||||||
|
WHERE
|
||||||
|
notification_name = 'EVALUATION_RESULT';
|
||||||
|
|
||||||
|
UPDATE notification_type
|
||||||
|
SET
|
||||||
|
title = 'Soccorso Scaduto',
|
||||||
|
json_template = 'Il soccorso istruttorio per la richiesta in {{call_name}} ai sensi del protocollo n. {{protocol_number}} è scaduto.'
|
||||||
|
WHERE
|
||||||
|
notification_name = 'AMENDMENT_EXPIRED';
|
||||||
|
|
||||||
|
UPDATE notification_type
|
||||||
|
SET
|
||||||
|
title = 'Scorso Chiuso ed È Ora Inattivo',
|
||||||
|
json_template = 'Il soccorso istruttorio per {{call_name}} ai sensi del protocollo n. {{protocol_number}} è stato chiuso ed è ora inattivo.'
|
||||||
|
WHERE
|
||||||
|
notification_name = 'AMENDMENT_CLOSED';
|
||||||
|
|
||||||
|
UPDATE notification_type
|
||||||
|
SET
|
||||||
|
title = 'NDG creato per la Richiesta',
|
||||||
|
json_template = 'È stato generato un nuovo NDG per {{call_name}} ai sensi del protocollo n. {{protocol_number}}.'
|
||||||
|
WHERE
|
||||||
|
notification_name = 'NDG_GENERATION';
|
||||||
|
|
||||||
|
UPDATE notification_type
|
||||||
|
SET
|
||||||
|
title = 'La domanda è stata assegnata per la Valutazione',
|
||||||
|
json_template = 'La richiesta in {{call_name}} ai sensi del protocollo n. {{protocol_number}} è stata assegnata alla fase di valutazione.'
|
||||||
|
WHERE
|
||||||
|
notification_name = 'EVALUATION_CREATION';
|
||||||
|
|
||||||
|
UPDATE notification_type
|
||||||
|
SET
|
||||||
|
title = 'La Valutazione per la Richiesta È Scaduta',
|
||||||
|
json_template = 'La valutazione per la richiesta in {{call_name}} ai sensi del protocollo n. {{protocol_number}} è scaduta.'
|
||||||
|
WHERE
|
||||||
|
notification_name = 'EVALUATION_EXPIRED';
|
||||||
@@ -313,6 +313,7 @@ company.id.required.for.preferred.call=Company ID is required when requesting on
|
|||||||
|
|
||||||
response.days.not.null=Response days should not be null and greater than zero.
|
response.days.not.null=Response days should not be null and greater than zero.
|
||||||
application.cannot.approved.or.rejected=Application cannot be approved and rejected because amendment is active.
|
application.cannot.approved.or.rejected=Application cannot be approved and rejected because amendment is active.
|
||||||
|
valid.vatnumber.message=The VAT number is valid.
|
||||||
|
|
||||||
atleast.one.id.required=At least one of companyId or applicationId must be provided
|
atleast.one.id.required=At least one of companyId or applicationId must be provided
|
||||||
|
|
||||||
@@ -336,3 +337,12 @@ appointment.created.successfully = Appointment created successfully.
|
|||||||
error.try.again = Service call error while performing the operation. Please try again.
|
error.try.again = Service call error while performing the operation. Please try again.
|
||||||
document.uploading.is.in.progress = Document uploading is in progress.
|
document.uploading.is.in.progress = Document uploading is in progress.
|
||||||
all.document.checked.and.one.checklist.checked=All document should be checked and at least one checklist should be checked.
|
all.document.checked.and.one.checklist.checked=All document should be checked and at least one checklist should be checked.
|
||||||
|
|
||||||
|
#notification messsages
|
||||||
|
notification.already.in.state=Notification is already in provided status.
|
||||||
|
notification.fetched.successfully=Notification fetched successfully.
|
||||||
|
notification.not.found=Notification not found.
|
||||||
|
notification.sent.successfully=Notification sent successfully.
|
||||||
|
notification.deleted.successfully=Notification deleted successfully.
|
||||||
|
notification.updated.successfully=Notification updated successfully.
|
||||||
|
user.with.company.not.found = User with company not found for user or company.
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ user.created.success=Utente creato con successo.
|
|||||||
user.updated.success=Utente aggiornato con successo.
|
user.updated.success=Utente aggiornato con successo.
|
||||||
user.deleted.success=Utente eliminato con successo.
|
user.deleted.success=Utente eliminato con successo.
|
||||||
user.not.found=Utente non trovato.
|
user.not.found=Utente non trovato.
|
||||||
create_user_error_msg=Si <EFBFBD> verificato un errore durante la creazione dell'utente.
|
create_user_error_msg=Si ? verificato un errore durante la creazione dell'utente.
|
||||||
update_user_error_msg=Si <EFBFBD> verificato un errore durante l'aggiornamento dell'utente.
|
update_user_error_msg=Si ? verificato un errore durante l'aggiornamento dell'utente.
|
||||||
delete_user_error_msg=Si <EFBFBD> verificato un errore durante l'eliminazione dell'utente.
|
delete_user_error_msg=Si ? verificato un errore durante l'eliminazione dell'utente.
|
||||||
get_user_success_msg=Utente recuperato con successo.
|
get_user_success_msg=Utente recuperato con successo.
|
||||||
get_user_error_msg=Si <EFBFBD> verificato un errore durante il recupero dell'utente.
|
get_user_error_msg=Si ? verificato un errore durante il recupero dell'utente.
|
||||||
user.not.active=Utente non attivo. Si prega di contattare il supporto.
|
user.not.active=Utente non attivo. Si prega di contattare il supporto.
|
||||||
user.already.exist.msg=L'utente esiste gi<EFBFBD> per questo codice fiscale.
|
user.already.exist.msg=L'utente esiste gi? per questo codice fiscale.
|
||||||
validate.email=L'email <EFBFBD> obbligatoria e deve essere nel formato corretto. Si prega di verificare e riprovare.
|
validate.email=L'email ? obbligatoria e deve essere nel formato corretto. Si prega di verificare e riprovare.
|
||||||
validate.password=La password e confPassword sono obbligatorie. Verifica e riprova.
|
validate.password=La password e confPassword sono obbligatorie. Verifica e riprova.
|
||||||
# Role-related messages
|
# Role-related messages
|
||||||
role.created.success=Ruolo creato con successo.
|
role.created.success=Ruolo creato con successo.
|
||||||
@@ -20,7 +20,7 @@ create.role.error=Errore durante la creazione del ruolo.
|
|||||||
update.role.error=Errore durante l'aggiornamento del ruolo.
|
update.role.error=Errore durante l'aggiornamento del ruolo.
|
||||||
role.fetch.success=Ruolo recuperato con successo.
|
role.fetch.success=Ruolo recuperato con successo.
|
||||||
delete.role.error=Errore durante l'eliminazione del ruolo.
|
delete.role.error=Errore durante l'eliminazione del ruolo.
|
||||||
role.id.mandatory=L'ID del ruolo <EFBFBD> obbligatorio.
|
role.id.mandatory=L'ID del ruolo ? obbligatorio.
|
||||||
|
|
||||||
# Region-related messages
|
# Region-related messages
|
||||||
region.created.success=Regione creata con successo.
|
region.created.success=Regione creata con successo.
|
||||||
@@ -35,42 +35,42 @@ password.doesnt.match=La password e la conferma della password non corrispondono
|
|||||||
#call related messages
|
#call related messages
|
||||||
user.not.exist=L'utente non esiste.
|
user.not.exist=L'utente non esiste.
|
||||||
region.not.found=Regione non trovata.
|
region.not.found=Regione non trovata.
|
||||||
user.id.not.null=L'ID utente non pu<EFBFBD> essere nullo.
|
user.id.not.null=L'ID utente non pu? essere nullo.
|
||||||
question.not.empty=La domanda non pu<EFBFBD> essere vuota.
|
question.not.empty=La domanda non pu? essere vuota.
|
||||||
name.not.empty=Il nome non pu<EFBFBD> essere vuoto.
|
name.not.empty=Il nome non pu? essere vuoto.
|
||||||
type.not.empty=Il tipo non pu<EFBFBD> essere vuoto.
|
type.not.empty=Il tipo non pu? essere vuoto.
|
||||||
region.not.null=L'ID regione non pu<EFBFBD> essere nullo.
|
region.not.null=L'ID regione non pu? essere nullo.
|
||||||
amount.greater.than.zero=L'importo del finanziamento deve essere maggiore di zero.
|
amount.greater.than.zero=L'importo del finanziamento deve essere maggiore di zero.
|
||||||
look.up.data.not.valid=L'entit<EFBFBD> dati di ricerca non <EFBFBD> valida.
|
look.up.data.not.valid=L'entit? dati di ricerca non ? valida.
|
||||||
files.uploaded=File caricati correttamente.
|
files.uploaded=File caricati correttamente.
|
||||||
call.created.successfully=Chiamata creata correttamente.
|
call.created.successfully=Chiamata creata correttamente.
|
||||||
file.deleted.successfully=File eliminato con successo.
|
file.deleted.successfully=File eliminato con successo.
|
||||||
document.not.found=Documento non trovato.
|
document.not.found=Documento non trovato.
|
||||||
document.id.not.found=ID documento non trovato.
|
document.id.not.found=ID documento non trovato.
|
||||||
call.invalid.date=Data di inizio o fine non valida.
|
call.invalid.date=Data di inizio o fine non valida.
|
||||||
call.id.not.null=L'ID della chiamata non pu<EFBFBD> essere nullo.
|
call.id.not.null=L'ID della chiamata non pu? essere nullo.
|
||||||
call.update.successfully=Chiamata aggiornata con successo.
|
call.update.successfully=Chiamata aggiornata con successo.
|
||||||
call.fetch.success=Dettagli della chiamata recuperati con successo.
|
call.fetch.success=Dettagli della chiamata recuperati con successo.
|
||||||
call.not.found=Chiamata non trovata.
|
call.not.found=Chiamata non trovata.
|
||||||
score.not.null=Il punteggio non pu<EFBFBD> essere nullo o zero.
|
score.not.null=Il punteggio non pu? essere nullo o zero.
|
||||||
field.not.null={0} non pu<EFBFBD> essere nullo.
|
field.not.null={0} non pu? essere nullo.
|
||||||
field.not.empty=la {0} non pu<EFBFBD> essere vuota.
|
field.not.empty=la {0} non pu? essere vuota.
|
||||||
update_call_status_success_msg=Lo stato della chiamata <EFBFBD> stato aggiornato con successo.
|
update_call_status_success_msg=Lo stato della chiamata ? stato aggiornato con successo.
|
||||||
status.same.error=Lo stato <EFBFBD> gi<EFBFBD> impostato.
|
status.same.error=Lo stato ? gi? impostato.
|
||||||
invalid.status.change.from.draft=Lo stato non pu<EFBFBD> essere cambiato in READY_TO_PUBLISH o PUBLISH da DRAFT.
|
invalid.status.change.from.draft=Lo stato non pu? essere cambiato in READY_TO_PUBLISH o PUBLISH da DRAFT.
|
||||||
status.cannot.be.changed=Lo stato non pu<EFBFBD> essere cambiato.
|
status.cannot.be.changed=Lo stato non pu? essere cambiato.
|
||||||
published.call.not.update=Il bando pubblicato non pu<EFBFBD> essere aggiornato.
|
published.call.not.update=Il bando pubblicato non pu? essere aggiornato.
|
||||||
invalid.status.change.from.publish=Lo stato non pu<EFBFBD> essere modificato in READY_TO_PUBLISH o DRAFT da PUBLISH.
|
invalid.status.change.from.publish=Lo stato non pu? essere modificato in READY_TO_PUBLISH o DRAFT da PUBLISH.
|
||||||
|
|
||||||
|
|
||||||
# Login-related messages
|
# Login-related messages
|
||||||
login.successfully=Accesso effettuato con successo.
|
login.successfully=Accesso effettuato con successo.
|
||||||
pass.min.len.msg=La password deve essere lunga almeno 8 caratteri.
|
pass.min.len.msg=La password deve essere lunga almeno 8 caratteri.
|
||||||
email.already.exists=Esiste gi<EFBFBD> un utente con questa email.
|
email.already.exists=Esiste gi? un utente con questa email.
|
||||||
invalid_user=Validazione utente fallita. Controlla le informazioni, lo stato dell'account e la scadenza del token.
|
invalid_user=Validazione utente fallita. Controlla le informazioni, lo stato dell'account e la scadenza del token.
|
||||||
|
|
||||||
#Global messages
|
#Global messages
|
||||||
common_message=qualcosa é andato storto. Per favore riprova
|
common_message=qualcosa <EFBFBD> andato storto. Per favore riprova
|
||||||
invalid_signature=Gettone non valido.
|
invalid_signature=Gettone non valido.
|
||||||
invalid_login=Nome utente o password errati
|
invalid_login=Nome utente o password errati
|
||||||
req_validation_er=Errore di convalida
|
req_validation_er=Errore di convalida
|
||||||
@@ -119,26 +119,26 @@ lookupdata.created.successfully=LookUpData creato correttamente.
|
|||||||
lookupdata.fetched.successfully=LookUpData recuperato correttamente.
|
lookupdata.fetched.successfully=LookUpData recuperato correttamente.
|
||||||
lookupdata.updated.successfully=LookUpData aggiornato correttamente.
|
lookupdata.updated.successfully=LookUpData aggiornato correttamente.
|
||||||
lookupdata.deleted.successfully=LookUpData eliminato correttamente.
|
lookupdata.deleted.successfully=LookUpData eliminato correttamente.
|
||||||
lookupdata.value.cannot.be.empty=Il campo valore non pu<EFBFBD> essere vuoto
|
lookupdata.value.cannot.be.empty=Il campo valore non pu? essere vuoto
|
||||||
|
|
||||||
#Document-related message
|
#Document-related message
|
||||||
document.updated.successfully=Documento aggiornato con successo.
|
document.updated.successfully=Documento aggiornato con successo.
|
||||||
document.fetched.successfully=Documento recuperato con successo.
|
document.fetched.successfully=Documento recuperato con successo.
|
||||||
# Password reset messages
|
# Password reset messages
|
||||||
password.reset.initiated=Reimpostazione della password avviata.
|
password.reset.initiated=Reimpostazione della password avviata.
|
||||||
password.reset.success=La password <EFBFBD> stata reimpostata con successo.
|
password.reset.success=La password ? stata reimpostata con successo.
|
||||||
invalid.token.msg=Il token fornito <EFBFBD> invalido o scaduto. Si prega di richiedere un nuovo token.
|
invalid.token.msg=Il token fornito ? invalido o scaduto. Si prega di richiedere un nuovo token.
|
||||||
current.password.incorrect = La password attuale non <EFBFBD> corretta.
|
current.password.incorrect = La password attuale non ? corretta.
|
||||||
success.password.changed=Password cambiata con successo.
|
success.password.changed=Password cambiata con successo.
|
||||||
logout.successful.msg=Logout riuscito. Sei stato disconnesso con successo.
|
logout.successful.msg=Logout riuscito. Sei stato disconnesso con successo.
|
||||||
|
|
||||||
update.user.status.success=Lo stato dell'utente <EFBFBD> stato aggiornato con successo.
|
update.user.status.success=Lo stato dell'utente ? stato aggiornato con successo.
|
||||||
|
|
||||||
#Flow-related message
|
#Flow-related message
|
||||||
flow.created.successfully=Flusso creato con successo.
|
flow.created.successfully=Flusso creato con successo.
|
||||||
flow.fetched.successfully=Flusso recuperato con successo.
|
flow.fetched.successfully=Flusso recuperato con successo.
|
||||||
flow.already.exists= Il flusso esiste gi<EFBFBD> per questa chiamata.
|
flow.already.exists= Il flusso esiste gi? per questa chiamata.
|
||||||
flow.request.not.complete=La richiesta di flusso non <EFBFBD> completa.
|
flow.request.not.complete=La richiesta di flusso non ? completa.
|
||||||
initial.and.final.form.cannot.null=La forma iniziale e finale non possono essere nulle.
|
initial.and.final.form.cannot.null=La forma iniziale e finale non possono essere nulle.
|
||||||
|
|
||||||
# Application related messages
|
# Application related messages
|
||||||
@@ -149,25 +149,25 @@ application.get.success=Dettagli dell'applicazione recuperati con successo.
|
|||||||
application.not.found=Applicazione non trovata con l'ID fornito.
|
application.not.found=Applicazione non trovata con l'ID fornito.
|
||||||
application.form.field.not.found=Campo del modulo di domanda non trovato.
|
application.form.field.not.found=Campo del modulo di domanda non trovato.
|
||||||
Form.not.matches.to.call.initial.form=L'ID del modulo non corrisponde all'ID del modulo iniziale della chiamata.
|
Form.not.matches.to.call.initial.form=L'ID del modulo non corrisponde all'ID del modulo iniziale della chiamata.
|
||||||
application.already.exists=L'applicazione esiste gi<EFBFBD> per questa chiamata.
|
application.already.exists=L'applicazione esiste gi? per questa chiamata.
|
||||||
application.already.submitted=La domanda <EFBFBD> gi<EFBFBD> stata inviata.
|
application.already.submitted=La domanda ? gi? stata inviata.
|
||||||
|
|
||||||
#Validation related messages
|
#Validation related messages
|
||||||
validation.field.required=Il campo {0} <EFBFBD> obbligatorio.
|
validation.field.required=Il campo {0} ? obbligatorio.
|
||||||
validation.field.min_length=Il campo {0} deve essere lungo almeno {1} caratteri.
|
validation.field.min_length=Il campo {0} deve essere lungo almeno {1} caratteri.
|
||||||
validation.field.max_length=Il campo {0} deve essere lungo al massimo {1} caratteri.
|
validation.field.max_length=Il campo {0} deve essere lungo al massimo {1} caratteri.
|
||||||
validation.field.pattern=Il campo {0} non corrisponde al modello richiesto.
|
validation.field.pattern=Il campo {0} non corrisponde al modello richiesto.
|
||||||
validation.field.not_null=Il campo {0} non deve essere nullo.
|
validation.field.not_null=Il campo {0} non deve essere nullo.
|
||||||
validation.field.not_empty=Il campo {0} non deve essere vuoto.
|
validation.field.not_empty=Il campo {0} non deve essere vuoto.
|
||||||
current.form.incomplete=il modulo corrente non <EFBFBD> compilato
|
current.form.incomplete=il modulo corrente non ? compilato
|
||||||
flow.not.found=Flow not found.
|
flow.not.found=Flow not found.
|
||||||
validation.message=Messaggi di convalida.
|
validation.message=Messaggi di convalida.
|
||||||
action.required=Campo azione obbligatorio.
|
action.required=Campo azione obbligatorio.
|
||||||
call.not.published=La chiamata non <EFBFBD> stata pubblicata.
|
call.not.published=La chiamata non ? stata pubblicata.
|
||||||
application.form.not.found=Modulo di domanda non trovato.
|
application.form.not.found=Modulo di domanda non trovato.
|
||||||
|
|
||||||
application.is.incomplete = L'applicazione <EFBFBD> incompleta.
|
application.is.incomplete = L'applicazione ? incompleta.
|
||||||
updating.form.value.impact.on.flow=L'aggiornamento di questo valore del modulo {0} pu<EFBFBD> avere un impatto sul flusso.
|
updating.form.value.impact.on.flow=L'aggiornamento di questo valore del modulo {0} pu? avere un impatto sul flusso.
|
||||||
validation.field.custom=Il valore per il campo {0} non soddisfa la regola di convalida personalizzata.
|
validation.field.custom=Il valore per il campo {0} non soddisfa la regola di convalida personalizzata.
|
||||||
|
|
||||||
validation.codice.fiscale=Il campo {0} deve essere un Codice Fiscale valido con esattamente 16 caratteri: 6 lettere, 2 cifre, 1 lettera, 2 cifre, 1 lettera, 3 cifre e 1 lettera.
|
validation.codice.fiscale=Il campo {0} deve essere un Codice Fiscale valido con esattamente 16 caratteri: 6 lettere, 2 cifre, 1 lettera, 2 cifre, 1 lettera, 3 cifre e 1 lettera.
|
||||||
@@ -178,13 +178,13 @@ validation.email.pec=Il campo {0} deve essere un indirizzo email PEC valido.
|
|||||||
validation.url=Il campo {0} deve essere un URL valido.
|
validation.url=Il campo {0} deve essere un URL valido.
|
||||||
validation.marca.da.bollo=Il campo {0} deve essere una Marca Da Bollo valida con esattamente 14 cifre.
|
validation.marca.da.bollo=Il campo {0} deve essere una Marca Da Bollo valida con esattamente 14 cifre.
|
||||||
validation.piva=Il numero di partita IVA per {0} deve essere lungo fino a 11 cifre.
|
validation.piva=Il numero di partita IVA per {0} deve essere lungo fino a 11 cifre.
|
||||||
valid.vat.number=Il numero di partita IVA non <EFBFBD> valido per il campo {0}.
|
valid.vat.number=Il numero di partita IVA non ? valido per il campo {0}.
|
||||||
failed.retain.field=Impossibile conservare campi specifici.
|
failed.retain.field=Impossibile conservare campi specifici.
|
||||||
token.validate.success=Token convalidato con successo.
|
token.validate.success=Token convalidato con successo.
|
||||||
invalid.request=Richiesta non valida.
|
invalid.request=Richiesta non valida.
|
||||||
codice.fiscale.exists=Questo codice fiscale <EFBFBD> gi<EFBFBD> associato ad un altro utente.
|
codice.fiscale.exists=Questo codice fiscale ? gi? associato ad un altro utente.
|
||||||
|
|
||||||
total.steps.not.zero=Il totale dei passaggi non pu<EFBFBD> essere zero.
|
total.steps.not.zero=Il totale dei passaggi non pu? essere zero.
|
||||||
completed.steps.not.valid=I passaggi completati devono essere compresi tra 0 e il totale dei passaggi.
|
completed.steps.not.valid=I passaggi completati devono essere compresi tra 0 e il totale dei passaggi.
|
||||||
field.id.not.found=L'ID campo {0} non esiste nella struttura del modulo.
|
field.id.not.found=L'ID campo {0} non esiste nella struttura del modulo.
|
||||||
company.created.success=Azienda creata con successo.
|
company.created.success=Azienda creata con successo.
|
||||||
@@ -194,37 +194,37 @@ company.get.success=Azienda recuperata con successo.
|
|||||||
company.not.found=Azienda non trovata.
|
company.not.found=Azienda non trovata.
|
||||||
check.vatnumber.success=Numero di partita IVA verificato con successo.
|
check.vatnumber.success=Numero di partita IVA verificato con successo.
|
||||||
invalid.vatnumber=Numero di partita IVA non valido.
|
invalid.vatnumber=Numero di partita IVA non valido.
|
||||||
vatnumber.mandatory=Il numero di partita IVA <EFBFBD> obbligatorio.
|
vatnumber.mandatory=Il numero di partita IVA ? obbligatorio.
|
||||||
vatnumber.already.exists=Il numero di partita IVA esiste gi<EFBFBD>.
|
vatnumber.already.exists=Il numero di partita IVA esiste gi?.
|
||||||
invalid.email=Email non valida.
|
invalid.email=Email non valida.
|
||||||
validation.error.missing.firstName=Il nome <EFBFBD> obbligatorio.
|
validation.error.missing.firstName=Il nome ? obbligatorio.
|
||||||
validation.error.missing.lastName=Il cognome <EFBFBD> obbligatorio.
|
validation.error.missing.lastName=Il cognome ? obbligatorio.
|
||||||
validation.error.missing.codiceFiscale=Il Codice Fiscale <EFBFBD> obbligatorio.
|
validation.error.missing.codiceFiscale=Il Codice Fiscale ? obbligatorio.
|
||||||
delegation.file.upload.success=File di delega caricato con successo.
|
delegation.file.upload.success=File di delega caricato con successo.
|
||||||
delegation.fetch.success=Delega recuperata con successo.
|
delegation.fetch.success=Delega recuperata con successo.
|
||||||
delegation.template.generation.error=Si <EFBFBD> verificato un errore durante la generazione del modello di delega.
|
delegation.template.generation.error=Si ? verificato un errore durante la generazione del modello di delega.
|
||||||
validation.error.file.empty=Il file caricato <EFBFBD> vuoto.
|
validation.error.file.empty=Il file caricato ? vuoto.
|
||||||
validation.error.file.invalidType=Sono accettati solo file .p7m.
|
validation.error.file.invalidType=Sono accettati solo file .p7m.
|
||||||
upload.error.s3=Impossibile caricare il file su S3.
|
upload.error.s3=Impossibile caricare il file su S3.
|
||||||
|
|
||||||
company.id.mandatory=L'ID dell'azienda <EFBFBD> obbligatorio.
|
company.id.mandatory=L'ID dell'azienda ? obbligatorio.
|
||||||
user.already.connected.to.company=L'utente <EFBFBD> gi<EFBFBD> collegato a questa azienda.
|
user.already.connected.to.company=L'utente ? gi? collegato a questa azienda.
|
||||||
call.not.started.yet = La chiamata non <EFBFBD> ancora iniziata. Attendere fino alla data e all'ora di inizio specificate.
|
call.not.started.yet = La chiamata non ? ancora iniziata. Attendere fino alla data e all'ora di inizio specificate.
|
||||||
call.already.ended = La chiamata <EFBFBD> gi<EFBFBD> terminata. Non <EFBFBD> possibile inviare l'applicazione dopo la scadenza.
|
call.already.ended = La chiamata ? gi? terminata. Non ? possibile inviare l'applicazione dopo la scadenza.
|
||||||
status.updated.successfully=Stato aggiornato con successo.
|
status.updated.successfully=Stato aggiornato con successo.
|
||||||
application.status.updated.successfully = Stato dell'applicazione aggiornato con successo.
|
application.status.updated.successfully = Stato dell'applicazione aggiornato con successo.
|
||||||
application.already.in.provided.status=L'applicazione <EFBFBD> gi<EFBFBD> nello stato fornito.
|
application.already.in.provided.status=L'applicazione ? gi? nello stato fornito.
|
||||||
delegation.not.found=Delega non trovata.
|
delegation.not.found=Delega non trovata.
|
||||||
user.company.relation.not.found=Relazione utente con l'azienda specificata non trovata.
|
user.company.relation.not.found=Relazione utente con l'azienda specificata non trovata.
|
||||||
delegation.delete.success=Delega eliminata con successo.
|
delegation.delete.success=Delega eliminata con successo.
|
||||||
user.not.authorized.create.application=L'utente deve essere un rappresentante legale o avere una delega.
|
user.not.authorized.create.application=L'utente deve essere un rappresentante legale o avere una delega.
|
||||||
application.submitted.cannot.change=La domanda inviata non pu<EFBFBD> essere modificata.
|
application.submitted.cannot.change=La domanda inviata non pu? essere modificata.
|
||||||
|
|
||||||
# Call Document Messages
|
# Call Document Messages
|
||||||
call.documents.fetch.success=Documenti recuperati con successo.
|
call.documents.fetch.success=Documenti recuperati con successo.
|
||||||
call.documents.not.found=Nessun documento trovato per la chiamata specificata.
|
call.documents.not.found=Nessun documento trovato per la chiamata specificata.
|
||||||
# Beneficiary Preferred Call messages
|
# Beneficiary Preferred Call messages
|
||||||
beneficiary.preferred.call.status.updated.success=Lo stato della chiamata preferita del beneficiario <EFBFBD> stato aggiornato con successo.
|
beneficiary.preferred.call.status.updated.success=Lo stato della chiamata preferita del beneficiario ? stato aggiornato con successo.
|
||||||
beneficiary.preferred.calls.get.all.success=Tutte le chiamate preferite del beneficiario sono state recuperate con successo.
|
beneficiary.preferred.calls.get.all.success=Tutte le chiamate preferite del beneficiario sono state recuperate con successo.
|
||||||
beneficiary.preferred.call.created.success=Chiamata preferita del beneficiario creata con successo.
|
beneficiary.preferred.call.created.success=Chiamata preferita del beneficiario creata con successo.
|
||||||
beneficiary.preferred.call.get.success=Chiamata preferita del beneficiario recuperata con successo.
|
beneficiary.preferred.call.get.success=Chiamata preferita del beneficiario recuperata con successo.
|
||||||
@@ -233,7 +233,7 @@ beneficiary.preferred.calls.get.success=Tutte le chiamate preferite del benefici
|
|||||||
beneficiary.preferred.call.updated.success=Chiamata preferita del beneficiario aggiornata con successo.
|
beneficiary.preferred.call.updated.success=Chiamata preferita del beneficiario aggiornata con successo.
|
||||||
beneficiary.preferred.call.not.found=Chiamata preferita del beneficiario non trovata.
|
beneficiary.preferred.call.not.found=Chiamata preferita del beneficiario non trovata.
|
||||||
either.user.or.beneficiary.id.required = ID utente o ID beneficiario non presente.
|
either.user.or.beneficiary.id.required = ID utente o ID beneficiario non presente.
|
||||||
userId.and.beneficiaryId.error = Non <EFBFBD> possibile fornire contemporaneamente sia userId che beneficiaryId.
|
userId.and.beneficiaryId.error = Non ? possibile fornire contemporaneamente sia userId che beneficiaryId.
|
||||||
User.not.found.with.the.given.beneficiaryID=Utente non trovato con l'ID beneficiario fornito.
|
User.not.found.with.the.given.beneficiaryID=Utente non trovato con l'ID beneficiario fornito.
|
||||||
permission.denied=Non sei autorizzato ad accedere a questi dati.
|
permission.denied=Non sei autorizzato ad accedere a questi dati.
|
||||||
signed.document.file.upload.success=File del documento firmato caricato con successo.
|
signed.document.file.upload.success=File del documento firmato caricato con successo.
|
||||||
@@ -244,10 +244,10 @@ delete.signed.document.file.success=Documento firmato eliminato con successo.
|
|||||||
dashboard.widget.fetched.successfully=Widget dashboard recuperato correttamente.
|
dashboard.widget.fetched.successfully=Widget dashboard recuperato correttamente.
|
||||||
login_attempt_successfully_created= Tentativo di login creato con successo.
|
login_attempt_successfully_created= Tentativo di login creato con successo.
|
||||||
get_login_attempt_se_msg=Lista dei tentativi di accesso recuperata correttamente.
|
get_login_attempt_se_msg=Lista dei tentativi di accesso recuperata correttamente.
|
||||||
application.in.submit.status.cannot.delete.company=Non <EFBFBD> possibile eliminare l'azienda perch<EFBFBD> ci sono domande attive con stato SUBMITTED.
|
application.in.submit.status.cannot.delete.company=Non ? possibile eliminare l'azienda perch? ci sono domande attive con stato SUBMITTED.
|
||||||
|
|
||||||
get.users.success.msg = Utenti recuperati con successo
|
get.users.success.msg = Utenti recuperati con successo
|
||||||
cannot.create.beneficiary.user = La creazione di un utente beneficiario non <EFBFBD> consentita. Si prega di assegnare il ruolo appropriato.
|
cannot.create.beneficiary.user = La creazione di un utente beneficiario non ? consentita. Si prega di assegnare il ruolo appropriato.
|
||||||
evaluationCriteria.invalid=Questo criterio di valutazione non appartiene alla chiamata corrente.
|
evaluationCriteria.invalid=Questo criterio di valutazione non appartiene alla chiamata corrente.
|
||||||
|
|
||||||
application.evaluation.not.found=Valutazione dell'applicazione non trovata con ID: {0}
|
application.evaluation.not.found=Valutazione dell'applicazione non trovata con ID: {0}
|
||||||
@@ -258,11 +258,11 @@ evaluation.deleted.successfully = Valutazione dell'applicazione eliminata con su
|
|||||||
evaluations.fetched.successfully = Tutte le valutazioni delle applicazioni recuperate con successo.
|
evaluations.fetched.successfully = Tutte le valutazioni delle applicazioni recuperate con successo.
|
||||||
application.evaluation.status.updated.successfully=Stato della valutazione dell'applicazione aggiornato con successo.
|
application.evaluation.status.updated.successfully=Stato della valutazione dell'applicazione aggiornato con successo.
|
||||||
assigned.application.not.found.with.id=Applicazione assegnata con questo ID dell'applicazione non trovata
|
assigned.application.not.found.with.id=Applicazione assegnata con questo ID dell'applicazione non trovata
|
||||||
either.application.or.assigned.application.id.required=<EFBFBD> richiesto almeno uno tra applicationId o assignedApplicationId.
|
either.application.or.assigned.application.id.required=? richiesto almeno uno tra applicationId o assignedApplicationId.
|
||||||
evaluation.already.exists=Una valutazione dell'applicazione esiste gi<EFBFBD> per questo ID applicazione.
|
evaluation.already.exists=Una valutazione dell'applicazione esiste gi? per questo ID applicazione.
|
||||||
|
|
||||||
application.assigned.success.msg =Domanda assegnata con successo
|
application.assigned.success.msg =Domanda assegnata con successo
|
||||||
application.already.assigned.msg =La domanda <EFBFBD> gi<EFBFBD> assegnata
|
application.already.assigned.msg =La domanda ? gi? assegnata
|
||||||
aasigned.application.not.found = Applicazione assegnata non trovata con l'ID specificato.
|
aasigned.application.not.found = Applicazione assegnata non trovata con l'ID specificato.
|
||||||
assigned.application.deleted.success =Applicazione assegnata eliminata con successo.
|
assigned.application.deleted.success =Applicazione assegnata eliminata con successo.
|
||||||
assigned.application.get.success =Dettagli dell'applicazione assegnata recuperati correttamente.
|
assigned.application.get.success =Dettagli dell'applicazione assegnata recuperati correttamente.
|
||||||
@@ -277,7 +277,7 @@ hub_get_all_success=Hub recuperati con successo
|
|||||||
hub_delete_success=Hub eliminato con successo
|
hub_delete_success=Hub eliminato con successo
|
||||||
hub_not_found=Hub non trovato
|
hub_not_found=Hub non trovato
|
||||||
|
|
||||||
application.not.in.draft.status=La domanda non <EFBFBD> in stato DRAFT.
|
application.not.in.draft.status=La domanda non ? in stato DRAFT.
|
||||||
get.error.s3=Impossibile recuperare il file da S3.
|
get.error.s3=Impossibile recuperare il file da S3.
|
||||||
|
|
||||||
application.data.amendment.success = Recupero riuscito dei dati dell'applicazione per il processo di modifica
|
application.data.amendment.success = Recupero riuscito dei dati dell'applicazione per il processo di modifica
|
||||||
@@ -292,19 +292,22 @@ added.comment.to.amendment.request.success = Commento aggiunto con successo alla
|
|||||||
comment.not.found = Commento non trovato.
|
comment.not.found = Commento non trovato.
|
||||||
comment.updated.successfully = Commento aggiornato con successo.
|
comment.updated.successfully = Commento aggiornato con successo.
|
||||||
comment.deleted.successfully = Commento eliminato con successo.
|
comment.deleted.successfully = Commento eliminato con successo.
|
||||||
comment.not.associate.with.amendment = Il commento non <EFBFBD> associato alla richiesta di emendamento.
|
comment.not.associate.with.amendment = Il commento non ? associato alla richiesta di emendamento.
|
||||||
amendment.found.success = Richiesta di emendamento trovata con successo.
|
amendment.found.success = Richiesta di emendamento trovata con successo.
|
||||||
invalid.amendment.for.comment = Richiesta di emendamento non valida per il commento fornito.
|
invalid.amendment.for.comment = Richiesta di emendamento non valida per il commento fornito.
|
||||||
DD_MM_YYYY_HH_MM = dd_MM_yyyy HH:mm
|
DD_MM_YYYY_HH_MM = dd_MM_yyyy HH:mm
|
||||||
create.application.data.amendment.msg =Emendamento alla domanda inviato con successo
|
create.application.data.amendment.msg =Emendamento alla domanda inviato con successo
|
||||||
beneficiary.email.not.found.msg=L'indirizzo email per il beneficiario non <EFBFBD> stato trovato. Si prega di assicurarsi che il beneficiario abbia un indirizzo email valido.
|
beneficiary.email.not.found.msg=L'indirizzo email per il beneficiario non ? stato trovato. Si prega di assicurarsi che il beneficiario abbia un indirizzo email valido.
|
||||||
reminder.email.sent.success.msg=Email di promemoria inviata con successo!
|
reminder.email.sent.success.msg=Email di promemoria inviata con successo!
|
||||||
application.documents.not.found=Nessun documento trovato per la domanda.
|
application.documents.not.found=Nessun documento trovato per la domanda.
|
||||||
beneficiary.call.duplicate = Una chiamata preferita con questo ID di chiamata e ID azienda esiste gi<EFBFBD> per questo utente.
|
beneficiary.call.duplicate = Una chiamata preferita con questo ID di chiamata e ID azienda esiste gi? per questo utente.
|
||||||
user.must.be.associated.with.company.to.create.application=Devi essere associato a un'azienda per poter presentare domanda per questa applicazione.
|
user.must.be.associated.with.company.to.create.application=Devi essere associato a un'azienda per poter presentare domanda per questa applicazione.
|
||||||
company.id.required.for.preferred.call=ID azienda obbligatorio quando si richiedono solo chiamate preferite.
|
company.id.required.for.preferred.call=ID azienda obbligatorio quando si richiedono solo chiamate preferite.
|
||||||
response.days.not.null=I giorni di risposta non devono essere nulli e maggiori di zero.
|
response.days.not.null=I giorni di risposta non devono essere nulli e maggiori di zero.
|
||||||
application.cannot.approved.or.rejected=La domanda non pu<70> essere approvata o rifiutata perch<63> l'emendamento <20> attivo.
|
application.cannot.approved.or.rejected=La domanda non pu<70> essere approvata o rifiutata perch<63> l'emendamento <20> attivo.
|
||||||
|
valid.vatnumber.message=Il numero di partita IVA <20> valido.
|
||||||
|
application.cannot.approved.or.rejected=La domanda non pu? essere approvata o rifiutata perch? l'emendamento ? attivo.
|
||||||
|
|
||||||
atleast.one.id.required=Almeno uno tra companyId o applicationId deve essere fornito.
|
atleast.one.id.required=Almeno uno tra companyId o applicationId deve essere fornito.
|
||||||
|
|
||||||
#Appointment flow messages
|
#Appointment flow messages
|
||||||
@@ -324,5 +327,17 @@ appointment.creation.is.only.for.gepafin = La creazione degli appuntamenti ? con
|
|||||||
upload.document.is.only.for.gepafin = Il documento non pu? essere caricato, questa operazione ? disponibile solo per il Hub GEPAFIN.
|
upload.document.is.only.for.gepafin = Il documento non pu? essere caricato, questa operazione ? disponibile solo per il Hub GEPAFIN.
|
||||||
appointment.created.successfully = Appuntamento creato con successo.
|
appointment.created.successfully = Appuntamento creato con successo.
|
||||||
error.try.again = Errore di chiamata di servizio durante l'esecuzione dell'operazione. Riprovare.
|
error.try.again = Errore di chiamata di servizio durante l'esecuzione dell'operazione. Riprovare.
|
||||||
document.uploading.is.in.progress = Il documento <EFBFBD> in fase di caricamento.
|
document.uploading.is.in.progress = Il documento ? in fase di caricamento.
|
||||||
all.document.checked.and.one.checklist.checked=Tutti i documenti devono essere controllati e almeno una checklist deve essere controllata.
|
all.document.checked.and.one.checklist.checked=Tutti i documenti devono essere controllati e almeno una checklist deve essere controllata.
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
#notification messsages
|
||||||
|
notification.already.in.state=La notifica <20> gi<67> nello stato fornito.
|
||||||
|
notification.fetched.successfully=Notifica recuperata con successo.
|
||||||
|
notification.not.found=Notifica non trovata.
|
||||||
|
notification.sent.successfully=Notifica inviata con successo.
|
||||||
|
notification.deleted.successfully=Notifica eliminata con successo.
|
||||||
|
notification.updated.successfully=Notifica aggiornata con successo.
|
||||||
|
user.with.company.not.found = Utente con azienda non trovato per utente o azienda.
|
||||||
|
=======
|
||||||
|
>>>>>>> 832666a4d412c2c81f5c1dfb5b1866aba2c40bdd
|
||||||
|
|||||||
Reference in New Issue
Block a user