From 609bb7d99aa549c6cf974ba4b48f8ba0fbc56360 Mon Sep 17 00:00:00 2001 From: nisha Date: Wed, 8 Jan 2025 20:09:47 +0530 Subject: [PATCH 01/11] Code for dashbaord API --- .../tendermanagement/dao/DashboardDao.java | 67 +++++++++++++++++-- .../SuperAdminWidgetResponseBean.java | 7 +- .../model/response/Widget1.java | 4 ++ .../repositories/ApplicationRepository.java | 13 +++- .../repositories/CallRepository.java | 5 ++ .../repositories/UserActionsRepository.java | 28 ++++++++ .../db/changelog/db.changelog-1.0.0.xml | 8 +++ 7 files changed, 123 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java index 0afc8fc8..05bf687d 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java @@ -1,6 +1,7 @@ package net.gepafin.tendermanagement.dao; import net.gepafin.tendermanagement.entities.CompanyEntity; +import net.gepafin.tendermanagement.entities.UserActionEntity; import net.gepafin.tendermanagement.entities.UserEntity; import net.gepafin.tendermanagement.entities.UserWithCompanyEntity; import net.gepafin.tendermanagement.enums.CallStatusEnum; @@ -9,15 +10,18 @@ import net.gepafin.tendermanagement.enums.UserStatusEnum; import net.gepafin.tendermanagement.model.response.BeneficiaryWidgetResponseBean; import net.gepafin.tendermanagement.model.response.Widget1; import net.gepafin.tendermanagement.model.response.SuperAdminWidgetResponseBean; -import net.gepafin.tendermanagement.repositories.ApplicationRepository; -import net.gepafin.tendermanagement.repositories.CallRepository; -import net.gepafin.tendermanagement.repositories.CompanyRepository; -import net.gepafin.tendermanagement.repositories.UserRepository; +import net.gepafin.tendermanagement.repositories.*; import net.gepafin.tendermanagement.service.CompanyService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Component; import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; @Component public class DashboardDao { @@ -37,11 +41,15 @@ public class DashboardDao { @Autowired private CompanyService companyService; + @Autowired + private UserActionsRepository userActionsRepository; + public SuperAdminWidgetResponseBean getDashboardWidget(UserEntity requestedUserEntity) { SuperAdminWidgetResponseBean widgetResponseBean = new SuperAdminWidgetResponseBean(); widgetResponseBean.setWidget1(createWidget1(requestedUserEntity)); -// List widgetBars = callRepository.findApplicationsPerCall(); -// widgetResponseBean.setWidgetBars(widgetBars); + Map widgetBars =getStatistics(requestedUserEntity); + widgetResponseBean.setWidgetBars(widgetBars); + widgetResponseBean.setUserActionWidgetList(getUserAction(requestedUserEntity)); return widgetResponseBean; } @@ -54,7 +62,8 @@ public class DashboardDao { setSubmittedApplications(widget1, requestedUserEntity); setDraftApplications(widget1, requestedUserEntity); setNumberOfCompanies(widget1, requestedUserEntity); - + setAmountRequested(widget1,requestedUserEntity); + setAmountAccepted(widget1,requestedUserEntity); return widget1; } @@ -71,6 +80,20 @@ public class DashboardDao { } } + private void setAmountRequested(Widget1 widget1, UserEntity requestedUserEntity) { + BigDecimal amountRequested = callRepository.findTotalAmountOfPublishedCalls(requestedUserEntity.getHub().getId()); + if (amountRequested != null) { + widget1.setAmountRequested(amountRequested); + } + } + + private void setAmountAccepted(Widget1 widget1, UserEntity requestedUserEntity) { + BigDecimal amountAccepted = applicationRepository.findTotalApprovedApplicationAmount(requestedUserEntity.getHub().getId()); + if (amountAccepted != null) { + widget1.setAmountAccepted(amountAccepted); + } + } + private void setRegisteredUsers(Widget1 widget1, UserEntity requestedUserEntity) { Long activeUsers = userRepository.countByStatusAndRoleEntityRoleTypeAndHubId(UserStatusEnum.ACTIVE.getValue(), RoleStatusEnum.ROLE_BENEFICIARY.getValue(), requestedUserEntity.getHub().getId()); @@ -121,4 +144,34 @@ public class DashboardDao { } return beneficiaryWidgetResponseBean; } + + public Map getStatistics(UserEntity requestedUser) { + Map stats = new HashMap<>(); + + // Get applications per call + List applicationsPerCall = applicationRepository.findApplicationsPerCallWithName(requestedUser.getHub().getId()); + stats.put("APPLICATION_PER_CALL", applicationsPerCall.stream().map(result -> { + Map callData = new HashMap<>(); + callData.put("CALL", result[0]); // Call name + callData.put("APPLICATIONS", result[1]); // Application count + return callData; + }).toList()); + + // Get applications grouped by status + List applicationsByStatus = applicationRepository.findApplicationsByStatus(requestedUser.getHub().getId()); + stats.put("APPLICATION_STATUSES", applicationsByStatus.stream().map(result -> { + Map statusData = new HashMap<>(); + statusData.put("STATUS", result[0]); // Application status + statusData.put("COUNT", result[1]); // Count of applications + return statusData; + }).toList()); + + return stats; + } + public Page getUserAction(UserEntity requestedUserEntity){ + Pageable pageable = PageRequest.of(0, 20); // Get the first 20 records + List roles=List.of(RoleStatusEnum.ROLE_PRE_INSTRUCTOR.getValue(),RoleStatusEnum.ROLE_GEPAFIN_OPERATOR.getValue(),RoleStatusEnum.ROLE_INSTRUCTOR_MANAGER.getValue()); + Page userActionEntities=userActionsRepository.findActionsByRoleNamesAndHubId(roles,requestedUserEntity.getHub().getId(),pageable); + return userActionEntities; + } } diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/SuperAdminWidgetResponseBean.java b/src/main/java/net/gepafin/tendermanagement/model/response/SuperAdminWidgetResponseBean.java index 6ed30e56..405a92ac 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/SuperAdminWidgetResponseBean.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/SuperAdminWidgetResponseBean.java @@ -1,14 +1,19 @@ package net.gepafin.tendermanagement.model.response; import lombok.Data; +import net.gepafin.tendermanagement.entities.UserActionEntity; +import org.springframework.data.domain.Page; import java.util.List; +import java.util.Map; @Data public class SuperAdminWidgetResponseBean { private Widget1 widget1; -// private List widgetBars; + private Map widgetBars; + + Page userActionWidgetList; } diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/Widget1.java b/src/main/java/net/gepafin/tendermanagement/model/response/Widget1.java index 75c68758..0d82d0be 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/Widget1.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/Widget1.java @@ -23,4 +23,8 @@ public class Widget1 { private BigDecimal totalActiveFinancing; + private BigDecimal amountRequested; + + private BigDecimal amountAccepted; + } diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java index db645f95..560acd09 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java @@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; +import java.math.BigDecimal; import java.util.List; import java.util.Optional; @@ -24,7 +25,6 @@ public interface ApplicationRepository extends JpaRepository findByIdAndUserIdAndIsDeletedFalse(Long id,Long userId); - Optional findByUserIdAndUserWithCompanyIdAndCallIdAndIsDeletedFalse(Long userId, Long userWithCompanyId, Long callId); public Optional findByIdAndUserIdAndCallIdAndIsDeletedFalse(Long applicationId, Long userId, Long callId); @@ -44,4 +44,15 @@ public interface ApplicationRepository extends JpaRepository findApplicationsPerCallWithName(@Param("hubId") Long hubId); + + // Count Applications by Status by Hub ID + @Query("SELECT a.status, COUNT(a.id) FROM ApplicationEntity a WHERE a.isDeleted = false AND a.call.hub.id = :hubId GROUP BY a.status") + List findApplicationsByStatus(@Param("hubId") Long hubId); + + // Total Amount of Approved Applications by Hub ID + @Query("SELECT SUM(a.call.amount) FROM ApplicationEntity a WHERE a.status = 'APPROVED' AND a.isDeleted = false AND a.call.hub.id = :hubId") + BigDecimal findTotalApprovedApplicationAmount(@Param("hubId") Long hubId); } diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/CallRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/CallRepository.java index 833e1d68..2a311ca2 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/CallRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/CallRepository.java @@ -47,4 +47,9 @@ public interface CallRepository extends JpaRepository { BigDecimal findTotalAmountOfPublishedCallsAndHubId(@Param("hubId") Long hubId); @Query("SELECT c FROM CallEntity c WHERE c.id IN :ids AND c.status IN :status") List findByIdInAndStatusIn(@Param("ids") List ids, @Param("status") List status); + + @Query("SELECT SUM(c.amount) FROM CallEntity c WHERE c.hub.id = :hubId AND c.status = 'PUBLISH'") + BigDecimal findTotalAmountOfPublishedCalls(@Param("hubId") Long hubId); + + } diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/UserActionsRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/UserActionsRepository.java index f0163c47..7bfea91b 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/UserActionsRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/UserActionsRepository.java @@ -1,10 +1,38 @@ package net.gepafin.tendermanagement.repositories; import net.gepafin.tendermanagement.entities.UserActionEntity; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; 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 java.util.List; + @Repository public interface UserActionsRepository extends JpaRepository { UserActionEntity findUserActionById(Long id); + +// +// @Query("SELECT ua FROM UserActionEntity ua " + +// "JOIN ua.user u " + +// "WHERE u.roleEntity.roleType IN :roleNames " + +// "AND ua.hub.id = :hubId " + +// "AND ua.isDeleted = false") +// Page findActionsByRoleNamesAndHubId( +// @Param("roleNames") List roleNames, +// @Param("hubId") Long hubId, Pageable pageable); + + @Query("SELECT ua FROM UserActionEntity ua " + + "JOIN UserEntity u ON ua.userId = u.id " + // Join on userId field + "JOIN u.roleEntity r " + // Join the RoleEntity via the UserEntity + "WHERE r.roleType IN :roleNames " + // Filter by role name + "AND ua.hubId = :hubId " + // Filter by hubId + "AND ua.isDeleted = false") + Page findActionsByRoleNamesAndHubId( + @Param("roleNames") List roleNames, + @Param("hubId") Long hubId, + Pageable pageable); + } diff --git a/src/main/resources/db/changelog/db.changelog-1.0.0.xml b/src/main/resources/db/changelog/db.changelog-1.0.0.xml index 6eee497f..764a5377 100644 --- a/src/main/resources/db/changelog/db.changelog-1.0.0.xml +++ b/src/main/resources/db/changelog/db.changelog-1.0.0.xml @@ -2065,4 +2065,12 @@ + + + + + + + + From f9c228f0c9ecb037a8713fd813e725976fdf7286 Mon Sep 17 00:00:00 2001 From: nisha Date: Thu, 9 Jan 2025 15:21:59 +0530 Subject: [PATCH 02/11] Updated code --- .../tendermanagement/dao/ApplicationDao.java | 18 +++++++++++++++++- .../dao/ApplicationEvaluationDao.java | 10 +++++++++- .../tendermanagement/dao/DashboardDao.java | 4 ++-- .../entities/ApplicationEntity.java | 15 ++++++++++++++- .../request/ApplicationEvaluationRequest.java | 2 ++ .../repositories/ApplicationRepository.java | 12 +++++++++--- .../db/changelog/db.changelog-1.0.0.xml | 8 ++++---- 7 files changed, 57 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java index 45a69384..cfb2e530 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java @@ -46,6 +46,7 @@ import jakarta.servlet.http.HttpServletRequest; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.math.BigDecimal; import java.text.MessageFormat; import java.time.LocalDateTime; import java.util.*; @@ -449,7 +450,22 @@ public class ApplicationDao { List newDocumentIds = validateFileUploadDocuments(applicationFormFieldRequestBean, formEntity); validateFileUploadDocuments(applicationFormFieldRequestBean, formEntity); VersionActionTypeEnum actionType = VersionActionTypeEnum.INSERT; - + List contentResponseBeans=formDao.convertFormEntityToFormResponseBean(formEntity).getContent(); + for (ContentResponseBean contentResponseBean:contentResponseBeans){ + if(Boolean.TRUE.equals(contentResponseBean.getName().equals("numberinput"))) { + List settingResponseBeans=contentResponseBean.getSettings(); + for(SettingResponseBean settingResponseBean:settingResponseBeans){ + if(settingResponseBean.getName().equals("isRequestedAmount")){ + Object value=settingResponseBean.getValue(); + if (value instanceof Boolean) { + if(Boolean.TRUE.equals(value)) + { + applicationFormEntity.getApplication().setAmountRequested((BigDecimal) applicationFormFieldRequestBean.getFieldValue()); + } + } + } + } + }} ApplicationFormFieldEntity oldApplicationFormFieldData = null; if (applicationFormFieldEntities == null || applicationFormFieldEntities.isEmpty()) { diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java index 50fdb16d..2c2e0bee 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java @@ -579,6 +579,7 @@ public class ApplicationEvaluationDao { Optional assignedApplications = assignedApplicationsRepository.findByIdAndIsDeletedFalse(assignedApplicationId); ApplicationEvaluationEntity oldApplicationEvaluation = null; + ApplicationEntity application = applicationService.validateApplication(assignedApplications.get().getApplication().getId()); VersionActionTypeEnum actionType = VersionActionTypeEnum.INSERT; if (existingEntityOptional.isPresent()) { entity = existingEntityOptional.get(); @@ -595,6 +596,7 @@ public class ApplicationEvaluationDao { entity.setIsDeleted(false); setIfUpdated(entity::getNote, entity::setNote, req.getNote()); setIfUpdated(entity::getMotivation, entity::setMotivation, req.getMotivation()); + application.setAmountAccepted(req.getAmountAccepted()); actionType = VersionActionTypeEnum.UPDATE; } else { entity = convertToEntity(user, req, assignedApplicationId); @@ -620,7 +622,6 @@ public class ApplicationEvaluationDao { loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(actionType).oldData(oldApplicationEvaluation).newData(entity).build()); if (status != null) { - ApplicationEntity application = applicationService.validateApplication(assignedApplications.get().getApplication().getId()); AssignedApplicationsEntity assignedApplicationsEntity = assignedApplications.get(); return updateApplicationEvaluationStatus(application, assignedApplicationsEntity, status); } else { @@ -1791,11 +1792,18 @@ public class ApplicationEvaluationDao { if (Boolean.TRUE.equals(statusType.equals((ApplicationStatusTypeEnum.APPROVED.getValue())))) { + application.setDateAccepted(DateTimeUtil.DateServerToUTC(LocalDateTime.now())); + application.setUpdatedDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now())); + application = applicationRepository.save(application); emailNotificationDao.sendAdmissibilityNotificationEmailForApprovedApplication(application); } if (Boolean.TRUE.equals(statusType.equals((ApplicationStatusTypeEnum.REJECTED.getValue())))) { + application.setDateRejected(DateTimeUtil.DateServerToUTC(LocalDateTime.now())); + application.setUpdatedDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now())); + application = applicationRepository.save(application); emailNotificationDao.sendInadmissibilityEmailForRejectedApplication(application,existingEntity); } + return convertToResponse(entity); } return null; diff --git a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java index 05bf687d..1957d676 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java @@ -81,14 +81,14 @@ public class DashboardDao { } private void setAmountRequested(Widget1 widget1, UserEntity requestedUserEntity) { - BigDecimal amountRequested = callRepository.findTotalAmountOfPublishedCalls(requestedUserEntity.getHub().getId()); + BigDecimal amountRequested = applicationRepository.findTotalAmountRequestedOfApplication(requestedUserEntity.getHub().getId()); if (amountRequested != null) { widget1.setAmountRequested(amountRequested); } } private void setAmountAccepted(Widget1 widget1, UserEntity requestedUserEntity) { - BigDecimal amountAccepted = applicationRepository.findTotalApprovedApplicationAmount(requestedUserEntity.getHub().getId()); + BigDecimal amountAccepted = applicationRepository.findTotalAmountAcceptedOfApplication(requestedUserEntity.getHub().getId()); if (amountAccepted != null) { widget1.setAmountAccepted(amountAccepted); } diff --git a/src/main/java/net/gepafin/tendermanagement/entities/ApplicationEntity.java b/src/main/java/net/gepafin/tendermanagement/entities/ApplicationEntity.java index 39e26f4b..c6880af4 100644 --- a/src/main/java/net/gepafin/tendermanagement/entities/ApplicationEntity.java +++ b/src/main/java/net/gepafin/tendermanagement/entities/ApplicationEntity.java @@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.entities; import jakarta.persistence.*; import lombok.*; +import java.math.BigDecimal; import java.time.LocalDateTime; @Entity @@ -55,4 +56,16 @@ public class ApplicationEntity extends BaseEntity { @Column(name = "APPOINTMENT_ID") private String appointmentId; - } \ No newline at end of file + @Column(name="AMOUNT_REQUESTED") + private BigDecimal amountRequested; + + @Column(name="AMOUNT_ACCEPTED") + private BigDecimal amountAccepted; + + @Column(name="DATE_ACCEPTED") + private LocalDateTime dateAccepted; + + @Column(name="DATE_REJECTED") + private LocalDateTime dateRejected; + +} \ No newline at end of file diff --git a/src/main/java/net/gepafin/tendermanagement/model/request/ApplicationEvaluationRequest.java b/src/main/java/net/gepafin/tendermanagement/model/request/ApplicationEvaluationRequest.java index 6616c288..bd63054c 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/request/ApplicationEvaluationRequest.java +++ b/src/main/java/net/gepafin/tendermanagement/model/request/ApplicationEvaluationRequest.java @@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.model.request; import lombok.Data; import net.gepafin.tendermanagement.enums.ApplicationStatusForEvaluation; +import java.math.BigDecimal; import java.util.List; @Data public class ApplicationEvaluationRequest { @@ -15,4 +16,5 @@ public class ApplicationEvaluationRequest { private String note; private ApplicationStatusForEvaluation applicationStatus; private String motivation; + private BigDecimal amountAccepted; } diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java index 560acd09..9922e009 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java @@ -52,7 +52,13 @@ public interface ApplicationRepository extends JpaRepository findApplicationsByStatus(@Param("hubId") Long hubId); - // Total Amount of Approved Applications by Hub ID - @Query("SELECT SUM(a.call.amount) FROM ApplicationEntity a WHERE a.status = 'APPROVED' AND a.isDeleted = false AND a.call.hub.id = :hubId") - BigDecimal findTotalApprovedApplicationAmount(@Param("hubId") Long hubId); + @Query("SELECT SUM(a.amountRequested) " + + "FROM ApplicationEntity a " + + "WHERE a.hubId = :hubId AND a.status = 'SUBMIT'") + BigDecimal findTotalAmountRequestedOfApplication(@Param("hubId") Long hubId); + + @Query("SELECT SUM(a.amountAccepted) " + + "FROM ApplicationEntity a " + + "WHERE a.hubId = :hubId AND a.status = 'APPROVED'") + BigDecimal findTotalAmountAcceptedOfApplication(@Param("hubId") Long hubId); } diff --git a/src/main/resources/db/changelog/db.changelog-1.0.0.xml b/src/main/resources/db/changelog/db.changelog-1.0.0.xml index 764a5377..9fc242e2 100644 --- a/src/main/resources/db/changelog/db.changelog-1.0.0.xml +++ b/src/main/resources/db/changelog/db.changelog-1.0.0.xml @@ -2067,10 +2067,10 @@ - - - - + + + + From e39bbcd5725b006259d13e52d0a944fc73c9c7e9 Mon Sep 17 00:00:00 2001 From: piyushkag Date: Fri, 10 Jan 2025 16:00:38 +0530 Subject: [PATCH 03/11] Updated application submission date to protocol creation date. --- .../tendermanagement/dao/ApplicationEvaluationDao.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java index c264a078..019eadf3 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java @@ -558,7 +558,7 @@ public class ApplicationEvaluationDao { response.setBeneficiary(beneficiary); response.setNdg(application.getNdg() != null ? application.getNdg() : null); response.setAppointmentId(application.getAppointmentId() != null ? application.getAppointmentId() : null); - response.setSubmissionDate(application.getSubmissionDate()); + response.setSubmissionDate(application.getProtocol().getCreatedDate()); response.setMinScore(call.getThreshold() != null ? call.getThreshold() : null); response.setCallName(application.getCall().getName() != null ? application.getCall().getName() : null); response.setProtocolNumber((application.getProtocol() != null && application.getProtocol().getProtocolNumber() != null) ? application.getProtocol().getProtocolNumber() : null); @@ -1386,7 +1386,7 @@ public class ApplicationEvaluationDao { String beneficiary = String.join(" ", firstName, lastName).trim(); response.setBeneficiary(beneficiary); - response.setSubmissionDate(application.getSubmissionDate()); + response.setSubmissionDate(application.getProtocol().getCreatedDate()); response.setNdg(application.getNdg() != null ? application.getNdg() : null); response.setAppointmentId(application.getAppointmentId() != null ? application.getAppointmentId() : null); response.setCallName(application.getCall().getName() != null ? application.getCall().getName() : null); From b4877b588c6ce8ecbb8ed21d1cc1acf796a2d0c3 Mon Sep 17 00:00:00 2001 From: nisha Date: Mon, 13 Jan 2025 13:00:04 +0530 Subject: [PATCH 04/11] Updated code --- .../constants/GepafinConstant.java | 1 + .../tendermanagement/dao/ApplicationDao.java | 49 +++++++++++++------ .../dao/ApplicationEvaluationDao.java | 13 ++++- .../tendermanagement/dao/DashboardDao.java | 17 +++---- .../tendermanagement/dao/FlowFormDao.java | 4 ++ .../ApplicationEvaluationResponse.java | 5 ++ .../response/ApplicationGetResponseBean.java | 10 ++++ .../model/response/ApplicationResponse.java | 9 ++++ .../response/ApplicationResponseBean.java | 9 ++++ .../response/NextOrPreviousFormResponse.java | 11 +++++ .../SuperAdminWidgetResponseBean.java | 2 - .../model/response/Widget1.java | 4 +- .../repositories/ApplicationRepository.java | 3 +- .../repositories/UserActionsRepository.java | 23 +-------- src/main/resources/message_en.properties | 1 + src/main/resources/message_it.properties | 4 +- 16 files changed, 110 insertions(+), 55 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java index 5869fc81..f984d0e0 100644 --- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java +++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java @@ -360,5 +360,6 @@ public class GepafinConstant { public static final String STATUS_CODE_STRING = "statusCode"; public static final String GET_STATUS_CODE_STRING = "status"; public static final String MESSAGE_STRING = "message"; + public static final String AMOUNT_ACCEPTED_REQUIRED_WHILE_APPROVING_APPLICATION="amount.accepted.required"; } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java index 82595964..2877a59d 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java @@ -424,6 +424,10 @@ public class ApplicationDao { if(applicationEntity.getProtocol() != null) { responseBean.setProtocolNumber(applicationEntity.getProtocol().getProtocolNumber()); } + responseBean.setAmountAccepted(applicationEntity.getAmountAccepted()); + responseBean.setAmountRequested(applicationEntity.getAmountRequested()); + responseBean.setDateAccepted(applicationEntity.getDateAccepted()); + responseBean.setDateRejected(applicationEntity.getDateRejected()); return responseBean; } @@ -443,6 +447,10 @@ public class ApplicationDao { response.setCallId(entity.getCall().getId()); response.setCreatedDate(entity.getCreatedDate()); response.setUpdatedDate(entity.getUpdatedDate()); + response.setAmountAccepted(entity.getAmountAccepted()); + response.setAmountRequested(entity.getAmountRequested()); + response.setDateAccepted(entity.getDateAccepted()); + response.setDateRejected(entity.getDateRejected()); if(entity.getProtocol() != null) { response.setProtocolNumber(entity.getProtocol().getProtocolNumber()); } @@ -481,22 +489,31 @@ public class ApplicationDao { List newDocumentIds = validateFileUploadDocuments(applicationFormFieldRequestBean, formEntity); validateFileUploadDocuments(applicationFormFieldRequestBean, formEntity); VersionActionTypeEnum actionType = VersionActionTypeEnum.INSERT; - List contentResponseBeans=formDao.convertFormEntityToFormResponseBean(formEntity).getContent(); - for (ContentResponseBean contentResponseBean:contentResponseBeans){ - if(Boolean.TRUE.equals(contentResponseBean.getName().equals("numberinput"))) { - List settingResponseBeans=contentResponseBean.getSettings(); - for(SettingResponseBean settingResponseBean:settingResponseBeans){ - if(settingResponseBean.getName().equals("isRequestedAmount")){ - Object value=settingResponseBean.getValue(); - if (value instanceof Boolean) { - if(Boolean.TRUE.equals(value)) - { - applicationFormEntity.getApplication().setAmountRequested((BigDecimal) applicationFormFieldRequestBean.getFieldValue()); + List contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent(); + + contentResponseBeans.stream() + .filter(content -> "numberinput".equals(content.getName())) + .map(ContentResponseBean::getSettings) + .flatMap(List::stream) + .filter(setting -> "isRequestedAmount".equals(setting.getName()) && Boolean.TRUE.equals(setting.getValue())) + .findFirst() + .ifPresent(setting -> { + Object fieldValue = applicationFormFieldRequestBean.getFieldValue(); + if(fieldValue!=null) { + if (fieldValue instanceof String) { + try { + BigDecimal amountRequested = new BigDecimal((String) fieldValue); + applicationFormEntity.getApplication().setAmountRequested(amountRequested); + } catch (NumberFormatException e) { + throw new IllegalArgumentException("Field value is not a valid number: " + fieldValue, e); + } + } else { + throw new IllegalArgumentException("Field value is not a String: " + fieldValue); } } - } - } - }} + }); + + ApplicationFormFieldEntity oldApplicationFormFieldData = null; if (applicationFormFieldEntities == null || applicationFormFieldEntities.isEmpty()) { @@ -827,6 +844,10 @@ public class ApplicationDao { applicationGetResponseBean.setCallId(applicationEntity.getCall().getId()); applicationGetResponseBean.setCallTitle(applicationEntity.getCall().getName()); applicationGetResponseBean.setCompanyId(applicationEntity.getCompanyId()); + applicationGetResponseBean.setAmountAccepted(applicationEntity.getAmountAccepted()); + applicationGetResponseBean.setAmountRequested(applicationEntity.getAmountRequested()); + applicationGetResponseBean.setDateAccepted(applicationEntity.getDateAccepted()); + applicationGetResponseBean.setDateRejected(applicationEntity.getDateRejected()); if(applicationEntity.getProtocol() != null) { applicationGetResponseBean.setProtocolNumber(applicationEntity.getProtocol().getProtocolNumber()); } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java index acac1b39..7cced04a 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java @@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; +import java.math.BigDecimal; import java.time.Duration; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; @@ -582,6 +583,10 @@ public class ApplicationEvaluationDao { CompanyEntity company = companyService.validateCompany(application.getCompanyId()); response.setCompanyName(company.getCompanyName()); } + response.setAmountAccepted(application.getAmountAccepted()); + response.setAmountRequested(application.getAmountRequested()); + response.setDateAccepted(application.getDateAccepted()); + response.setDateRejected(application.getDateRejected()); } @@ -613,11 +618,15 @@ public class ApplicationEvaluationDao { entity.setIsDeleted(false); setIfUpdated(entity::getNote, entity::setNote, req.getNote()); setIfUpdated(entity::getMotivation, entity::setMotivation, req.getMotivation()); - application.setAmountAccepted(req.getAmountAccepted()); + if(Boolean.TRUE.equals(req.getApplicationStatus().equals(ApplicationStatusForEvaluation.APPROVED)) && (req.getAmountAccepted()==null || req.getAmountAccepted().compareTo(BigDecimal.ZERO) < 0)){ + throw new CustomValidationException(Status.BAD_REQUEST,Translator.toLocale(GepafinConstant.AMOUNT_ACCEPTED_REQUIRED_WHILE_APPROVING_APPLICATION)); + } + if (req.getAmountAccepted() != null && req.getAmountAccepted().compareTo(BigDecimal.ZERO) > 0) { + application.setAmountAccepted(req.getAmountAccepted()); + } actionType = VersionActionTypeEnum.UPDATE; } else { AssignedApplicationsEntity assignedApplicationsEntity = assignedApplicationsService.validateAssignedApplication(assignedApplicationId); - ApplicationEntity application = applicationService.validateApplication(assignedApplicationsEntity.getApplication().getId()); entity = convertToEntity(user, req, assignedApplicationId); actionType = VersionActionTypeEnum.INSERT; diff --git a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java index ba0b5630..91b94b90 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java @@ -63,7 +63,6 @@ public class DashboardDao { widgetResponseBean.setWidget1(createWidget1(requestedUserEntity)); Map widgetBars =getStatistics(requestedUserEntity); widgetResponseBean.setWidgetBars(widgetBars); - widgetResponseBean.setUserActionWidgetList(getUserAction(requestedUserEntity)); return widgetResponseBean; } @@ -97,14 +96,14 @@ public class DashboardDao { private void setAmountRequested(Widget1 widget1, UserEntity requestedUserEntity) { BigDecimal amountRequested = applicationRepository.findTotalAmountRequestedOfApplication(requestedUserEntity.getHub().getId()); if (amountRequested != null) { - widget1.setAmountRequested(amountRequested); + widget1.setTotalAmountRequested(amountRequested); } } private void setAmountAccepted(Widget1 widget1, UserEntity requestedUserEntity) { BigDecimal amountAccepted = applicationRepository.findTotalAmountAcceptedOfApplication(requestedUserEntity.getHub().getId()); if (amountAccepted != null) { - widget1.setAmountAccepted(amountAccepted); + widget1.setTotalAmountAccepted(amountAccepted); } } @@ -194,12 +193,12 @@ public class DashboardDao { return stats; } - public Page getUserAction(UserEntity requestedUserEntity){ - Pageable pageable = PageRequest.of(0, 20); // Get the first 20 records - List roles=List.of(RoleStatusEnum.ROLE_PRE_INSTRUCTOR.getValue(),RoleStatusEnum.ROLE_GEPAFIN_OPERATOR.getValue(),RoleStatusEnum.ROLE_INSTRUCTOR_MANAGER.getValue()); - Page userActionEntities=userActionsRepository.findActionsByRoleNamesAndHubId(roles,requestedUserEntity.getHub().getId(),pageable); - return userActionEntities; - } +// public Page getUserAction(UserEntity requestedUserEntity){ +// Pageable pageable = PageRequest.of(0, 20); // Get the first 20 records +// List roles=List.of(RoleStatusEnum.ROLE_PRE_INSTRUCTOR.getValue(),RoleStatusEnum.ROLE_GEPAFIN_OPERATOR.getValue(),RoleStatusEnum.ROLE_INSTRUCTOR_MANAGER.getValue()); +// Page userActionEntities=userActionsRepository.findActionsByRoleNamesAndHubId(roles,requestedUserEntity.getHub().getId(),pageable); +// return userActionEntities; +// } public ApplicationWidgetResponseBean getApplicationDetails(UserEntity userEntity) { ApplicationWidgetResponseBean applicationWidgetResponseBean = initializeResponseBean(); diff --git a/src/main/java/net/gepafin/tendermanagement/dao/FlowFormDao.java b/src/main/java/net/gepafin/tendermanagement/dao/FlowFormDao.java index 4a42daf7..faec3489 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/FlowFormDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/FlowFormDao.java @@ -309,6 +309,10 @@ public class FlowFormDao { if(applicationEntity.getProtocol() != null) { nextOrPreviousFormResponse.setProtocolNumber(applicationEntity.getProtocol().getProtocolNumber()); } + nextOrPreviousFormResponse.setAmountAccepted(applicationEntity.getAmountAccepted()); + nextOrPreviousFormResponse.setAmountRequested(applicationEntity.getAmountRequested()); + nextOrPreviousFormResponse.setDateAccepted(applicationEntity.getDateAccepted()); + nextOrPreviousFormResponse.setDateRejected(applicationEntity.getDateRejected()); return nextOrPreviousFormResponse; } diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationEvaluationResponse.java b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationEvaluationResponse.java index 7da6d25f..c2fcd6cb 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationEvaluationResponse.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationEvaluationResponse.java @@ -4,6 +4,7 @@ import lombok.Data; import net.gepafin.tendermanagement.enums.ApplicationEvaluationStatusTypeEnum; import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @@ -38,4 +39,8 @@ public class ApplicationEvaluationResponse { private LocalDateTime assignedAt; private String ndg; private String appointmentId; + private BigDecimal amountRequested; + private BigDecimal amountAccepted; + private LocalDateTime dateAccepted; + private LocalDateTime dateRejected; } diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationGetResponseBean.java b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationGetResponseBean.java index aa686023..77048d15 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationGetResponseBean.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationGetResponseBean.java @@ -2,6 +2,7 @@ package net.gepafin.tendermanagement.model.response; import lombok.Data; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @@ -26,6 +27,15 @@ public class ApplicationGetResponseBean { private Long protocolNumber; + private BigDecimal amountRequested; + + private BigDecimal amountAccepted; + + private LocalDateTime dateAccepted; + + private LocalDateTime dateRejected; + + private List form; } diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponse.java b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponse.java index 24ad5a34..1aae69e2 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponse.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponse.java @@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.model.response; import lombok.Data; import net.gepafin.tendermanagement.model.response.ApplicationFormFieldResponseBean; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @@ -37,4 +38,12 @@ public class ApplicationResponse{ private String assignedUserName; + private BigDecimal amountRequested; + + private BigDecimal amountAccepted; + + private LocalDateTime dateAccepted; + + private LocalDateTime dateRejected; + } \ No newline at end of file diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponseBean.java b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponseBean.java index 6b99961f..3c9016bd 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponseBean.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/ApplicationResponseBean.java @@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.model.response; import lombok.Data; import net.gepafin.tendermanagement.model.BaseBean; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @@ -19,6 +20,14 @@ public class ApplicationResponseBean extends BaseBean { private Long protocolNumber; + private BigDecimal amountRequested; + + private BigDecimal amountAccepted; + + private LocalDateTime dateAccepted; + + private LocalDateTime dateRejected; + private List formFields; } diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/NextOrPreviousFormResponse.java b/src/main/java/net/gepafin/tendermanagement/model/response/NextOrPreviousFormResponse.java index 8925e7f6..bea417a1 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/NextOrPreviousFormResponse.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/NextOrPreviousFormResponse.java @@ -3,6 +3,9 @@ package net.gepafin.tendermanagement.model.response; import lombok.Data; import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum; +import java.math.BigDecimal; +import java.time.LocalDateTime; + @Data public class NextOrPreviousFormResponse { @@ -25,6 +28,14 @@ public class NextOrPreviousFormResponse { private Long protocolNumber; private ApplicationStatusTypeEnum applicationStatus; + + private BigDecimal amountRequested; + + private BigDecimal amountAccepted; + + private LocalDateTime dateAccepted; + + private LocalDateTime dateRejected; private FormApplicationResponse applicationFormResponse; diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/SuperAdminWidgetResponseBean.java b/src/main/java/net/gepafin/tendermanagement/model/response/SuperAdminWidgetResponseBean.java index 405a92ac..02744ace 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/SuperAdminWidgetResponseBean.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/SuperAdminWidgetResponseBean.java @@ -14,6 +14,4 @@ public class SuperAdminWidgetResponseBean { private Map widgetBars; - Page userActionWidgetList; - } diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/Widget1.java b/src/main/java/net/gepafin/tendermanagement/model/response/Widget1.java index 0d82d0be..a6b1ad88 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/Widget1.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/Widget1.java @@ -23,8 +23,8 @@ public class Widget1 { private BigDecimal totalActiveFinancing; - private BigDecimal amountRequested; + private BigDecimal totalAmountRequested; - private BigDecimal amountAccepted; + private BigDecimal totalAmountAccepted; } diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java index 542c8cdf..c46c52c7 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/ApplicationRepository.java @@ -54,13 +54,14 @@ public interface ApplicationRepository extends JpaRepository { UserActionEntity findUserActionById(Long id); - -// -// @Query("SELECT ua FROM UserActionEntity ua " + -// "JOIN ua.user u " + -// "WHERE u.roleEntity.roleType IN :roleNames " + -// "AND ua.hub.id = :hubId " + -// "AND ua.isDeleted = false") -// Page findActionsByRoleNamesAndHubId( -// @Param("roleNames") List roleNames, -// @Param("hubId") Long hubId, Pageable pageable); - - @Query("SELECT ua FROM UserActionEntity ua " + - "JOIN UserEntity u ON ua.userId = u.id " + // Join on userId field - "JOIN u.roleEntity r " + // Join the RoleEntity via the UserEntity - "WHERE r.roleType IN :roleNames " + // Filter by role name - "AND ua.hubId = :hubId " + // Filter by hubId - "AND ua.isDeleted = false") - Page findActionsByRoleNamesAndHubId( - @Param("roleNames") List roleNames, - @Param("hubId") Long hubId, - Pageable pageable); - + UserActionEntity findUserActionByIdAndIsDeletedFalse(Long id); } diff --git a/src/main/resources/message_en.properties b/src/main/resources/message_en.properties index 44a27275..c743b3fa 100644 --- a/src/main/resources/message_en.properties +++ b/src/main/resources/message_en.properties @@ -346,3 +346,4 @@ 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. +amount.accepted.required=Amount accepted is required while approving the application. diff --git a/src/main/resources/message_it.properties b/src/main/resources/message_it.properties index 0b22e9e3..14a5dbb5 100644 --- a/src/main/resources/message_it.properties +++ b/src/main/resources/message_it.properties @@ -329,7 +329,6 @@ appointment.created.successfully = Appuntamento creato con successo. error.try.again = Errore di chiamata di servizio durante l'esecuzione dell'operazione. Riprovare. 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. -<<<<<<< HEAD #notification messsages notification.already.in.state=La notifica � gi� nello stato fornito. @@ -339,5 +338,4 @@ 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 +amount.accepted.required=L'importo accettato è obbligatorio durante l'approvazione della domanda. From baba46dc1f680ed7f19d27c44511585ade09fcfb Mon Sep 17 00:00:00 2001 From: rajesh Date: Mon, 13 Jan 2025 13:09:22 +0530 Subject: [PATCH 05/11] Updated code --- .../java/net/gepafin/tendermanagement/dao/ApplicationDao.java | 2 +- .../tendermanagement/dao/ApplicationEvaluationDao.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java index c8185408..77177bc8 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java @@ -870,7 +870,7 @@ public class ApplicationDao { ProtocolEntity protocolEntity = protocolDao.createProtocolEntity(applicationEntity, protocolNumber, userEntity.getHub().getId(),true); applicationEntity.setProtocol(protocolEntity); applicationEntity.setStatus(ApplicationStatusTypeEnum.SUBMIT.getValue()); - applicationEntity.setSubmissionDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now())); + applicationEntity.setSubmissionDate(protocolEntity.getCreatedDate()); applicationEntity = applicationRepository.save(applicationEntity); Map placeHolders=notificationDao.sendNotificationToBeneficiary(applicationEntity,NotificationTypeEnum.APPLICATION_SUBMISSION); notificationDao.sendNotificationToSuperUser(applicationEntity,placeHolders,NotificationTypeEnum.APPLICATION_SUBMISSION); diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java index 019eadf3..c264a078 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationEvaluationDao.java @@ -558,7 +558,7 @@ public class ApplicationEvaluationDao { response.setBeneficiary(beneficiary); response.setNdg(application.getNdg() != null ? application.getNdg() : null); response.setAppointmentId(application.getAppointmentId() != null ? application.getAppointmentId() : null); - response.setSubmissionDate(application.getProtocol().getCreatedDate()); + response.setSubmissionDate(application.getSubmissionDate()); response.setMinScore(call.getThreshold() != null ? call.getThreshold() : null); response.setCallName(application.getCall().getName() != null ? application.getCall().getName() : null); response.setProtocolNumber((application.getProtocol() != null && application.getProtocol().getProtocolNumber() != null) ? application.getProtocol().getProtocolNumber() : null); @@ -1386,7 +1386,7 @@ public class ApplicationEvaluationDao { String beneficiary = String.join(" ", firstName, lastName).trim(); response.setBeneficiary(beneficiary); - response.setSubmissionDate(application.getProtocol().getCreatedDate()); + response.setSubmissionDate(application.getSubmissionDate()); response.setNdg(application.getNdg() != null ? application.getNdg() : null); response.setAppointmentId(application.getAppointmentId() != null ? application.getAppointmentId() : null); response.setCallName(application.getCall().getName() != null ? application.getCall().getName() : null); From aec649564975ab593a18606a0bf6a4e25c548ca9 Mon Sep 17 00:00:00 2001 From: nisha Date: Mon, 13 Jan 2025 15:53:28 +0530 Subject: [PATCH 06/11] Updated changes for GEPAFINBE-127 --- .../tendermanagement/constants/GepafinConstant.java | 8 ++++++++ .../gepafin/tendermanagement/dao/DashboardDao.java | 13 +++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java index f984d0e0..7fe87275 100644 --- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java +++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java @@ -361,5 +361,13 @@ public class GepafinConstant { public static final String GET_STATUS_CODE_STRING = "status"; public static final String MESSAGE_STRING = "message"; public static final String AMOUNT_ACCEPTED_REQUIRED_WHILE_APPROVING_APPLICATION="amount.accepted.required"; + public static final String CALL_NAME="callName"; + public static final String NUMBER_OF_APPLICATIONS="numberOfApplications"; + public static final String STATUS="status"; + public static final String COUNT="count"; + public static final String APPLICATION_PER_CALL="applicationPerCall"; + public static final String APPLICATION_PER_STATUS="applicationPerStatus"; + + } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java index 91b94b90..8f3a55f1 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java @@ -1,5 +1,6 @@ package net.gepafin.tendermanagement.dao; +import net.gepafin.tendermanagement.constants.GepafinConstant; import net.gepafin.tendermanagement.entities.CompanyEntity; import net.gepafin.tendermanagement.entities.UserActionEntity; import net.gepafin.tendermanagement.entities.UserEntity; @@ -175,19 +176,19 @@ public class DashboardDao { // Get applications per call List applicationsPerCall = applicationRepository.findApplicationsPerCallWithName(requestedUser.getHub().getId()); - stats.put("APPLICATION_PER_CALL", applicationsPerCall.stream().map(result -> { + stats.put(GepafinConstant.APPLICATION_PER_CALL, applicationsPerCall.stream().map(result -> { Map callData = new HashMap<>(); - callData.put("CALL", result[0]); // Call name - callData.put("APPLICATIONS", result[1]); // Application count + callData.put(GepafinConstant.CALL_NAME, result[0]); // Call name + callData.put(GepafinConstant.NUMBER_OF_APPLICATIONS, result[1]); // Application count return callData; }).toList()); // Get applications grouped by status List applicationsByStatus = applicationRepository.findApplicationsByStatus(requestedUser.getHub().getId()); - stats.put("APPLICATION_STATUSES", applicationsByStatus.stream().map(result -> { + stats.put(GepafinConstant.APPLICATION_PER_STATUS, applicationsByStatus.stream().map(result -> { Map statusData = new HashMap<>(); - statusData.put("STATUS", result[0]); // Application status - statusData.put("COUNT", result[1]); // Count of applications + statusData.put(GepafinConstant.STATUS, result[0]); // Application status + statusData.put(GepafinConstant.NUMBER_OF_APPLICATIONS, result[1]); // Count of applications return statusData; }).toList()); From f9e9673d9391184070ce272bf7b3d7b8a139701f Mon Sep 17 00:00:00 2001 From: rajesh Date: Mon, 13 Jan 2025 16:28:01 +0530 Subject: [PATCH 07/11] Done ticket GEPAFINBE-128 --- .../constants/GepafinConstant.java | 2 + .../tendermanagement/dao/UserActionDao.java | 138 ++++++++++ .../entities/RoleActionContextEntity.java | 29 ++ .../enums/TimePeriodEnum.java | 22 ++ .../enums/UserActionContextEnum.java | 4 +- .../response/SummaryPageResponseBean.java | 19 ++ .../response/UserActionResponseBean.java | 22 ++ .../AssignedApplicationsRepository.java | 4 +- .../RoleActionContextRepository.java | 16 ++ .../repositories/UserActionsRepository.java | 16 +- .../service/UserActionService.java | 9 + .../service/impl/UserActionServiceImpl.java | 28 ++ .../web/rest/api/UserActionApi.java | 33 +++ .../api/impl/UserActionApiController.java | 43 +++ .../db/changelog/db.changelog-1.0.0.xml | 26 ++ .../insert_action_context_data_09_01_2025.sql | 249 ++++++++++++++++++ src/main/resources/message_en.properties | 2 + src/main/resources/message_it.properties | 4 +- 18 files changed, 661 insertions(+), 5 deletions(-) create mode 100644 src/main/java/net/gepafin/tendermanagement/dao/UserActionDao.java create mode 100644 src/main/java/net/gepafin/tendermanagement/entities/RoleActionContextEntity.java create mode 100644 src/main/java/net/gepafin/tendermanagement/enums/TimePeriodEnum.java create mode 100644 src/main/java/net/gepafin/tendermanagement/model/response/SummaryPageResponseBean.java create mode 100644 src/main/java/net/gepafin/tendermanagement/model/response/UserActionResponseBean.java create mode 100644 src/main/java/net/gepafin/tendermanagement/repositories/RoleActionContextRepository.java create mode 100644 src/main/java/net/gepafin/tendermanagement/service/UserActionService.java create mode 100644 src/main/java/net/gepafin/tendermanagement/service/impl/UserActionServiceImpl.java create mode 100644 src/main/java/net/gepafin/tendermanagement/web/rest/api/UserActionApi.java create mode 100644 src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/UserActionApiController.java create mode 100644 src/main/resources/db/dump/insert_action_context_data_09_01_2025.sql diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java index bbbeb1eb..93a79d21 100644 --- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java +++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java @@ -353,5 +353,7 @@ public class GepafinConstant { 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"; + + public static final String USER_ACTION_FETCHED_SUCCESSFULLY = "user.action.fetched.successfully"; } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/UserActionDao.java b/src/main/java/net/gepafin/tendermanagement/dao/UserActionDao.java new file mode 100644 index 00000000..2b70c5a1 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/dao/UserActionDao.java @@ -0,0 +1,138 @@ +package net.gepafin.tendermanagement.dao; + +import jakarta.persistence.criteria.Predicate; +import jakarta.servlet.http.HttpServletRequest; +import net.gepafin.tendermanagement.entities.RoleActionContextEntity; +import net.gepafin.tendermanagement.entities.UserActionEntity; +import net.gepafin.tendermanagement.entities.UserEntity; +import net.gepafin.tendermanagement.enums.TimePeriodEnum; +import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean; +import net.gepafin.tendermanagement.model.response.UserActionResponseBean; +import net.gepafin.tendermanagement.repositories.AssignedApplicationsRepository; +import net.gepafin.tendermanagement.repositories.RoleActionContextRepository; +import net.gepafin.tendermanagement.repositories.UserActionsRepository; +import net.gepafin.tendermanagement.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.stream.Collectors; + +@Component +public class UserActionDao { + + @Autowired + private UserService userService; + + @Autowired + private UserActionsRepository userActionsRepository; + + @Autowired + private AssignedApplicationsRepository assignedApplicationsRepository; + + @Autowired + private RoleActionContextRepository roleActionContextRepository; + + public SummaryPageResponseBean getUserAction(HttpServletRequest request, UserEntity userEntity, TimePeriodEnum timeFilter, String actionContext){ + Long numberOfLoginAttempts = userActionsRepository.countUserLoginAttempts(userEntity.getId()); + Long applicationsProcessed = assignedApplicationsRepository.countAssignedApplicationsByUserId(userEntity.getId()); + + List actionContextLabel = roleActionContextRepository.findByRoleIdAndIsDeletedFalse(userEntity.getRoleEntity().getId()); + + List userActions = getFilterUserActions(userEntity.getId(),timeFilter,actionContext); + + return createSummaryPageResponse(userEntity,numberOfLoginAttempts,applicationsProcessed,actionContextLabel,userActions); + } + + public SummaryPageResponseBean createSummaryPageResponse(UserEntity user, Long numberOfLoginAttempts, Long applicationsProcessed, List actionContextLabel, List userActions){ + SummaryPageResponseBean response = new SummaryPageResponseBean(); + response.setRole(user.getRoleEntity().getRoleName()); + response.setLastLogin(user.getLastLogin()); + response.setRegistrationDate(user.getCreatedDate()); + response.setUsername(user.getFirstName()); + response.setEmail(user.getEmail()); + response.setNumberOfLoginAttempts(numberOfLoginAttempts); + response.setApplicationsProcessed(applicationsProcessed); + List actionContextNames = actionContextLabel.stream() + .map(RoleActionContextEntity::getActionContext) + .collect(Collectors.toList()); + + response.setActionContextLabels(actionContextNames); + + List userAction = convertEntityToResponse(userActions); + response.setUserActions(userAction); + return response; + } + + + public List getFilterUserActions(Long userId ,TimePeriodEnum timeFilter, String actionContext) { + LocalDateTime endDate = LocalDateTime.now(); + LocalDateTime startDate = (timeFilter != null) ? getStartTimeFromFilter(timeFilter) : null; + Pageable pageable = PageRequest.of(0, 25); + + Specification spec = getUserActionsSpecification(userId, startDate, endDate, actionContext); + Page pageResult = userActionsRepository.findAll(spec, pageable); + + return pageResult.getContent(); + } + + private LocalDateTime getStartTimeFromFilter(TimePeriodEnum timeFilter) { + LocalDateTime now = LocalDateTime.now(); + + if (timeFilter.equals(TimePeriodEnum.LAST_WEEK)) { + return now.minusDays(7); + } else if (timeFilter.equals(TimePeriodEnum.LAST_QUARTER)) { + return now.minusMonths(4); + } else if (timeFilter.equals(TimePeriodEnum.LAST_SEMESTER)) { + return now.minusMonths(6); + } else if (timeFilter.equals(TimePeriodEnum.LAST_YEAR)) { + return now.minusYears(1); + } else { + return null; + } + } + + public Specification getUserActionsSpecification(Long userId, LocalDateTime startDate, LocalDateTime endDate, String actionContext) { + return (root, query, builder) -> { + Predicate predicate = builder.isFalse(root.get("isDeleted")); + + predicate = builder.and(predicate, builder.equal(root.get("userId"), userId)); + + if (startDate != null && endDate != null) { + predicate = builder.and(predicate, builder.between(root.get("createdDate"), startDate, endDate)); + } + + if (actionContext != null) { + predicate = builder.and(predicate, builder.equal(root.get("actionContext"), actionContext)); + } + + query.orderBy(builder.desc(root.get("createdDate"))); + + return predicate; + }; + } + + private List convertEntityToResponse(List userActions) { + return userActions.stream().map(action -> { + UserActionResponseBean responseBean = new UserActionResponseBean(); + responseBean.setId(action.getId()); + responseBean.setUserId(action.getUserId()); + responseBean.setActionType(action.getActionType()); + responseBean.setRequestBody(action.getRequestBody()); + responseBean.setLoginAttemptId(action.getLoginAttemptId()); + responseBean.setIpAddress(action.getIpAddress()); + responseBean.setActionContext(action.getActionContext()); + responseBean.setHubId(action.getHubId()); + responseBean.setUrl(action.getUrl()); + responseBean.setResponse(action.getResponse()); + responseBean.setCreatedDate(action.getCreatedDate()); + responseBean.setUpdatedDate(action.getUpdatedDate()); + return responseBean; + }).collect(Collectors.toList()); + } +} diff --git a/src/main/java/net/gepafin/tendermanagement/entities/RoleActionContextEntity.java b/src/main/java/net/gepafin/tendermanagement/entities/RoleActionContextEntity.java new file mode 100644 index 00000000..a3ff676f --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/entities/RoleActionContextEntity.java @@ -0,0 +1,29 @@ +package net.gepafin.tendermanagement.entities; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import lombok.Data; + +@Entity +@Data +@Table(name ="role_action_context") +public class RoleActionContextEntity extends BaseEntity { + + @Column(name = "action_context") + private String actionContext; + + @Column(name = "role_id") + private Long roleId; + + @Column(name="is_deleted") + private Boolean isDeleted; + + @Column(name = "is_viewed") + private Boolean isViewed; + + @Column(name = "description") + private String description; + + +} diff --git a/src/main/java/net/gepafin/tendermanagement/enums/TimePeriodEnum.java b/src/main/java/net/gepafin/tendermanagement/enums/TimePeriodEnum.java new file mode 100644 index 00000000..fc342727 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/enums/TimePeriodEnum.java @@ -0,0 +1,22 @@ +package net.gepafin.tendermanagement.enums; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimePeriodEnum { + + LAST_WEEK ("LAST_WEEK"), + LAST_QUARTER("LAST_QUARTER"), + LAST_SEMESTER("LAST_SEMESTER"), + LAST_YEAR("LAST_YEAR"); + + private String value; + + TimePeriodEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } +} diff --git a/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java b/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java index 20f917fe..0b7b8c63 100644 --- a/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java +++ b/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java @@ -161,7 +161,9 @@ public enum UserActionContextEnum { /** appointment action context **/ CHECK_OR_CREATE_NDG_CODE("CHECK_OR_CREATE_NDG_CODE"), CREATE_APPOINTMENT("CREATE_APPOINTMENT"), - UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM("UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM"); + UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM("UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM"), + + GET_USER_ACTION("GET_USER_ACTION"); private final String value; diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/SummaryPageResponseBean.java b/src/main/java/net/gepafin/tendermanagement/model/response/SummaryPageResponseBean.java new file mode 100644 index 00000000..aa4d96e4 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/model/response/SummaryPageResponseBean.java @@ -0,0 +1,19 @@ +package net.gepafin.tendermanagement.model.response; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class SummaryPageResponseBean { + private String username; + private String email; + private String role; + private LocalDateTime lastLogin; + private LocalDateTime registrationDate; + private Long numberOfLoginAttempts; + private Long applicationsProcessed; + private List actionContextLabels; + private List userActions; +} diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/UserActionResponseBean.java b/src/main/java/net/gepafin/tendermanagement/model/response/UserActionResponseBean.java new file mode 100644 index 00000000..f8b15d3f --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/model/response/UserActionResponseBean.java @@ -0,0 +1,22 @@ +package net.gepafin.tendermanagement.model.response; + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class UserActionResponseBean { + private Long id; + private Long userId; + private String actionType; + private String requestBody; + private Long loginAttemptId; + private String actionContext; + private String ipAddress; + private String methodType; + private Long hubId; + private String url; + private String response; + private LocalDateTime createdDate; + private LocalDateTime updatedDate; +} diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/AssignedApplicationsRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/AssignedApplicationsRepository.java index 164dcb0a..dac54c98 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/AssignedApplicationsRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/AssignedApplicationsRepository.java @@ -20,6 +20,6 @@ public interface AssignedApplicationsRepository extends JpaRepository 'CLOSE'") + Long countAssignedApplicationsByUserId(@Param("userId") Long userId); } diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/RoleActionContextRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/RoleActionContextRepository.java new file mode 100644 index 00000000..4af9a314 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/repositories/RoleActionContextRepository.java @@ -0,0 +1,16 @@ +package net.gepafin.tendermanagement.repositories; + +import net.gepafin.tendermanagement.entities.RoleActionContextEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.stereotype.Repository; +import java.util.List; + +@Repository +public interface RoleActionContextRepository extends JpaRepository, JpaSpecificationExecutor { + + List findByRoleIdAndIsDeletedFalse(Long roleId); + + + +} diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/UserActionsRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/UserActionsRepository.java index f0163c47..a1bfbc7f 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/UserActionsRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/UserActionsRepository.java @@ -2,9 +2,23 @@ package net.gepafin.tendermanagement.repositories; import net.gepafin.tendermanagement.entities.UserActionEntity; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; +import org.springframework.data.domain.Pageable; +import java.time.LocalDateTime; +import java.util.List; @Repository -public interface UserActionsRepository extends JpaRepository { +public interface UserActionsRepository extends JpaRepository , JpaSpecificationExecutor { UserActionEntity findUserActionById(Long id); + + @Query("SELECT COUNT(u) FROM UserActionEntity u " + + "WHERE u.userId = :userId " + + "AND u.actionContext = 'USER_LOGIN' " + + "AND u.isDeleted = false") + Long countUserLoginAttempts(@Param("userId") Long userId); + + } diff --git a/src/main/java/net/gepafin/tendermanagement/service/UserActionService.java b/src/main/java/net/gepafin/tendermanagement/service/UserActionService.java new file mode 100644 index 00000000..1e010919 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/service/UserActionService.java @@ -0,0 +1,9 @@ +package net.gepafin.tendermanagement.service; + +import jakarta.servlet.http.HttpServletRequest; +import net.gepafin.tendermanagement.enums.TimePeriodEnum; +import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean; + +public interface UserActionService { + public SummaryPageResponseBean getUserAction(HttpServletRequest request, Long userId, TimePeriodEnum timeFilter, String actionContext); +} diff --git a/src/main/java/net/gepafin/tendermanagement/service/impl/UserActionServiceImpl.java b/src/main/java/net/gepafin/tendermanagement/service/impl/UserActionServiceImpl.java new file mode 100644 index 00000000..334dd933 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/service/impl/UserActionServiceImpl.java @@ -0,0 +1,28 @@ +package net.gepafin.tendermanagement.service.impl; + +import jakarta.servlet.http.HttpServletRequest; +import net.gepafin.tendermanagement.dao.UserActionDao; +import net.gepafin.tendermanagement.entities.UserEntity; +import net.gepafin.tendermanagement.enums.TimePeriodEnum; +import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean; +import net.gepafin.tendermanagement.service.UserActionService; +import net.gepafin.tendermanagement.util.Validator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class UserActionServiceImpl implements UserActionService { + + @Autowired + private UserActionDao userActionDao; + + @Autowired + private Validator validator; + + + @Override + public SummaryPageResponseBean getUserAction(HttpServletRequest request, Long userId, TimePeriodEnum timeFilter, String actionContext) { + UserEntity user = validator.validateUserId(request, userId); + return userActionDao.getUserAction(request,user,timeFilter,actionContext); + } +} diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/UserActionApi.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/UserActionApi.java new file mode 100644 index 00000000..e0e62e84 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/UserActionApi.java @@ -0,0 +1,33 @@ +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.TimePeriodEnum; +import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean; +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.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestParam; + +public interface UserActionApi { + @Operation(summary = "Api to get user action", + 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 = "/{userId}", produces = { "application/json" }) + ResponseEntity> getUserAction(HttpServletRequest request, @Parameter(description = "The user id", required = true) @PathVariable("userId") Long userId, + @Parameter(description = "Time Filter") @RequestParam(value = "timeFilter", required = false) TimePeriodEnum timeFilter, + @Parameter(description = "Action Context") @RequestParam(value = "actionContext", required = false) String actionContext); +} diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/UserActionApiController.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/UserActionApiController.java new file mode 100644 index 00000000..3aa083c5 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/UserActionApiController.java @@ -0,0 +1,43 @@ +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.TimePeriodEnum; +import net.gepafin.tendermanagement.enums.UserActionContextEnum; +import net.gepafin.tendermanagement.enums.UserActionLogsEnum; +import net.gepafin.tendermanagement.model.request.UserActionRequest; +import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean; +import net.gepafin.tendermanagement.model.util.Response; +import net.gepafin.tendermanagement.service.UserActionService; +import net.gepafin.tendermanagement.util.LoggingUtil; +import net.gepafin.tendermanagement.web.rest.api.UserActionApi; +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; + +@RestController +@RequestMapping("${openapi.gepafin.base-path:/v1/userAction}") +public class UserActionApiController implements UserActionApi { + + @Autowired + private UserActionService userActionService; + + @Autowired + private LoggingUtil loggingUtil; + + @Override + public ResponseEntity> getUserAction(HttpServletRequest request, Long userId, TimePeriodEnum timeFilter, String actionContext) { + + /** This code is responsible for creating user action logs for the "get user action" operation. **/ + loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW) + .actionContext(UserActionContextEnum.GET_USER_ACTION).build()); + SummaryPageResponseBean userActionResponse= userActionService.getUserAction(request,userId,timeFilter,actionContext); + return ResponseEntity.status(HttpStatus.OK) + .body(new Response<>(userActionResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.USER_ACTION_FETCHED_SUCCESSFULLY))); + } +} + diff --git a/src/main/resources/db/changelog/db.changelog-1.0.0.xml b/src/main/resources/db/changelog/db.changelog-1.0.0.xml index 0fdebf9e..6c88daed 100644 --- a/src/main/resources/db/changelog/db.changelog-1.0.0.xml +++ b/src/main/resources/db/changelog/db.changelog-1.0.0.xml @@ -2123,4 +2123,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/db/dump/insert_action_context_data_09_01_2025.sql b/src/main/resources/db/dump/insert_action_context_data_09_01_2025.sql new file mode 100644 index 00000000..264c92b1 --- /dev/null +++ b/src/main/resources/db/dump/insert_action_context_data_09_01_2025.sql @@ -0,0 +1,249 @@ +INSERT INTO role_action_context (action_context, role_id, is_deleted, is_viewed, description ,created_date, updated_date) VALUES +('CREATE_CALL_STEP_1', 2, false, false,'CREATE_CALL_STEP_1', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_CALL_STEP_1', 2, false, false, 'UPDATE_CALL_STEP_1','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_UPDATE_CALL_STEP_2', 2, false, false, 'CREATE_UPDATE_CALL_STEP_2','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('VALIDATE_CALL', 2, false, false,'CONVALIDA CHIAMATA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_CALL_STATUS', 2, false, false, 'AGGIORNA STATO CHIAMA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_CALL', 1, false, false, 'OTTIENI CHIAMA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_CALL', 2, false, false, 'OTTIENI CHIAMA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_CALL_DOCUMENT', 2 ,false, false, 'SCARICA DOCUMENTO CHIAMA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_CALL_DOCUMENT', 1 ,false, false,'SCARICA DOCUMENTO CHIAMA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_CALL_DOCUMENT', 3,false, false,'SCARICA DOCUMENTO CHIAMA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_CALL_DOCUMENT', 5 , false, false,'SCARICA DOCUMENTO CHIAMA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_USER', 1, false, false, 'CREA UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_USER', 2, false, false, 'CREA UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('USER_LOGIN', 1, false, false, 'ACCESSO UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('USER_LOGIN', 2, false, false, 'ACCESSO UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('USER_LOGIN', 3, false, false, 'ACCESSO UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('USER_LOGIN', 5, false, false, 'ACCESSO UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('LOGOUT_USER', 1, false, false,'LOGOUT UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('LOGOUT_USER', 2, false, false,'LOGOUT UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('LOGOUT_USER', 3, false, false,'LOGOUT UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('LOGOUT_USER', 5, false, false,'LOGOUT UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_USER', 2, false, false, 'OTTIENI UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_USER_DETAILS', 2, false, false, 'AGGIORNA DETTAGLI UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_USER_DETAILS', 1, false, false, 'AGGIORNA DETTAGLI UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_USER_DETAILS', 3, false, false, 'AGGIORNA DETTAGLI UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_USER_DETAILS', 5, false, false,'AGGIORNA DETTAGLI UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_USER', 2, false, false, 'ELIMINA UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('VALIDATE_NEW_USER_WITH_SPID_TOKEN', 1, false, false, 'VALIDA NUOVO UTENTE CON TOKEN SPID','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('VALIDATE_EXISTING_USER_WITH_SPID_TOKEN', 1, false, false,'VALIDA UTENTE ESISTENTE CON TOKEN SPID','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_VALID_USER_DETAILS', 1, false, false, 'OTTIENI DETTAGLI UTENTE VALIDO','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_VALID_USER_DETAILS', 2, false, false,'OTTIENI DETTAGLI UTENTE VALIDO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_USERS_BY_ROLE', 2, false, false,'OTTIENI TUTTI GLI UTENTI PER RUOLO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_USERS_BY_ROLE', 5, false, false,'OTTIENI TUTTI GLI UTENTI PER RUOLO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('GET_APPLICATION', 2, false, false, 'OTTIENI APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION', 1, false, false, 'OTTIENI APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION', 3, false, false, 'OTTIENI APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION', 5, false, false, 'OTTIENI APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_UPDATE_APPLICATION_FORM', 1, false, false, 'CREA/AGGIORNA FORM APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_UPDATE_APPLICATION_FORM', 2, false, false, 'CREA/AGGIORNA FORM APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_APPLICATION', 1, false, false, 'CREA APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_APPLICATION', 2, false, false, 'CREA APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_APPLICATION', 1, false, false, 'ELIMINA APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_APPLICATION', 2, false, false, 'ELIMINA APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_APPLICATION', 1, false, false, 'OTTIENI TUTTE LE APPLICAZIONI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_APPLICATION', 2, false, false, 'OTTIENI TUTTE LE APPLICAZIONI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('UPDATE_APPLICATION_STATUS', 2, false, false, 'AGGIORNA STATO DELL APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('VALIDATE_APPLICATION', 2, false, false, 'VALIDA APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_SIGNED_DOCUMENT', 2, false, false, 'CARICA DOCUMENTO FIRMATO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_PDF', 2, false, false, 'SCARICA PDF', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_SIGNED_DOCUMENT', 2, false, false, 'OTTIENI DOCUMENTO FIRMATO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_NEXT_PREVIOUS_FORM', 2, false, false, 'OTTIENI FORM SUCCESSIVO/PRECEDENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_APPLICATION_DOC_ZIP', 2, false, false, 'SCARICA DOCUMENTI DELL APPLICAZIONE IN ZIP', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + + +('UPDATE_APPLICATION_STATUS', 1, false, false, 'AGGIORNA STATO DELL APPLICAZIONE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('VALIDATE_APPLICATION', 1, false, false,'CARICA DOCUMENTO FIRMATO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_SIGNED_DOCUMENT', 1, false, false, 'CARICA DOCUMENTO FIRMATO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_PDF', 1, false, false, 'SCARICA PDF', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_SIGNED_DOCUMENT', 1, false, false, 'OTTIENI DOCUMENTO FIRMATO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_NEXT_PREVIOUS_FORM', 1, false, false, 'OTTIENI FORM SUCCESSIVO/PRECEDENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_APPLICATION_DOC_ZIP', 1, false, false, 'SCARICA DOCUMENTI DELL APPLICAZIONE IN ZIP', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_FAQ', 2, false, false, 'CREA FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_FAQ', 2, false, false, 'OTTIENI FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_FAQ_DETAILS', 2, false, false, 'AGGIORNA DETTAGLI FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_FAQ', 2, false, false, 'ELIMINA FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_FAQ', 1, false, false, 'CREA FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_FAQ', 1, false, false, 'OTTIENI FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_FAQ_DETAILS', 1, false, false, 'AGGIORNA DETTAGLI FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_FAQ', 1, false, false, 'ELIMINA FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_COMPANY', 1, false, false, 'CREA AZIENDA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY', 1, false, false, 'OTTIENI AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY', 2, false, false, 'OTTIENI AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY', 5, false, false, 'OTTIENI AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY', 3, false, false, 'OTTIENI AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_COMPANY', 1, false, false, 'AGGIORNA AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_COMPANY', 2, false, false, 'ELIMINA AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_COMPANY', 1, false, false, 'ELIMINA AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_COMPANY_DELEGATION', 1, false, false, 'CARICA DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_COMPANY_DELEGATION_TEMPLATE', 1, false, false, 'SCARICA MODELLO DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_DELEGATION', 1, false, false, 'OTTIENI DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_DELEGATION', 2, false, false, 'OTTIENI DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_DELEGATION', 3, false, false, 'OTTIENI DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_DELEGATION', 5, false, false, 'OTTIENI DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_COMPANY_DELEGATION', 1, false, false, 'ELIMINA DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CHECK_COMPANY_VAT_NUMBER', 1, false, false, 'VERIFICA PARTITA IVA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CHECK_COMPANY_VAT_NUMBER', 2, false, false, 'VERIFICA PARTITA IVA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_BY_USER', 2, false, false, 'OTTIENI AZIENDA PER UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_BY_USER', 1, false, false, 'OTTIENI AZIENDA PER UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('REMOVE_COMPANY_FROM_USER', 2, false, false, 'RIMUOVI AZIENDA DA UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + + +('CREATE_LOOKUP_DATA', 2, false, false, 'CREA DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_LOOKUP_DATA', 2, false, false, 'ELIMINA DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_LOOKUP_DATA', 2, false, false, 'AGGIORNA DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA', 2, false, false, 'OTTIENI DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA', 3, false, false, 'OTTIENI DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA', 5, false, false, 'OTTIENI DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA_BY_TYPE', 2, false, false, 'OTTIENI DATI DI RIFERIMENTO PER TIPO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA_BY_TYPE', 3, false, false, 'OTTIENI DATI DI RIFERIMENTO PER TIPO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA_BY_TYPE', 5, false, false, 'OTTIENI DATI DI RIFERIMENTO PER TIPO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_HUB', 2, false, false, 'CREA HUB', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_HUB', 2, false, false, 'OTTIENI HUB', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_HUB', 2, false, false, 'ELIMINA HUB', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_HUB', 2, false, false, 'AGGIORNA HUB', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_HUB', 2, false, false, 'OTTIENI TUTTI GLI HUB', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_HUB_BY_UUID', 2, false, false, 'OTTIENI HUB PER UUID', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_AMENDMENT', 3, false, false, 'CREA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_AMENDMENT', 5, false, false, 'CREA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT', 3, false, false, 'OTTIENI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT', 5, false, false, 'OTTIENI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CLOSE_AMENDMENT', 3, false, false, 'CHIUDI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CLOSE_AMENDMENT', 5, false, false, 'CHIUDI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_AMENDMENT', 3, false, false, 'AGGIORNA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_AMENDMENT', 5, false, false, 'AGGIORNA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_AMENDMENT', 3, false, false, 'ELIMINA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_AMENDMENT', 5, false, false, 'ELIMINA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_AMENDMENT_STATUS', 3, false, false, 'AGGIORNA STATO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_AMENDMENT_STATUS', 5, false, false, 'AGGIORNA STATO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_AMENDMENT_BY_PREINSTRUCTOR_USER_ID', 3, false, false, 'OTTIENI TUTTE LE MODIFICHE PER ID UTENTE PREIISTRUTTORE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_AMENDMENT_BY_PREINSTRUCTOR_USER_ID', 5, false, false, 'OTTIENI TUTTE LE MODIFICHE PER ID UTENTE PREIISTRUTTORE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_AMENDMENT_BY_BENEFICIARY_USER_ID', 1, false, false, 'OTTIENI TUTTE LE MODIFICHE PER ID UTENTE BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT_BY_APPLICATION_ID', 3, false, false, 'OTTIENI MODIFICA PER ID DOMANDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT_BY_APPLICATION_ID', 5, false, false, 'OTTIENI MODIFICA PER ID DOMANDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('EXTEND_RESPONSE_DAYS_FOR_AMENDMENT', 3, false, false, 'ESTENDI GIORNI RISPOSTA PER MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('EXTEND_RESPONSE_DAYS_FOR_AMENDMENT', 5, false, false, 'ESTENDI GIORNI RISPOSTA PER MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION_DATA_FOR_AMENDMENT', 3, false, false, 'OTTIENI DATI DOMANDA PER MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION_DATA_FOR_AMENDMENT', 5, false, false, 'OTTIENI DATI DOMANDA PER MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + + +('CREATE_UPDATE_APPLICATION_EVALUATION', 3, false, false, 'CREA/AGGIORNA VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_UPDATE_APPLICATION_EVALUATION', 5, false, false, 'CREA/AGGIORNA VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION_EVALUATION', 3, false, false, 'OTTIENI VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION_EVALUATION', 5, false, false, 'OTTIENI VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_APPLICATION_EVALUATION', 3, false, false, 'ELIMINA VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_APPLICATION_EVALUATION', 5, false, false, 'ELIMINA VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_BENEFICIARY_PREFERRED_CALL', 2, false, false, 'CREA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_BENEFICIARY_PREFERRED_CALL', 1, false, false, 'CREA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_BENEFICIARY_PREFERRED_CALL', 2, false, false, 'ELIMINA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_BENEFICIARY_PREFERRED_CALL', 1, false, false, 'ELIMINA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_BENEFICIARY_PREFERRED_CALL', 1, false, false, 'OTTIENI CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_BENEFICIARY_PREFERRED_CALL', 2, false, false, 'OTTIENI CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_BENEFICIARY_PREFERRED_CALL', 2, false, false, 'AGGIORNA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_BENEFICIARY_PREFERRED_CALL', 1, false, false, 'AGGIORNA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_ASSIGNED_APPLICATION', 2, false, false, 'CREA APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_ASSIGNED_APPLICATION', 5, false, false, 'CREA APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_ASSIGNED_APPLICATION', 2, false, false, 'ELIMINA APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_ASSIGNED_APPLICATION', 5, false, false, 'ELIMINA APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ASSIGNED_APPLICATION', 2, false, false, 'OTTIENI APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ASSIGNED_APPLICATION', 3, false, false, 'OTTIENI APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ASSIGNED_APPLICATION', 5, false, false, 'OTTIENI APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_ASSIGNED_APPLICATION_DETAILS', 2, false, false, 'AGGIORNA DETTAGLI APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_ASSIGNED_APPLICATION_DETAILS', 5, false, false, 'AGGIORNA DETTAGLI APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_FORM_FIELD', 2, false, false, 'CREA CAMPO MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_FORM_FIELD', 2, false, false, 'AGGIORNA CAMPO MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_FORM_FIELD', 2, false, false, 'OTTIENI CAMPO MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_FORM_FIELD', 2, false, false, 'ELIMINA CAMPO MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('UPLOAD_CALL_DOCUMENT', 2, false, false, 'CARICA DOCUMENTO CHIAMATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_CALL_IMAGES', 2, false, false, 'CARICA IMMAGINI CHIAMATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_APPLICATION_DOCUMENT', 1, false, false, 'CARICA DOCUMENTO APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_APPLICATION_IMAGES', 1, false, false, 'CARICA IMMAGINI APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_DOCUMENT', 2, false, false, 'ELIMINA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_DOCUMENT', 1, false, false, 'ELIMINA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_DOCUMENT', 3, false, false, 'ELIMINA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_DOCUMENT', 5, false, false, 'ELIMINA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_DOCUMENT', 2, false, false, 'AGGIORNA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_DOCUMENT', 1, false, false, 'AGGIORNA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_DOCUMENT', 3, false, false, 'AGGIORNA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_DOCUMENT', 5, false, false, 'AGGIORNA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_IMAGES', 2, false, false, 'AGGIORNA IMMAGINI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_IMAGES', 1, false, false, 'AGGIORNA IMMAGINI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_IMAGES', 3, false, false, 'AGGIORNA IMMAGINI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_IMAGES', 5, false, false, 'AGGIORNA IMMAGINI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DOCUMENT', 2, false, false, 'OTTIENI DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DOCUMENT', 1, false, false, 'OTTIENI DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DOCUMENT', 3, false, false, 'OTTIENI DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DOCUMENT', 5, false, false, 'OTTIENI DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + + +('UPLOAD_AMENDMENT_DOCUMENT', 3, false, false, 'CARICA DOCUMENTO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_AMENDMENT_DOCUMENT', 5, false, false, 'CARICA DOCUMENTO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_AMENDMENT_IMAGES', 3, false, false, 'CARICA IMMAGINI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_AMENDMENT_IMAGES', 5, false, false, 'CARICA IMMAGINI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_DOCUMENT', 3, false, false, 'CARICA DOCUMENTO VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_DOCUMENT', 5, false, false, 'CARICA DOCUMENTO VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_IMAGES', 3, false, false, 'CARICA IMMAGINI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_IMAGES', 5, false, false, 'CARICA IMMAGINI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_UPDATE_FLOW', 2, false, false, 'CREA/AGGIORNA FLUSSO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_FLOW', 2, false, false, 'OTTIENI FLUSSO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('GET_LOGIN_ATTEMPT_LIST', 2, false, false, 'OTTIENI LISTA TENTATIVI ACCESSO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('ADD_LOGIN_ATTEMPT', 2, false, false, 'AGGIUNGI TENTATIVO ACCESSO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('GET_DASHBOARD_WIDGET_FOR_SUPER_ADMIN', 2, false, false, 'OTTENERE WIDGET CRUSCOTTO PER SUPER ADMIN', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DASHBOARD_WIDGET_FOR_BENEFICIARY', 1, false, false, 'OTTENERE WIDGET CRUSCOTTO PER BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('GET_EVALUATION_CRITERIA', 2, false, false, 'OTTENERE CRITERI DI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_EVALUATION_CRITERIA', 2, false, false, 'AGGIORNARE CRITERI DI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_EVALUATION_CRITERIA', 2, false, false, 'ELIMINARE CRITERI DI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_EVALUATION_CRITERIA', 2, false, false, 'CREARE CRITERI DI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_DOC', 3, false, false, 'CARICA DOCUMENTO VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_DOC', 5, false, false, 'CARICA DOCUMENTO VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + + +('ADD_COMMENT_TO_AMENDMENT_REQUEST', 3, false, false, 'AGGIUNGI COMMENTO ALLA RICHIESTA DI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('ADD_COMMENT_TO_AMENDMENT_REQUEST', 5, false, false, 'AGGIUNGI COMMENTO ALLA RICHIESTA DI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_COMMUNICATION_COMMENT', 3, false, false, 'AGGIORNARE COMMENTO COMUNICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_COMMUNICATION_COMMENT', 5, false, false, 'AGGIORNARE COMMENTO COMUNICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT_COMMENT', 3, false, false, 'OTTENERE COMMENTO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT_COMMENT', 5, false, false, 'OTTENERE COMMENTO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_COMMENT_FROM_AMENDMENT', 3, false, false, 'ELIMINARE COMMENTO DALLA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_COMMENT_FROM_AMENDMENT', 5, false, false, 'ELIMINARE COMMENTO DALLA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CREATE_FORM', 2, false, false, 'CREARE MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_FORM', 2, false, false, 'AGGIORNARE MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_FORM', 2, false, false, 'OTTENERE MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_FORM', 2, false, false, 'ELIMINARE MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('AMENDMENT_EXPIRATION_SCHEDULER', 2, false, false, 'PIANIFICATORE SCADENZA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('EVALUATION_EXPIRATION_SCHEDULER', 2, false, false, 'PIANIFICATORE SCADENZA VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CHECK_OR_CREATE_NDG_CODE', 2, false, false, 'VERIFICARE O CREARE CODICE NDG', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_APPOINTMENT', 2, false, false, 'CREARE APPUNTAMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM', 2, false, false, 'CARICA DOCUMENTO NEL SISTEMA ESTERNO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('GET_USER_ACTION', 2, false, false, 'OTTENERE AZIONE UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'); + + + + + + + + + diff --git a/src/main/resources/message_en.properties b/src/main/resources/message_en.properties index 290f40af..9d5d2b2f 100644 --- a/src/main/resources/message_en.properties +++ b/src/main/resources/message_en.properties @@ -345,3 +345,5 @@ 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. + +user.action.fetched.successfully = User action details fetched successfully. diff --git a/src/main/resources/message_it.properties b/src/main/resources/message_it.properties index f41e4f1c..3fbad290 100644 --- a/src/main/resources/message_it.properties +++ b/src/main/resources/message_it.properties @@ -334,4 +334,6 @@ 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. \ No newline at end of file +user.with.company.not.found = Utente con azienda non trovato per utente o azienda. + +user.action.fetched.successfully = Dettagli sull'azione dell'utente recuperati correttamente. \ No newline at end of file From 7953ba0838bf48f9eedeb837e31da392688ed06e Mon Sep 17 00:00:00 2001 From: rajesh Date: Mon, 13 Jan 2025 19:17:39 +0530 Subject: [PATCH 08/11] Done ticket GEPAFINBE-140 --- .../tendermanagement/dao/CompanyDao.java | 18 +++++++++++++++++- .../entities/CompanyEntity.java | 3 +++ .../model/response/CompanyResponse.java | 1 + .../db/changelog/db.changelog-1.0.0.xml | 6 ++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/gepafin/tendermanagement/dao/CompanyDao.java b/src/main/java/net/gepafin/tendermanagement/dao/CompanyDao.java index 6c5f0856..1b3a6798 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/CompanyDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/CompanyDao.java @@ -124,7 +124,6 @@ public class CompanyDao { userWithCompanyEntity.setContactEmail(companyRequest.getContactEmail()); userWithCompanyEntity.setJson(Utils.convertMapIntoJsonString(companyRequest.getVatCheckResponse()) ); UserWithCompanyEntity userWithCompany = userWithCompanyRepository.save(userWithCompanyEntity); - /** This code is responsible for adding a version history log for the "adding user with company" operation. **/ loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.INSERT).oldData(null).newData(userWithCompany).build()); return userWithCompany; @@ -144,6 +143,22 @@ public class CompanyDao { entity.setNumberOfEmployees(request.getNumberOfEmployees()); entity.setAnnualRevenue(request.getAnnualRevenue()); entity.setHub(userEntity.getHub()); + Map vatCheckResponse = request.getVatCheckResponse(); + if (request.getVatCheckResponse() != null) { + if (vatCheckResponse.containsKey("dettaglio")) { + Map dettaglio = (Map) vatCheckResponse.get("dettaglio"); + if (dettaglio != null) { + if (dettaglio.containsKey("codice_ateco")) { + Object codiceAtecoObj = dettaglio.get("codice_ateco"); + String codiceAteco = (codiceAtecoObj != null) ? codiceAtecoObj.toString() : null; + + if (codiceAteco != null) { + entity.setCodiceAteco(codiceAteco); + } + } + } + } + } return entity; } @@ -165,6 +180,7 @@ public class CompanyDao { response.setAnnualRevenue(entity.getAnnualRevenue()); if(userWithCompanyEntity!=null) { response.setIsLegalRepresentant(userWithCompanyEntity.getIsLegalRepresentant()); + response.setCodiceAteco(entity.getCodiceAteco()); } response.setCreatedDate(entity.getCreatedDate()); response.setUpdatedDate(entity.getUpdatedDate()); diff --git a/src/main/java/net/gepafin/tendermanagement/entities/CompanyEntity.java b/src/main/java/net/gepafin/tendermanagement/entities/CompanyEntity.java index e7aa0f40..932a8758 100644 --- a/src/main/java/net/gepafin/tendermanagement/entities/CompanyEntity.java +++ b/src/main/java/net/gepafin/tendermanagement/entities/CompanyEntity.java @@ -56,4 +56,7 @@ public class CompanyEntity extends BaseEntity{ @Column(name = "NDG") private String ndg; + + @Column(name = "CODICE_ATECO") + private String codiceAteco; } diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/CompanyResponse.java b/src/main/java/net/gepafin/tendermanagement/model/response/CompanyResponse.java index e54b040f..ddd62f38 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/CompanyResponse.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/CompanyResponse.java @@ -24,4 +24,5 @@ public class CompanyResponse extends BaseBean{ private Boolean isLegalRepresentant; private String contactName; private String contactEmail; + private String codiceAteco; } diff --git a/src/main/resources/db/changelog/db.changelog-1.0.0.xml b/src/main/resources/db/changelog/db.changelog-1.0.0.xml index 4b73b739..1ec8f742 100644 --- a/src/main/resources/db/changelog/db.changelog-1.0.0.xml +++ b/src/main/resources/db/changelog/db.changelog-1.0.0.xml @@ -2188,5 +2188,11 @@ + + + + + + From e9df9cdb44ece2a6aa86acdddd7186367a0f71b4 Mon Sep 17 00:00:00 2001 From: rajesh Date: Tue, 14 Jan 2025 13:13:39 +0530 Subject: [PATCH 09/11] updated code --- .../constants/GepafinConstant.java | 1 + .../tendermanagement/dao/UserActionDao.java | 54 ++- .../enums/UserActionContextEnum.java | 3 +- .../response/ActionContextLabelResponse.java | 12 + .../response/SummaryPageResponseBean.java | 1 - .../RoleActionContextRepository.java | 6 +- .../service/UserActionService.java | 8 +- .../service/impl/UserActionServiceImpl.java | 12 +- .../web/rest/api/UserActionApi.java | 20 +- .../api/impl/UserActionApiController.java | 17 +- .../db/changelog/db.changelog-1.0.0.xml | 2 +- .../insert_action_context_data_09_01_2025.sql | 425 +++++++++--------- src/main/resources/message_en.properties | 1 + src/main/resources/message_it.properties | 1 + 14 files changed, 325 insertions(+), 238 deletions(-) create mode 100644 src/main/java/net/gepafin/tendermanagement/model/response/ActionContextLabelResponse.java diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java index af1218e4..449d5953 100644 --- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java +++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java @@ -357,6 +357,7 @@ public class GepafinConstant { public static final String USER_WITH_COMPANY_NOT_FOUND = "user.with.company.not.found"; public static final String USER_ACTION_FETCHED_SUCCESSFULLY = "user.action.fetched.successfully"; + public static final String ACTION_CONTEXT_LABELS_FETCHED_SUCCESSFULLY = "action.context.labels.fetched.successfully"; //action log response public static final String STATUS_CODE_STRING = "statusCode"; public static final String GET_STATUS_CODE_STRING = "status"; diff --git a/src/main/java/net/gepafin/tendermanagement/dao/UserActionDao.java b/src/main/java/net/gepafin/tendermanagement/dao/UserActionDao.java index 2b70c5a1..7cf5472f 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/UserActionDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/UserActionDao.java @@ -1,11 +1,14 @@ package net.gepafin.tendermanagement.dao; +import jakarta.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.Predicate; import jakarta.servlet.http.HttpServletRequest; import net.gepafin.tendermanagement.entities.RoleActionContextEntity; import net.gepafin.tendermanagement.entities.UserActionEntity; import net.gepafin.tendermanagement.entities.UserEntity; import net.gepafin.tendermanagement.enums.TimePeriodEnum; +import net.gepafin.tendermanagement.enums.UserActionContextEnum; +import net.gepafin.tendermanagement.model.response.ActionContextLabelResponse; import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean; import net.gepafin.tendermanagement.model.response.UserActionResponseBean; import net.gepafin.tendermanagement.repositories.AssignedApplicationsRepository; @@ -38,18 +41,16 @@ public class UserActionDao { @Autowired private RoleActionContextRepository roleActionContextRepository; - public SummaryPageResponseBean getUserAction(HttpServletRequest request, UserEntity userEntity, TimePeriodEnum timeFilter, String actionContext){ + public SummaryPageResponseBean getUserAction(HttpServletRequest request, UserEntity userEntity, TimePeriodEnum timeFilter, List actionContext){ Long numberOfLoginAttempts = userActionsRepository.countUserLoginAttempts(userEntity.getId()); Long applicationsProcessed = assignedApplicationsRepository.countAssignedApplicationsByUserId(userEntity.getId()); - List actionContextLabel = roleActionContextRepository.findByRoleIdAndIsDeletedFalse(userEntity.getRoleEntity().getId()); - List userActions = getFilterUserActions(userEntity.getId(),timeFilter,actionContext); - return createSummaryPageResponse(userEntity,numberOfLoginAttempts,applicationsProcessed,actionContextLabel,userActions); + return createSummaryPageResponse(userEntity,numberOfLoginAttempts,applicationsProcessed,userActions); } - public SummaryPageResponseBean createSummaryPageResponse(UserEntity user, Long numberOfLoginAttempts, Long applicationsProcessed, List actionContextLabel, List userActions){ + public SummaryPageResponseBean createSummaryPageResponse(UserEntity user, Long numberOfLoginAttempts, Long applicationsProcessed, List userActions){ SummaryPageResponseBean response = new SummaryPageResponseBean(); response.setRole(user.getRoleEntity().getRoleName()); response.setLastLogin(user.getLastLogin()); @@ -58,11 +59,6 @@ public class UserActionDao { response.setEmail(user.getEmail()); response.setNumberOfLoginAttempts(numberOfLoginAttempts); response.setApplicationsProcessed(applicationsProcessed); - List actionContextNames = actionContextLabel.stream() - .map(RoleActionContextEntity::getActionContext) - .collect(Collectors.toList()); - - response.setActionContextLabels(actionContextNames); List userAction = convertEntityToResponse(userActions); response.setUserActions(userAction); @@ -70,12 +66,17 @@ public class UserActionDao { } - public List getFilterUserActions(Long userId ,TimePeriodEnum timeFilter, String actionContext) { + public List getFilterUserActions(Long userId ,TimePeriodEnum timeFilter, List actionContextList) { LocalDateTime endDate = LocalDateTime.now(); LocalDateTime startDate = (timeFilter != null) ? getStartTimeFromFilter(timeFilter) : null; Pageable pageable = PageRequest.of(0, 25); - Specification spec = getUserActionsSpecification(userId, startDate, endDate, actionContext); +// String actionContextLabel = (actionContext != null) ? actionContext.toString() : null; + List actionContextLabels = (actionContextList != null && !actionContextList.isEmpty()) + ? actionContextList.stream().map(Enum::toString).collect(Collectors.toList()) + : null; + + Specification spec = getUserActionsSpecification(userId, startDate, endDate, actionContextLabels); Page pageResult = userActionsRepository.findAll(spec, pageable); return pageResult.getContent(); @@ -97,7 +98,7 @@ public class UserActionDao { } } - public Specification getUserActionsSpecification(Long userId, LocalDateTime startDate, LocalDateTime endDate, String actionContext) { + public Specification getUserActionsSpecification(Long userId, LocalDateTime startDate, LocalDateTime endDate, List actionContextList) { return (root, query, builder) -> { Predicate predicate = builder.isFalse(root.get("isDeleted")); @@ -107,10 +108,14 @@ public class UserActionDao { predicate = builder.and(predicate, builder.between(root.get("createdDate"), startDate, endDate)); } - if (actionContext != null) { - predicate = builder.and(predicate, builder.equal(root.get("actionContext"), actionContext)); - } + if (actionContextList != null && !actionContextList.isEmpty()) { + CriteriaBuilder.In inClause = builder.in(root.get("actionContext")); + for (String actionContext : actionContextList) { + inClause.value(actionContext); + } + predicate = builder.and(predicate, inClause); + } query.orderBy(builder.desc(root.get("createdDate"))); return predicate; @@ -135,4 +140,21 @@ public class UserActionDao { return responseBean; }).collect(Collectors.toList()); } + + public List getActionContextLabels(HttpServletRequest request, UserEntity userEntity){ + List actionContextLabel = roleActionContextRepository.findActionContextLabel(userEntity.getRoleEntity().getId()); + return convertRoleContextEntityToResponse(actionContextLabel); + } + + private List convertRoleContextEntityToResponse(List actionContextEntities){ + return actionContextEntities.stream().map(actionContext -> { + ActionContextLabelResponse responseBean = new ActionContextLabelResponse(); + responseBean.setId(actionContext.getId()); + responseBean.setActionContext(UserActionContextEnum.valueOf(actionContext.getActionContext())); + responseBean.setRoleId(actionContext.getRoleId()); + responseBean.setDescription(actionContext.getDescription()); + responseBean.setIsViewed(actionContext.getIsViewed()); + return responseBean; + }).collect(Collectors.toList()); + } } diff --git a/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java b/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java index cb3ec69f..7177f8d9 100644 --- a/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java +++ b/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java @@ -166,7 +166,8 @@ public enum UserActionContextEnum { CREATE_APPOINTMENT("CREATE_APPOINTMENT"), UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM("UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM"), - GET_USER_ACTION("GET_USER_ACTION"); + GET_USER_ACTION("GET_USER_ACTION"), + GET_ACTION_CONTEXT_LABELS("GET_ACTION_CONTEXT_LABELS"); private final String value; diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/ActionContextLabelResponse.java b/src/main/java/net/gepafin/tendermanagement/model/response/ActionContextLabelResponse.java new file mode 100644 index 00000000..988a8f07 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/model/response/ActionContextLabelResponse.java @@ -0,0 +1,12 @@ +package net.gepafin.tendermanagement.model.response; +import lombok.Data; +import net.gepafin.tendermanagement.enums.UserActionContextEnum; + +@Data +public class ActionContextLabelResponse { + private Long id; + private UserActionContextEnum actionContext; + private Long roleId; + private Boolean isViewed; + private String description; +} diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/SummaryPageResponseBean.java b/src/main/java/net/gepafin/tendermanagement/model/response/SummaryPageResponseBean.java index aa4d96e4..a15a6510 100644 --- a/src/main/java/net/gepafin/tendermanagement/model/response/SummaryPageResponseBean.java +++ b/src/main/java/net/gepafin/tendermanagement/model/response/SummaryPageResponseBean.java @@ -14,6 +14,5 @@ public class SummaryPageResponseBean { private LocalDateTime registrationDate; private Long numberOfLoginAttempts; private Long applicationsProcessed; - private List actionContextLabels; private List userActions; } diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/RoleActionContextRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/RoleActionContextRepository.java index 4af9a314..218f2c10 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/RoleActionContextRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/RoleActionContextRepository.java @@ -3,13 +3,17 @@ package net.gepafin.tendermanagement.repositories; import net.gepafin.tendermanagement.entities.RoleActionContextEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface RoleActionContextRepository extends JpaRepository, JpaSpecificationExecutor { - List findByRoleIdAndIsDeletedFalse(Long roleId); + @Query("SELECT r FROM RoleActionContextEntity r WHERE r.roleId = :roleId AND r.isDeleted = false AND r.isViewed = true") + List findActionContextLabel(@Param("roleId") Long roleId); + diff --git a/src/main/java/net/gepafin/tendermanagement/service/UserActionService.java b/src/main/java/net/gepafin/tendermanagement/service/UserActionService.java index 1e010919..e12bae6a 100644 --- a/src/main/java/net/gepafin/tendermanagement/service/UserActionService.java +++ b/src/main/java/net/gepafin/tendermanagement/service/UserActionService.java @@ -2,8 +2,14 @@ package net.gepafin.tendermanagement.service; import jakarta.servlet.http.HttpServletRequest; import net.gepafin.tendermanagement.enums.TimePeriodEnum; +import net.gepafin.tendermanagement.enums.UserActionContextEnum; +import net.gepafin.tendermanagement.model.response.ActionContextLabelResponse; import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean; +import java.util.List; + public interface UserActionService { - public SummaryPageResponseBean getUserAction(HttpServletRequest request, Long userId, TimePeriodEnum timeFilter, String actionContext); + public SummaryPageResponseBean getUserAction(HttpServletRequest request, Long userId, TimePeriodEnum timeFilter, List actionContext); + + public List getActionContextLabels(HttpServletRequest request, Long userId); } diff --git a/src/main/java/net/gepafin/tendermanagement/service/impl/UserActionServiceImpl.java b/src/main/java/net/gepafin/tendermanagement/service/impl/UserActionServiceImpl.java index 334dd933..65d692dc 100644 --- a/src/main/java/net/gepafin/tendermanagement/service/impl/UserActionServiceImpl.java +++ b/src/main/java/net/gepafin/tendermanagement/service/impl/UserActionServiceImpl.java @@ -4,12 +4,16 @@ import jakarta.servlet.http.HttpServletRequest; import net.gepafin.tendermanagement.dao.UserActionDao; import net.gepafin.tendermanagement.entities.UserEntity; import net.gepafin.tendermanagement.enums.TimePeriodEnum; +import net.gepafin.tendermanagement.enums.UserActionContextEnum; +import net.gepafin.tendermanagement.model.response.ActionContextLabelResponse; import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean; import net.gepafin.tendermanagement.service.UserActionService; import net.gepafin.tendermanagement.util.Validator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class UserActionServiceImpl implements UserActionService { @@ -21,8 +25,14 @@ public class UserActionServiceImpl implements UserActionService { @Override - public SummaryPageResponseBean getUserAction(HttpServletRequest request, Long userId, TimePeriodEnum timeFilter, String actionContext) { + public SummaryPageResponseBean getUserAction(HttpServletRequest request, Long userId, TimePeriodEnum timeFilter, List actionContext) { UserEntity user = validator.validateUserId(request, userId); return userActionDao.getUserAction(request,user,timeFilter,actionContext); } + + @Override + public List getActionContextLabels(HttpServletRequest request, Long userId) { + UserEntity user = validator.validateUserId(request, userId); + return userActionDao.getActionContextLabels(request,user); + } } diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/UserActionApi.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/UserActionApi.java index e0e62e84..95d0f125 100644 --- a/src/main/java/net/gepafin/tendermanagement/web/rest/api/UserActionApi.java +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/UserActionApi.java @@ -7,6 +7,8 @@ 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.TimePeriodEnum; +import net.gepafin.tendermanagement.enums.UserActionContextEnum; +import net.gepafin.tendermanagement.model.response.ActionContextLabelResponse; import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean; import net.gepafin.tendermanagement.model.util.Response; import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants; @@ -16,6 +18,8 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; +import java.util.List; + public interface UserActionApi { @Operation(summary = "Api to get user action", responses = { @@ -26,8 +30,20 @@ public interface UserActionApi { @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 = "/{userId}", produces = { "application/json" }) + @GetMapping(value = "/user/{userId}", produces = { "application/json" }) ResponseEntity> getUserAction(HttpServletRequest request, @Parameter(description = "The user id", required = true) @PathVariable("userId") Long userId, @Parameter(description = "Time Filter") @RequestParam(value = "timeFilter", required = false) TimePeriodEnum timeFilter, - @Parameter(description = "Action Context") @RequestParam(value = "actionContext", required = false) String actionContext); + @Parameter(description = "Action Context") @RequestParam(value = "actionContext", required = false) List actionContext); + + @Operation(summary = "Api to get action context label", + 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}/action-context", produces = { "application/json" }) + ResponseEntity>> getActionContextLabels(HttpServletRequest request, @Parameter(description = "The user id", required = true) @PathVariable("userId") Long userId); } diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/UserActionApiController.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/UserActionApiController.java index 3aa083c5..c65fbe2f 100644 --- a/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/UserActionApiController.java +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/UserActionApiController.java @@ -7,6 +7,7 @@ import net.gepafin.tendermanagement.enums.TimePeriodEnum; import net.gepafin.tendermanagement.enums.UserActionContextEnum; import net.gepafin.tendermanagement.enums.UserActionLogsEnum; import net.gepafin.tendermanagement.model.request.UserActionRequest; +import net.gepafin.tendermanagement.model.response.ActionContextLabelResponse; import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean; import net.gepafin.tendermanagement.model.util.Response; import net.gepafin.tendermanagement.service.UserActionService; @@ -19,6 +20,8 @@ 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/userAction}") public class UserActionApiController implements UserActionApi { @@ -30,7 +33,7 @@ public class UserActionApiController implements UserActionApi { private LoggingUtil loggingUtil; @Override - public ResponseEntity> getUserAction(HttpServletRequest request, Long userId, TimePeriodEnum timeFilter, String actionContext) { + public ResponseEntity> getUserAction(HttpServletRequest request, Long userId, TimePeriodEnum timeFilter, List actionContext) { /** This code is responsible for creating user action logs for the "get user action" operation. **/ loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW) @@ -39,5 +42,17 @@ public class UserActionApiController implements UserActionApi { return ResponseEntity.status(HttpStatus.OK) .body(new Response<>(userActionResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.USER_ACTION_FETCHED_SUCCESSFULLY))); } + + @Override + public ResponseEntity>> getActionContextLabels(HttpServletRequest request, Long userId) { + + /** This code is responsible for creating user action logs for the "get user action context labels" operation. **/ + loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW) + .actionContext(UserActionContextEnum.GET_ACTION_CONTEXT_LABELS).build()); + + List actionContextResponse= userActionService.getActionContextLabels(request,userId); + return ResponseEntity.status(HttpStatus.OK) + .body(new Response<>(actionContextResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.ACTION_CONTEXT_LABELS_FETCHED_SUCCESSFULLY))); + } } diff --git a/src/main/resources/db/changelog/db.changelog-1.0.0.xml b/src/main/resources/db/changelog/db.changelog-1.0.0.xml index bd23e10a..e40dff87 100644 --- a/src/main/resources/db/changelog/db.changelog-1.0.0.xml +++ b/src/main/resources/db/changelog/db.changelog-1.0.0.xml @@ -2163,7 +2163,7 @@ - + diff --git a/src/main/resources/db/dump/insert_action_context_data_09_01_2025.sql b/src/main/resources/db/dump/insert_action_context_data_09_01_2025.sql index 264c92b1..9a159e8f 100644 --- a/src/main/resources/db/dump/insert_action_context_data_09_01_2025.sql +++ b/src/main/resources/db/dump/insert_action_context_data_09_01_2025.sql @@ -1,244 +1,243 @@ INSERT INTO role_action_context (action_context, role_id, is_deleted, is_viewed, description ,created_date, updated_date) VALUES -('CREATE_CALL_STEP_1', 2, false, false,'CREATE_CALL_STEP_1', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_CALL_STEP_1', 2, false, false, 'UPDATE_CALL_STEP_1','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_UPDATE_CALL_STEP_2', 2, false, false, 'CREATE_UPDATE_CALL_STEP_2','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('VALIDATE_CALL', 2, false, false,'CONVALIDA CHIAMATA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_CALL_STATUS', 2, false, false, 'AGGIORNA STATO CHIAMA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_CALL', 1, false, false, 'OTTIENI CHIAMA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_CALL', 2, false, false, 'OTTIENI CHIAMA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DOWNLOAD_CALL_DOCUMENT', 2 ,false, false, 'SCARICA DOCUMENTO CHIAMA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DOWNLOAD_CALL_DOCUMENT', 1 ,false, false,'SCARICA DOCUMENTO CHIAMA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DOWNLOAD_CALL_DOCUMENT', 3,false, false,'SCARICA DOCUMENTO CHIAMA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DOWNLOAD_CALL_DOCUMENT', 5 , false, false,'SCARICA DOCUMENTO CHIAMA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_CALL_STEP_1', 2, false, true,'Create Call Step 1', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_CALL_STEP_1', 2, false, true, 'Update Call Step 1','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_UPDATE_CALL_STEP_2', 2, false, true, 'Create Update Call Step 2','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('VALIDATE_CALL', 2, false, true,'Convalida Chiamata','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_CALL_STATUS', 2, false, true, 'Aggiorna Stato Chiama','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_CALL', 1, false, true, 'Ottieni Chiama','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_CALL', 2, false, true, 'Ottieni Chiama','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_CALL_DOCUMENT', 2 ,false, true, 'Scarica Documento Chiama','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_CALL_DOCUMENT', 1 ,false, true,'Scarica Documento Chiama', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_CALL_DOCUMENT', 3,false, true,'Scarica Documento Chiama', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_CALL_DOCUMENT', 5 , false, true,'Scarica Documento Chiama', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_USER', 1, false, false, 'CREA UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_USER', 2, false, false, 'CREA UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('USER_LOGIN', 1, false, false, 'ACCESSO UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('USER_LOGIN', 2, false, false, 'ACCESSO UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('USER_LOGIN', 3, false, false, 'ACCESSO UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('USER_LOGIN', 5, false, false, 'ACCESSO UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('LOGOUT_USER', 1, false, false,'LOGOUT UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('LOGOUT_USER', 2, false, false,'LOGOUT UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('LOGOUT_USER', 3, false, false,'LOGOUT UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('LOGOUT_USER', 5, false, false,'LOGOUT UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_USER', 2, false, false, 'OTTIENI UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_USER_DETAILS', 2, false, false, 'AGGIORNA DETTAGLI UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_USER_DETAILS', 1, false, false, 'AGGIORNA DETTAGLI UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_USER_DETAILS', 3, false, false, 'AGGIORNA DETTAGLI UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_USER_DETAILS', 5, false, false,'AGGIORNA DETTAGLI UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_USER', 2, false, false, 'ELIMINA UTENTE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_USER', 1, false, true, 'Crea Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_USER', 2, false, true, 'Crea Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('USER_LOGIN', 1, false, true, 'Accesso Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('USER_LOGIN', 2, false, true, 'Accesso Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('USER_LOGIN', 3, false, true, 'Accesso Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('USER_LOGIN', 5, false, true, 'Accesso Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('LOGOUT_USER', 1, false, true,'Logout Utente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('LOGOUT_USER', 2, false, true,'Logout Utente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('LOGOUT_USER', 3, false, true,'Logout Utente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('LOGOUT_USER', 5, false, true,'Logout Utente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_USER', 2, false, true, 'Ottieni Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_USER_DETAILS', 2, false, true, 'Aggiorna Dettagli Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_USER_DETAILS', 1, false, true, 'Aggiorna Dettagli Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_USER_DETAILS', 3, false, true, 'Aggiorna Dettagli Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_USER_DETAILS', 5, false, true,'Aggiorna Dettagli Utente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_USER', 2, false, true, 'Elimina Utente','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('VALIDATE_NEW_USER_WITH_SPID_TOKEN', 1, false, false, 'VALIDA NUOVO UTENTE CON TOKEN SPID','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('VALIDATE_EXISTING_USER_WITH_SPID_TOKEN', 1, false, false,'VALIDA UTENTE ESISTENTE CON TOKEN SPID','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_VALID_USER_DETAILS', 1, false, false, 'OTTIENI DETTAGLI UTENTE VALIDO','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_VALID_USER_DETAILS', 2, false, false,'OTTIENI DETTAGLI UTENTE VALIDO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ALL_USERS_BY_ROLE', 2, false, false,'OTTIENI TUTTI GLI UTENTI PER RUOLO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ALL_USERS_BY_ROLE', 5, false, false,'OTTIENI TUTTI GLI UTENTI PER RUOLO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('VALIDATE_NEW_USER_WITH_SPID_TOKEN', 1, false, true, 'Valida Nuovo Utente Con Token SPID', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('VALIDATE_EXISTING_USER_WITH_SPID_TOKEN', 1, false, true, 'Valida Utente Esistente Con Token SPID', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_VALID_USER_DETAILS', 1, false, true, 'Ottieni Dettagli Utente Valido', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_VALID_USER_DETAILS', 2, false, true, 'Ottieni Dettagli Utente Valido', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_USERS_BY_ROLE', 2, false, true, 'Ottieni Tutti Gli Utenti Per Ruolo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_USERS_BY_ROLE', 5, false, true, 'Ottieni Tutti Gli Utenti Per Ruolo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_APPLICATION', 2, false, false, 'OTTIENI APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_APPLICATION', 1, false, false, 'OTTIENI APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_APPLICATION', 3, false, false, 'OTTIENI APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_APPLICATION', 5, false, false, 'OTTIENI APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_UPDATE_APPLICATION_FORM', 1, false, false, 'CREA/AGGIORNA FORM APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_UPDATE_APPLICATION_FORM', 2, false, false, 'CREA/AGGIORNA FORM APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_APPLICATION', 1, false, false, 'CREA APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_APPLICATION', 2, false, false, 'CREA APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_APPLICATION', 1, false, false, 'ELIMINA APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_APPLICATION', 2, false, false, 'ELIMINA APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ALL_APPLICATION', 1, false, false, 'OTTIENI TUTTE LE APPLICAZIONI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ALL_APPLICATION', 2, false, false, 'OTTIENI TUTTE LE APPLICAZIONI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION', 2, false, true, 'Ottieni Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION', 1, false, true, 'Ottieni Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION', 3, false, true, 'Ottieni Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION', 5, false, true, 'Ottieni Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_UPDATE_APPLICATION_FORM', 1, false, true, 'Crea/Aggiorna Form Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_UPDATE_APPLICATION_FORM', 2, false, true, 'Crea/Aggiorna Form Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_APPLICATION', 1, false, true, 'Crea Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_APPLICATION', 2, false, true, 'Crea Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_APPLICATION', 1, false, true, 'Elimina Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_APPLICATION', 2, false, true, 'Elimina Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_APPLICATION', 1, false, true, 'Ottieni Tutte Le Applicazioni', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_APPLICATION', 2, false, true, 'Ottieni Tutte Le Applicazioni', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_APPLICATION_STATUS', 2, false, false, 'AGGIORNA STATO DELL APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('VALIDATE_APPLICATION', 2, false, false, 'VALIDA APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_SIGNED_DOCUMENT', 2, false, false, 'CARICA DOCUMENTO FIRMATO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DOWNLOAD_PDF', 2, false, false, 'SCARICA PDF', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_SIGNED_DOCUMENT', 2, false, false, 'OTTIENI DOCUMENTO FIRMATO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_NEXT_PREVIOUS_FORM', 2, false, false, 'OTTIENI FORM SUCCESSIVO/PRECEDENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DOWNLOAD_APPLICATION_DOC_ZIP', 2, false, false, 'SCARICA DOCUMENTI DELL APPLICAZIONE IN ZIP', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_APPLICATION_STATUS', 2, false, true, 'Aggiorna Stato Dell Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('VALIDATE_APPLICATION', 2, false, true, 'Valida Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_SIGNED_DOCUMENT', 2, false, true, 'Carica Documento Firmato', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_PDF', 2, false, true, 'Scarica PDF', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_SIGNED_DOCUMENT', 2, false, true, 'Ottieni Documento Firmato', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_NEXT_PREVIOUS_FORM', 2, false, true, 'Ottieni Form Successivo/Precedente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_APPLICATION_DOC_ZIP', 2, false, true, 'Scarica Documenti Dell Applicazione In ZIP', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_APPLICATION_STATUS', 1, false, false, 'AGGIORNA STATO DELL APPLICAZIONE','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('VALIDATE_APPLICATION', 1, false, false,'CARICA DOCUMENTO FIRMATO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_SIGNED_DOCUMENT', 1, false, false, 'CARICA DOCUMENTO FIRMATO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DOWNLOAD_PDF', 1, false, false, 'SCARICA PDF', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_SIGNED_DOCUMENT', 1, false, false, 'OTTIENI DOCUMENTO FIRMATO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_NEXT_PREVIOUS_FORM', 1, false, false, 'OTTIENI FORM SUCCESSIVO/PRECEDENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DOWNLOAD_APPLICATION_DOC_ZIP', 1, false, false, 'SCARICA DOCUMENTI DELL APPLICAZIONE IN ZIP', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_APPLICATION_STATUS', 1, false, true, 'Aggiorna Stato Dell Applicazione','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('VALIDATE_APPLICATION', 1, false, true,'Valida Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_SIGNED_DOCUMENT', 1, false, true, 'Carica Documento Firmato', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_PDF', 1, false, true, 'Scarica PDF', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_SIGNED_DOCUMENT', 1, false, true, 'Ottieni Documento Firmato', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_NEXT_PREVIOUS_FORM', 1, false, true, 'Ottieni Form Successivo/Precedente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_APPLICATION_DOC_ZIP', 1, false, true, 'Scarica Documenti Dell Applicazione In ZIP', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_FAQ', 2, false, false, 'CREA FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_FAQ', 2, false, false, 'OTTIENI FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_FAQ_DETAILS', 2, false, false, 'AGGIORNA DETTAGLI FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_FAQ', 2, false, false, 'ELIMINA FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_FAQ', 2, false, true, 'Crea Faq', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_FAQ', 2, false, true, 'Ottieni Faq', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_FAQ_DETAILS', 2, false, true, 'Aggiorna Dettagli Faq', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_FAQ', 2, false, true, 'Elimina Faq', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_FAQ', 1, false, false, 'CREA FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_FAQ', 1, false, false, 'OTTIENI FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_FAQ_DETAILS', 1, false, false, 'AGGIORNA DETTAGLI FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_FAQ', 1, false, false, 'ELIMINA FAQ', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_FAQ', 1, false, true, 'Crea Faq', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_FAQ', 1, false, true, 'Ottieni Faq', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_FAQ_DETAILS', 1, false, true, 'Aggiorna Dettagli Faq', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_FAQ', 1, false, true, 'Elimina Faq', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_COMPANY', 1, false, false, 'CREA AZIENDA','2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_COMPANY', 1, false, false, 'OTTIENI AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_COMPANY', 2, false, false, 'OTTIENI AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_COMPANY', 5, false, false, 'OTTIENI AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_COMPANY', 3, false, false, 'OTTIENI AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_COMPANY', 1, false, false, 'AGGIORNA AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_COMPANY', 2, false, false, 'ELIMINA AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_COMPANY', 1, false, false, 'ELIMINA AZIENDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_COMPANY_DELEGATION', 1, false, false, 'CARICA DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DOWNLOAD_COMPANY_DELEGATION_TEMPLATE', 1, false, false, 'SCARICA MODELLO DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_COMPANY_DELEGATION', 1, false, false, 'OTTIENI DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_COMPANY_DELEGATION', 2, false, false, 'OTTIENI DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_COMPANY_DELEGATION', 3, false, false, 'OTTIENI DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_COMPANY_DELEGATION', 5, false, false, 'OTTIENI DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_COMPANY_DELEGATION', 1, false, false, 'ELIMINA DELEGA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CHECK_COMPANY_VAT_NUMBER', 1, false, false, 'VERIFICA PARTITA IVA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CHECK_COMPANY_VAT_NUMBER', 2, false, false, 'VERIFICA PARTITA IVA AZIENDALE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_COMPANY_BY_USER', 2, false, false, 'OTTIENI AZIENDA PER UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_COMPANY_BY_USER', 1, false, false, 'OTTIENI AZIENDA PER UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('REMOVE_COMPANY_FROM_USER', 2, false, false, 'RIMUOVI AZIENDA DA UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_COMPANY', 1, false, true, 'Crea Azienda', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY', 1, false, true, 'Ottieni Azienda', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY', 2, false, true, 'Ottieni Azienda', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY', 5, false, true, 'Ottieni Azienda', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY', 3, false, true, 'Ottieni Azienda', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_COMPANY', 1, false, true, 'Aggiorna Azienda', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_COMPANY', 2, false, true, 'Elimina Azienda', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_COMPANY', 1, false, true, 'Elimina Azienda', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_COMPANY_DELEGATION', 1, false, true, 'Carica Delega Aziendale', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DOWNLOAD_COMPANY_DELEGATION_TEMPLATE', 1, false, true, 'Scarica Modello Delega Aziendale', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_DELEGATION', 1, false, true, 'Ottieni Delega Aziendale', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_DELEGATION', 2, false, true, 'Ottieni Delega Aziendale', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_DELEGATION', 3, false, true, 'Ottieni Delega Aziendale', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_DELEGATION', 5, false, true, 'Ottieni Delega Aziendale', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_COMPANY_DELEGATION', 1, false, true, 'Elimina Delega Aziendale', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CHECK_COMPANY_VAT_NUMBER', 1, false, true, 'Verifica Partita Iva Aziendale', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CHECK_COMPANY_VAT_NUMBER', 2, false, true, 'Verifica Partita Iva Aziendale', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_BY_USER', 2, false, true, 'Ottieni Azienda Per Utente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_COMPANY_BY_USER', 1, false, true, 'Ottieni Azienda Per Utente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('REMOVE_COMPANY_FROM_USER', 2, false, true, 'Rimuovi Azienda Da Utente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_LOOKUP_DATA', 2, false, false, 'CREA DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_LOOKUP_DATA', 2, false, false, 'ELIMINA DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_LOOKUP_DATA', 2, false, false, 'AGGIORNA DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_LOOKUP_DATA', 2, false, false, 'OTTIENI DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_LOOKUP_DATA', 3, false, false, 'OTTIENI DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_LOOKUP_DATA', 5, false, false, 'OTTIENI DATI DI RIFERIMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_LOOKUP_DATA_BY_TYPE', 2, false, false, 'OTTIENI DATI DI RIFERIMENTO PER TIPO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_LOOKUP_DATA_BY_TYPE', 3, false, false, 'OTTIENI DATI DI RIFERIMENTO PER TIPO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_LOOKUP_DATA_BY_TYPE', 5, false, false, 'OTTIENI DATI DI RIFERIMENTO PER TIPO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_LOOKUP_DATA', 2, false, true, 'Crea Dati Di Riferimento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_LOOKUP_DATA', 2, false, true, 'Elimina Dati Di Riferimento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_LOOKUP_DATA', 2, false, true, 'Aggiorna Dati Di Riferimento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA', 2, false, true, 'Ottieni Dati Di Riferimento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA', 3, false, true, 'Ottieni Dati Di Riferimento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA', 5, false, true, 'Ottieni Dati Di Riferimento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA_BY_TYPE', 2, false, true, 'Ottieni Dati Di Riferimento Per Tipo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA_BY_TYPE', 3, false, true, 'Ottieni Dati Di Riferimento Per Tipo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOOKUP_DATA_BY_TYPE', 5, false, true, 'Ottieni Dati Di Riferimento Per Tipo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_HUB', 2, false, false, 'CREA HUB', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_HUB', 2, false, false, 'OTTIENI HUB', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_HUB', 2, false, false, 'ELIMINA HUB', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_HUB', 2, false, false, 'AGGIORNA HUB', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ALL_HUB', 2, false, false, 'OTTIENI TUTTI GLI HUB', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_HUB_BY_UUID', 2, false, false, 'OTTIENI HUB PER UUID', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_HUB', 2, false, true, 'Crea Hub', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_HUB', 2, false, true, 'Ottieni Hub', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_HUB', 2, false, true, 'Elimina Hub', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_HUB', 2, false, true, 'Aggiorna Hub', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_HUB', 2, false, true, 'Ottieni Tutti Gli Hub', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_HUB_BY_UUID', 2, false, true, 'Ottieni Hub Per UUID', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_AMENDMENT', 3, false, false, 'CREA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_AMENDMENT', 5, false, false, 'CREA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_AMENDMENT', 3, false, false, 'OTTIENI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_AMENDMENT', 5, false, false, 'OTTIENI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CLOSE_AMENDMENT', 3, false, false, 'CHIUDI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CLOSE_AMENDMENT', 5, false, false, 'CHIUDI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_AMENDMENT', 3, false, false, 'AGGIORNA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_AMENDMENT', 5, false, false, 'AGGIORNA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_AMENDMENT', 3, false, false, 'ELIMINA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_AMENDMENT', 5, false, false, 'ELIMINA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_AMENDMENT_STATUS', 3, false, false, 'AGGIORNA STATO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_AMENDMENT_STATUS', 5, false, false, 'AGGIORNA STATO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ALL_AMENDMENT_BY_PREINSTRUCTOR_USER_ID', 3, false, false, 'OTTIENI TUTTE LE MODIFICHE PER ID UTENTE PREIISTRUTTORE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ALL_AMENDMENT_BY_PREINSTRUCTOR_USER_ID', 5, false, false, 'OTTIENI TUTTE LE MODIFICHE PER ID UTENTE PREIISTRUTTORE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ALL_AMENDMENT_BY_BENEFICIARY_USER_ID', 1, false, false, 'OTTIENI TUTTE LE MODIFICHE PER ID UTENTE BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_AMENDMENT_BY_APPLICATION_ID', 3, false, false, 'OTTIENI MODIFICA PER ID DOMANDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_AMENDMENT_BY_APPLICATION_ID', 5, false, false, 'OTTIENI MODIFICA PER ID DOMANDA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('EXTEND_RESPONSE_DAYS_FOR_AMENDMENT', 3, false, false, 'ESTENDI GIORNI RISPOSTA PER MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('EXTEND_RESPONSE_DAYS_FOR_AMENDMENT', 5, false, false, 'ESTENDI GIORNI RISPOSTA PER MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_APPLICATION_DATA_FOR_AMENDMENT', 3, false, false, 'OTTIENI DATI DOMANDA PER MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_APPLICATION_DATA_FOR_AMENDMENT', 5, false, false, 'OTTIENI DATI DOMANDA PER MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_AMENDMENT', 3, false, true, 'Crea Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_AMENDMENT', 5, false, true, 'Crea Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT', 3, false, true, 'Ottieni Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT', 5, false, true, 'Ottieni Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CLOSE_AMENDMENT', 3, false, true, 'Chiudi Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CLOSE_AMENDMENT', 5, false, true, 'Chiudi Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_AMENDMENT', 3, false, true, 'Aggiorna Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_AMENDMENT', 5, false, true, 'Aggiorna Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_AMENDMENT', 3, false, true, 'Elimina Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_AMENDMENT', 5, false, true, 'Elimina Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_AMENDMENT_STATUS', 3, false, true, 'Aggiorna Stato Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_AMENDMENT_STATUS', 5, false, true, 'Aggiorna Stato Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_AMENDMENT_BY_PREINSTRUCTOR_USER_ID', 3, false, true, 'Ottieni Tutte Le Modifiche Per ID Utente Preistruttore', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_AMENDMENT_BY_PREINSTRUCTOR_USER_ID', 5, false, true, 'Ottieni Tutte Le Modifiche Per ID Utente Preistruttore', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ALL_AMENDMENT_BY_BENEFICIARY_USER_ID', 1, false, true, 'Ottieni Tutte Le Modifiche Per ID Utente Beneficiario', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT_BY_APPLICATION_ID', 3, false, true, 'Ottieni Modifica Per ID Domanda', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT_BY_APPLICATION_ID', 5, false, true, 'Ottieni Modifica Per ID Domanda', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('EXTEND_RESPONSE_DAYS_FOR_AMENDMENT', 3, false, true, 'Estendi Giorni Risposta Per Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('EXTEND_RESPONSE_DAYS_FOR_AMENDMENT', 5, false, true, 'Estendi Giorni Risposta Per Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION_DATA_FOR_AMENDMENT', 3, false, true, 'Ottieni Dati Domanda Per Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION_DATA_FOR_AMENDMENT', 5, false, true, 'Ottieni Dati Domanda Per Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_UPDATE_APPLICATION_EVALUATION', 3, false, false, 'CREA/AGGIORNA VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_UPDATE_APPLICATION_EVALUATION', 5, false, false, 'CREA/AGGIORNA VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_APPLICATION_EVALUATION', 3, false, false, 'OTTIENI VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_APPLICATION_EVALUATION', 5, false, false, 'OTTIENI VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_APPLICATION_EVALUATION', 3, false, false, 'ELIMINA VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_APPLICATION_EVALUATION', 5, false, false, 'ELIMINA VALUTAZIONE APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), - -('CREATE_BENEFICIARY_PREFERRED_CALL', 2, false, false, 'CREA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_BENEFICIARY_PREFERRED_CALL', 1, false, false, 'CREA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_BENEFICIARY_PREFERRED_CALL', 2, false, false, 'ELIMINA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_BENEFICIARY_PREFERRED_CALL', 1, false, false, 'ELIMINA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_BENEFICIARY_PREFERRED_CALL', 1, false, false, 'OTTIENI CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_BENEFICIARY_PREFERRED_CALL', 2, false, false, 'OTTIENI CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_BENEFICIARY_PREFERRED_CALL', 2, false, false, 'AGGIORNA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_BENEFICIARY_PREFERRED_CALL', 1, false, false, 'AGGIORNA CHIAMATA PREFERITA BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), - -('CREATE_ASSIGNED_APPLICATION', 2, false, false, 'CREA APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_ASSIGNED_APPLICATION', 5, false, false, 'CREA APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_ASSIGNED_APPLICATION', 2, false, false, 'ELIMINA APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_ASSIGNED_APPLICATION', 5, false, false, 'ELIMINA APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ASSIGNED_APPLICATION', 2, false, false, 'OTTIENI APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ASSIGNED_APPLICATION', 3, false, false, 'OTTIENI APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_ASSIGNED_APPLICATION', 5, false, false, 'OTTIENI APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_ASSIGNED_APPLICATION_DETAILS', 2, false, false, 'AGGIORNA DETTAGLI APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_ASSIGNED_APPLICATION_DETAILS', 5, false, false, 'AGGIORNA DETTAGLI APPLICAZIONE ASSEGNATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), - -('CREATE_FORM_FIELD', 2, false, false, 'CREA CAMPO MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_FORM_FIELD', 2, false, false, 'AGGIORNA CAMPO MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_FORM_FIELD', 2, false, false, 'OTTIENI CAMPO MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_FORM_FIELD', 2, false, false, 'ELIMINA CAMPO MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), - -('UPLOAD_CALL_DOCUMENT', 2, false, false, 'CARICA DOCUMENTO CHIAMATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_CALL_IMAGES', 2, false, false, 'CARICA IMMAGINI CHIAMATA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_APPLICATION_DOCUMENT', 1, false, false, 'CARICA DOCUMENTO APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_APPLICATION_IMAGES', 1, false, false, 'CARICA IMMAGINI APPLICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_DOCUMENT', 2, false, false, 'ELIMINA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_DOCUMENT', 1, false, false, 'ELIMINA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_DOCUMENT', 3, false, false, 'ELIMINA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_DOCUMENT', 5, false, false, 'ELIMINA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_DOCUMENT', 2, false, false, 'AGGIORNA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_DOCUMENT', 1, false, false, 'AGGIORNA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_DOCUMENT', 3, false, false, 'AGGIORNA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_DOCUMENT', 5, false, false, 'AGGIORNA DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_IMAGES', 2, false, false, 'AGGIORNA IMMAGINI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_IMAGES', 1, false, false, 'AGGIORNA IMMAGINI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_IMAGES', 3, false, false, 'AGGIORNA IMMAGINI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_IMAGES', 5, false, false, 'AGGIORNA IMMAGINI', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_DOCUMENT', 2, false, false, 'OTTIENI DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_DOCUMENT', 1, false, false, 'OTTIENI DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_DOCUMENT', 3, false, false, 'OTTIENI DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_DOCUMENT', 5, false, false, 'OTTIENI DOCUMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_UPDATE_APPLICATION_EVALUATION', 3, false, true, 'Crea/Aggiorna Valutazione Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_UPDATE_APPLICATION_EVALUATION', 5, false, true, 'Crea/Aggiorna Valutazione Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION_EVALUATION', 3, false, true, 'Ottieni Valutazione Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_APPLICATION_EVALUATION', 5, false, true, 'Ottieni Valutazione Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_APPLICATION_EVALUATION', 3, false, true, 'Elimina Valutazione Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_APPLICATION_EVALUATION', 5, false, true, 'Elimina Valutazione Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_AMENDMENT_DOCUMENT', 3, false, false, 'CARICA DOCUMENTO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_AMENDMENT_DOCUMENT', 5, false, false, 'CARICA DOCUMENTO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_AMENDMENT_IMAGES', 3, false, false, 'CARICA IMMAGINI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_AMENDMENT_IMAGES', 5, false, false, 'CARICA IMMAGINI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_EVALUATION_DOCUMENT', 3, false, false, 'CARICA DOCUMENTO VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_EVALUATION_DOCUMENT', 5, false, false, 'CARICA DOCUMENTO VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_EVALUATION_IMAGES', 3, false, false, 'CARICA IMMAGINI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_EVALUATION_IMAGES', 5, false, false, 'CARICA IMMAGINI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_BENEFICIARY_PREFERRED_CALL', 2, false, true, 'Crea Chiamata Preferita Beneficiario', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_BENEFICIARY_PREFERRED_CALL', 1, false, true, 'Crea Chiamata Preferita Beneficiario', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_BENEFICIARY_PREFERRED_CALL', 2, false, true, 'Elimina Chiamata Preferita Beneficiario', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_BENEFICIARY_PREFERRED_CALL', 1, false, true, 'Elimina Chiamata Preferita Beneficiario', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_BENEFICIARY_PREFERRED_CALL', 1, false, true, 'Ottieni Chiamata Preferita Beneficiario', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_BENEFICIARY_PREFERRED_CALL', 2, false, true, 'Ottieni Chiamata Preferita Beneficiario', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_BENEFICIARY_PREFERRED_CALL', 2, false, true, 'Aggiorna Chiamata Preferita Beneficiario', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_BENEFICIARY_PREFERRED_CALL', 1, false, true, 'Aggiorna Chiamata Preferita Beneficiario', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_UPDATE_FLOW', 2, false, false, 'CREA/AGGIORNA FLUSSO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_FLOW', 2, false, false, 'OTTIENI FLUSSO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_ASSIGNED_APPLICATION', 2, false, true, 'Crea Applicazione Assegnata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_ASSIGNED_APPLICATION', 5, false, true, 'Crea Applicazione Assegnata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_ASSIGNED_APPLICATION', 2, false, true, 'Elimina Applicazione Assegnata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_ASSIGNED_APPLICATION', 5, false, true, 'Elimina Applicazione Assegnata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ASSIGNED_APPLICATION', 2, false, true, 'Ottieni Applicazione Assegnata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ASSIGNED_APPLICATION', 3, false, true, 'Ottieni Applicazione Assegnata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ASSIGNED_APPLICATION', 5, false, true, 'Ottieni Applicazione Assegnata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_ASSIGNED_APPLICATION_DETAILS', 2, false, true, 'Aggiorna Dettagli Applicazione Assegnata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_ASSIGNED_APPLICATION_DETAILS', 5, false, true, 'Aggiorna Dettagli Applicazione Assegnata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_LOGIN_ATTEMPT_LIST', 2, false, false, 'OTTIENI LISTA TENTATIVI ACCESSO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('ADD_LOGIN_ATTEMPT', 2, false, false, 'AGGIUNGI TENTATIVO ACCESSO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_FORM_FIELD', 2, false, true, 'Crea Campo Modulo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_FORM_FIELD', 2, false, true, 'Aggiorna Campo Modulo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_FORM_FIELD', 2, false, true, 'Ottieni Campo Modulo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_FORM_FIELD', 2, false, true, 'Elimina Campo Modulo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_DASHBOARD_WIDGET_FOR_SUPER_ADMIN', 2, false, false, 'OTTENERE WIDGET CRUSCOTTO PER SUPER ADMIN', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_DASHBOARD_WIDGET_FOR_BENEFICIARY', 1, false, false, 'OTTENERE WIDGET CRUSCOTTO PER BENEFICIARIO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_CALL_DOCUMENT', 2, false, true, 'Carica Documento Chiamata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_CALL_IMAGES', 2, false, true, 'Carica Immagini Chiamata', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_APPLICATION_DOCUMENT', 1, false, true, 'Carica Documento Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_APPLICATION_IMAGES', 1, false, true, 'Carica Immagini Applicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_DOCUMENT', 2, false, true, 'Elimina Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_DOCUMENT', 1, false, true, 'Elimina Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_DOCUMENT', 3, false, true, 'Elimina Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_DOCUMENT', 5, false, true, 'Elimina Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_DOCUMENT', 2, false, true, 'Aggiorna Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_DOCUMENT', 1, false, true, 'Aggiorna Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_DOCUMENT', 3, false, true, 'Aggiorna Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_DOCUMENT', 5, false, true, 'Aggiorna Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_IMAGES', 2, false, true, 'Aggiorna Immagini', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_IMAGES', 1, false, true, 'Aggiorna Immagini', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_IMAGES', 3, false, true, 'Aggiorna Immagini', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_IMAGES', 5, false, true, 'Aggiorna Immagini', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DOCUMENT', 2, false, true, 'Ottieni Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DOCUMENT', 1, false, true, 'Ottieni Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DOCUMENT', 3, false, true, 'Ottieni Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DOCUMENT', 5, false, true, 'Ottieni Documento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_EVALUATION_CRITERIA', 2, false, false, 'OTTENERE CRITERI DI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_EVALUATION_CRITERIA', 2, false, false, 'AGGIORNARE CRITERI DI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_EVALUATION_CRITERIA', 2, false, false, 'ELIMINARE CRITERI DI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_EVALUATION_CRITERIA', 2, false, false, 'CREARE CRITERI DI VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_EVALUATION_DOC', 3, false, false, 'CARICA DOCUMENTO VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_EVALUATION_DOC', 5, false, false, 'CARICA DOCUMENTO VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_AMENDMENT_DOCUMENT', 3, false, true, 'Carica Documento Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_AMENDMENT_DOCUMENT', 5, false, true, 'Carica Documento Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_AMENDMENT_IMAGES', 3, false, true, 'Carica Immagini Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_AMENDMENT_IMAGES', 5, false, true, 'Carica Immagini Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_DOCUMENT', 3, false, true, 'Carica Documento Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_DOCUMENT', 5, false, true, 'Carica Documento Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_IMAGES', 3, false, true, 'Carica Immagini Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_IMAGES', 5, false, true, 'Carica Immagini Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_UPDATE_FLOW', 2, false, true, 'Crea/Aggiorna Flusso', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_FLOW', 2, false, true, 'Ottieni Flusso', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('ADD_COMMENT_TO_AMENDMENT_REQUEST', 3, false, false, 'AGGIUNGI COMMENTO ALLA RICHIESTA DI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('ADD_COMMENT_TO_AMENDMENT_REQUEST', 5, false, false, 'AGGIUNGI COMMENTO ALLA RICHIESTA DI MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_COMMUNICATION_COMMENT', 3, false, false, 'AGGIORNARE COMMENTO COMUNICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_COMMUNICATION_COMMENT', 5, false, false, 'AGGIORNARE COMMENTO COMUNICAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_AMENDMENT_COMMENT', 3, false, false, 'OTTENERE COMMENTO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_AMENDMENT_COMMENT', 5, false, false, 'OTTENERE COMMENTO MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_COMMENT_FROM_AMENDMENT', 3, false, false, 'ELIMINARE COMMENTO DALLA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_COMMENT_FROM_AMENDMENT', 5, false, false, 'ELIMINARE COMMENTO DALLA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_LOGIN_ATTEMPT_LIST', 2, false, true, 'Ottieni Lista Tentativi Accesso', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('ADD_LOGIN_ATTEMPT', 2, false, true, 'Aggiungi Tentativo Accesso', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_FORM', 2, false, false, 'CREARE MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPDATE_FORM', 2, false, false, 'AGGIORNARE MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('GET_FORM', 2, false, false, 'OTTENERE MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('DELETE_FORM', 2, false, false, 'ELIMINARE MODULO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DASHBOARD_WIDGET_FOR_SUPER_ADMIN', 2, false, true, 'Ottenere Widget Cruscotto Per Super Admin', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_DASHBOARD_WIDGET_FOR_BENEFICIARY', 1, false, true, 'Ottenere Widget Cruscotto Per Beneficiario', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('AMENDMENT_EXPIRATION_SCHEDULER', 2, false, false, 'PIANIFICATORE SCADENZA MODIFICA', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('EVALUATION_EXPIRATION_SCHEDULER', 2, false, false, 'PIANIFICATORE SCADENZA VALUTAZIONE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_EVALUATION_CRITERIA', 2, false, true, 'Ottenere Criteri Di Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_EVALUATION_CRITERIA', 2, false, true, 'Aggiornare Criteri Di Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_EVALUATION_CRITERIA', 2, false, true, 'Eliminare Criteri Di Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_EVALUATION_CRITERIA', 2, false, true, 'Creare Criteri Di Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_DOC', 3, false, true, 'Carica Documento Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_EVALUATION_DOC', 5, false, true, 'Carica Documento Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CHECK_OR_CREATE_NDG_CODE', 2, false, false, 'VERIFICARE O CREARE CODICE NDG', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('CREATE_APPOINTMENT', 2, false, false, 'CREARE APPUNTAMENTO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), -('UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM', 2, false, false, 'CARICA DOCUMENTO NEL SISTEMA ESTERNO', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), - -('GET_USER_ACTION', 2, false, false, 'OTTENERE AZIONE UTENTE', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'); +('ADD_COMMENT_TO_AMENDMENT_REQUEST', 3, false, true, 'Aggiungi Commento Alla Richiesta Di Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('ADD_COMMENT_TO_AMENDMENT_REQUEST', 5, false, true, 'Aggiungi Commento Alla Richiesta Di Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_COMMUNICATION_COMMENT', 3, false, true, 'Aggiornare Commento Comunicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_COMMUNICATION_COMMENT', 5, false, true, 'Aggiornare Commento Comunicazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT_COMMENT', 3, false, true, 'Ottenere Commento Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_AMENDMENT_COMMENT', 5, false, true, 'Ottenere Commento Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_COMMENT_FROM_AMENDMENT', 3, false, true, 'Eliminare Commento Dalla Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_COMMENT_FROM_AMENDMENT', 5, false, true, 'Eliminare Commento Dalla Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_FORM', 2, false, true, 'Creare Modulo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPDATE_FORM', 2, false, true, 'Aggiornare Modulo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_FORM', 2, false, true, 'Ottenere Modulo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('DELETE_FORM', 2, false, true, 'Eliminare Modulo', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('AMENDMENT_EXPIRATION_SCHEDULER', 2, false, true, 'Pianificatore Scadenza Modifica', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('EVALUATION_EXPIRATION_SCHEDULER', 2, false, true, 'Pianificatore Scadenza Valutazione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('CHECK_OR_CREATE_NDG_CODE', 2, false, true, 'Verificare O Creare Codice NDG', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('CREATE_APPOINTMENT', 2, false, true, 'Creare Appuntamento', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM', 2, false, true, 'Carica Documento Nel Sistema Esterno', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), + +('GET_USER_ACTION', 2, false, true, 'Ottenere Azione Utente', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'), +('GET_ACTION_CONTEXT_LABELS', 2, false, true, 'Ottieni Etichette Contesto Azione', '2025-01-09T10:16:26.472Z', '2025-01-09T10:16:26.472Z'); diff --git a/src/main/resources/message_en.properties b/src/main/resources/message_en.properties index d0bd7669..a92a61ad 100644 --- a/src/main/resources/message_en.properties +++ b/src/main/resources/message_en.properties @@ -348,4 +348,5 @@ notification.updated.successfully=Notification updated successfully. user.with.company.not.found = User with company not found for user or company. user.action.fetched.successfully = User action details fetched successfully. +action.context.labels.fetched.successfully = Action Context Labels Fetched Successfully. amount.accepted.required=Amount accepted is required while approving the application. diff --git a/src/main/resources/message_it.properties b/src/main/resources/message_it.properties index cf57021b..e7dbc010 100644 --- a/src/main/resources/message_it.properties +++ b/src/main/resources/message_it.properties @@ -340,4 +340,5 @@ notification.updated.successfully=Notifica aggiornata con successo. user.with.company.not.found = Utente con azienda non trovato per utente o azienda. user.action.fetched.successfully = Dettagli sull'azione dell'utente recuperati correttamente. +action.context.labels.fetched.successfully = Etichette del contesto dell'azione recuperate correttamente. amount.accepted.required=L'importo accettato � obbligatorio durante l'approvazione della domanda. From 40164bd4a087e11b839ff21af17dc326c6168129 Mon Sep 17 00:00:00 2001 From: piyushkag Date: Tue, 14 Jan 2025 18:43:25 +0530 Subject: [PATCH 10/11] Done ticket GEPAFINBE-137 --- .../constants/GepafinConstant.java | 14 ++ .../tendermanagement/dao/ApplicationDao.java | 137 +++++++++++++- .../gepafin/tendermanagement/dao/CallDao.java | 174 ++++++++++++++++-- .../tendermanagement/dao/NotificationDao.java | 125 +++++++++++++ .../enums/UserActionContextEnum.java | 8 +- .../ApplicationPageableRequestBean.java | 14 ++ .../request/CallPageableRequestBean.java | 14 ++ .../model/request/GlobalFilters.java | 18 ++ .../request/NotificationRequestBean.java | 14 ++ .../model/response/PageableResponseBean.java | 13 ++ .../tendermanagement/model/util/SortBy.java | 12 ++ .../repositories/CallRepository.java | 3 +- .../repositories/NotificationRepository.java | 9 +- .../service/ApplicationService.java | 15 +- .../tendermanagement/service/CallService.java | 6 + .../service/NotificationService.java | 5 + .../service/impl/ApplicationServiceImpl.java | 18 +- .../service/impl/CallServiceImpl.java | 10 +- .../service/impl/NotificationServiceImpl.java | 15 ++ .../gepafin/tendermanagement/util/Utils.java | 13 ++ .../web/rest/api/ApplicationApi.java | 24 ++- .../web/rest/api/CallApi.java | 18 +- .../web/rest/api/NotificationApi.java | 14 ++ .../api/impl/ApplicationApiController.java | 18 +- .../web/rest/api/impl/CallApiController.java | 18 +- .../api/impl/NotificationApiController.java | 21 +++ 26 files changed, 697 insertions(+), 53 deletions(-) create mode 100644 src/main/java/net/gepafin/tendermanagement/model/request/ApplicationPageableRequestBean.java create mode 100644 src/main/java/net/gepafin/tendermanagement/model/request/CallPageableRequestBean.java create mode 100644 src/main/java/net/gepafin/tendermanagement/model/request/GlobalFilters.java create mode 100644 src/main/java/net/gepafin/tendermanagement/model/request/NotificationRequestBean.java create mode 100644 src/main/java/net/gepafin/tendermanagement/model/response/PageableResponseBean.java create mode 100644 src/main/java/net/gepafin/tendermanagement/model/util/SortBy.java diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java index 6cce9e90..52a2c8ec 100644 --- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java +++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java @@ -354,5 +354,19 @@ public class GepafinConstant { 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"; + public static final String STATUS = "status"; + public static final String CALL="call"; + public static final String TITLE="title"; + public static final String MESSAGE="message"; + public static final String HUB_ID="hubId"; + public static final String ID="id"; + public static final String IS_DELETED="isDeleted"; + public static final String COMPANY_ID="companyId"; + public static final String COMMENTS="comments"; + public static final String DESCRIPTION_LONG="descriptionLong"; + public static final String DESCRIPTION_SHORT="descriptionShort"; + public static final String HUB="hub"; + public static final String NAME="name"; + } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java index 0b0edf19..0c25b277 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java @@ -1,18 +1,16 @@ package net.gepafin.tendermanagement.dao; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.Root; import net.gepafin.tendermanagement.config.Translator; import net.gepafin.tendermanagement.config.jwt.TokenProvider; import net.gepafin.tendermanagement.constants.GepafinConstant; import net.gepafin.tendermanagement.entities.*; import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum; import net.gepafin.tendermanagement.enums.*; -import net.gepafin.tendermanagement.model.request.ApplicationFormFieldRequestBean; -import net.gepafin.tendermanagement.model.request.ApplicationRequest; -import net.gepafin.tendermanagement.model.request.ApplicationRequestBean; -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.*; import net.gepafin.tendermanagement.model.response.*; +import net.gepafin.tendermanagement.model.util.SortBy; import net.gepafin.tendermanagement.repositories.*; import net.gepafin.tendermanagement.service.AmazonS3Service; import net.gepafin.tendermanagement.service.ApplicationEvaluationService; @@ -37,6 +35,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; @@ -54,6 +54,8 @@ import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import static org.apache.commons.lang3.StringUtils.isEmpty; + @Component public class ApplicationDao { @@ -1349,4 +1351,127 @@ public class ApplicationDao { throw new RuntimeException("Error while creating ZIP file", e); } } + + public PageableResponseBean> getAllApplicationByPagination(UserEntity userEntity, Long callId, Long companyId, ApplicationPageableRequestBean applicationPageableRequestBean) { + Integer pageNo = null; + Integer pageLimit = null; + if (applicationPageableRequestBean.getGlobalFilters() != null) { + pageNo = applicationPageableRequestBean.getGlobalFilters().getPage(); + pageLimit = applicationPageableRequestBean.getGlobalFilters().getLimit(); + } + if (pageLimit == null || pageLimit <= 0) { + pageLimit = GepafinConstant.DEFAULT_PAGE_LIMIT; + } + if (pageNo == null || pageNo <= 0) { + pageNo = GepafinConstant.DEFAULT_PAGE; + } + Specification spec = search(callId, companyId, applicationPageableRequestBean, userEntity); + Page entityPage = applicationRepository.findAll(spec, PageRequest.of(pageNo - 1, pageLimit)); + // Prepare the response + + + List applicationResponses = entityPage.getContent().stream() + .map(application -> { + ApplicationResponse response = getApplicationResponse(application); + return response; + }) + .collect(Collectors.toList()); + + + PageableResponseBean> pageableResponseBean = new PageableResponseBean<>(); + pageableResponseBean.setBody(applicationResponses); + pageableResponseBean.setCurrentPage(entityPage.getNumber() + 1); // Page numbers typically start from 0, so add 1 for user-friendly indexing + pageableResponseBean.setTotalPages(entityPage.getTotalPages()); + pageableResponseBean.setTotalRecords(entityPage.getTotalElements()); + pageableResponseBean.setPageSize(entityPage.getSize()); + + return pageableResponseBean; + } + + public Specification search(Long callId, Long companyId, ApplicationPageableRequestBean applicationPageableRequestBean, UserEntity userEntity) { + return (root, query, criteriaBuilder) -> { + + List predicates = getPredicates(applicationPageableRequestBean, criteriaBuilder, root, callId, companyId, userEntity); + SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true); + + if (applicationPageableRequestBean.getGlobalFilters() != null + && applicationPageableRequestBean.getGlobalFilters().getSortBy() != null && + applicationPageableRequestBean.getGlobalFilters().getSortBy().getColumnName() != null && Boolean.FALSE.equals( + isEmpty(applicationPageableRequestBean.getGlobalFilters().getSortBy().getColumnName()))) { + sortBy.setColumnName(applicationPageableRequestBean.getGlobalFilters().getSortBy().getColumnName()); + sortBy.setSortDesc(true); + if (applicationPageableRequestBean.getGlobalFilters().getSortBy().getSortDesc() != null) { + sortBy.setSortDesc(applicationPageableRequestBean.getGlobalFilters().getSortBy().getSortDesc()); + } + } + + query.orderBy(criteriaBuilder.desc(root.get(sortBy.getColumnName()))); + if (Boolean.FALSE.equals(sortBy.getSortDesc())) { + query.orderBy(criteriaBuilder.asc(root.get(sortBy.getColumnName()))); + } + return query.where(criteriaBuilder.and(predicates.toArray(new Predicate[0]))).getRestriction(); + }; + } + + + private List getPredicates(ApplicationPageableRequestBean applicationPageableRequestBean, + CriteriaBuilder criteriaBuilder, Root root, Long callId, Long companyId, UserEntity userEntity) { + + Integer year = null; + String search = null; + if (applicationPageableRequestBean.getGlobalFilters() != null) { + year = applicationPageableRequestBean.getGlobalFilters().getYear(); + search = applicationPageableRequestBean.getGlobalFilters().getSearch(); + } + List predicates = new ArrayList<>(); + + Boolean isBeneficiary = validator.checkIsBeneficiary(); + if (isBeneficiary) { + predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.USER_ID), userEntity.getId())); + } + if (year != null && year > 0) { + int filterYear = applicationPageableRequestBean.getGlobalFilters().getYear(); + +// Create LocalDateTime boundaries for the start and end of the year + LocalDateTime startOfYear = LocalDateTime.of(filterYear, 1, 1, 0, 0); + LocalDateTime endOfYear = LocalDateTime.of(filterYear, 12, 31, 23, 59, 59); + +// Add the range comparison to filter records within the year + predicates.add(criteriaBuilder.between(root.get(GepafinConstant.CREATED_DATE), startOfYear, endOfYear)); + + } + // Search in `title` and `message` (if search term is provided) + if (search != null && !search.isEmpty()) { + Predicate titlePredicate = criteriaBuilder.like( + criteriaBuilder.upper(root.get(GepafinConstant.COMMENTS)), + "%" + search.toUpperCase() + "%" + ); + predicates.add(criteriaBuilder.or(titlePredicate)); + } + + // Filter by `status` (if status list is provided) + if (applicationPageableRequestBean.getStatus() != null && !applicationPageableRequestBean.getStatus().isEmpty()) { + List statusValues = applicationPageableRequestBean.getStatus().stream() + .map(ApplicationStatusTypeEnum::name) // Convert enum to string + .toList(); + predicates.add(root.get(GepafinConstant.STATUS).in(statusValues)); + } + + if (callId != null) { + CallEntity call = callService.validateCall(callId); + predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.CALL).get(GepafinConstant.ID), callId)); + } + + // Optional companyId filter + if (companyId != null) { + predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.COMPANY_ID), companyId)); + } + predicates.add(criteriaBuilder.isFalse(root.get(GepafinConstant.IS_DELETED))); + + predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.HUB_ID), userEntity.getHub().getId())); + + + return predicates; + + } } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/CallDao.java b/src/main/java/net/gepafin/tendermanagement/dao/CallDao.java index 7382f1c6..0f7a9f5a 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/CallDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/CallDao.java @@ -12,14 +12,15 @@ import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; import jakarta.servlet.http.HttpServletRequest; import net.gepafin.tendermanagement.entities.*; -import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum; -import net.gepafin.tendermanagement.enums.NotificationTypeEnum; -import net.gepafin.tendermanagement.enums.VersionActionTypeEnum; -import net.gepafin.tendermanagement.model.request.NotificationReq; -import net.gepafin.tendermanagement.model.request.VersionHistoryRequest; +import net.gepafin.tendermanagement.enums.*; +import net.gepafin.tendermanagement.model.request.*; import net.gepafin.tendermanagement.model.response.*; +import net.gepafin.tendermanagement.model.util.SortBy; import net.gepafin.tendermanagement.repositories.*; import net.gepafin.tendermanagement.service.*; import net.gepafin.tendermanagement.util.DateTimeUtil; @@ -28,6 +29,9 @@ import net.gepafin.tendermanagement.util.Utils; import net.gepafin.tendermanagement.util.Validator; import org.h2.util.IOUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; @@ -35,15 +39,6 @@ import org.springframework.util.StringUtils; import net.gepafin.tendermanagement.config.Translator; import net.gepafin.tendermanagement.constants.GepafinConstant; import net.gepafin.tendermanagement.entities.LookUpDataEntity.LookUpDataTypeEnum; -import net.gepafin.tendermanagement.enums.CallStatusEnum; -import net.gepafin.tendermanagement.enums.DocumentTypeEnum; -import net.gepafin.tendermanagement.model.request.CreateCallRequestStep1; -import net.gepafin.tendermanagement.model.request.CreateCallRequestStep2; -import net.gepafin.tendermanagement.model.request.DocumentReq; -import net.gepafin.tendermanagement.model.request.EvaluationCriteriaReq; -import net.gepafin.tendermanagement.model.request.FaqReq; -import net.gepafin.tendermanagement.model.request.LookUpDataReq; -import net.gepafin.tendermanagement.model.request.UpdateCallRequestStep1; import net.gepafin.tendermanagement.service.impl.CallValidatorServiceImpl; import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException; import net.gepafin.tendermanagement.web.rest.api.errors.ResourceNotFoundException; @@ -51,6 +46,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.util.Utils.setIfUpdated; +import static org.apache.commons.lang3.StringUtils.isEmpty; import static org.hibernate.internal.util.collections.CollectionHelper.listOf; @Component @@ -917,4 +913,154 @@ public class CallDao { return callEntity; } + public PageableResponseBean> getAllCallsByPagination(HttpServletRequest request,UserEntity user,Long companyId , Boolean onlyPreferredCall, CallPageableRequestBean callPageableRequestBean) { + Integer pageNo = null; + Integer pageLimit = null; + if (callPageableRequestBean.getGlobalFilters() != null) { + pageNo = callPageableRequestBean.getGlobalFilters().getPage(); + pageLimit = callPageableRequestBean.getGlobalFilters().getLimit(); + } + if (pageLimit == null || pageLimit <= 0) { + pageLimit = GepafinConstant.DEFAULT_PAGE_LIMIT; + } + if (pageNo == null || pageNo <= 0) { + pageNo = GepafinConstant.DEFAULT_PAGE; + } + if (Boolean.TRUE.equals(onlyPreferredCall) && companyId == null) { + throw new CustomValidationException( + Status.VALIDATION_ERROR, + Translator.toLocale(GepafinConstant.COMPANY_ID_REQUIRED_FOR_PREFERRED_CALL) + ); + } + Specification spec = search(user, callPageableRequestBean); + Page entityPage; + if (Boolean.TRUE.equals(onlyPreferredCall)) { + validator.validateUserWithCompany(request, companyId); + UserWithCompanyEntity userWithCompanyEntity = companyService.getUserWithCompany(user.getId(), companyId); + List preferredCalls = beneficiaryPreferredCallRepository + .findByUserIdAndUserWithCompanyIdAndIsDeletedFalse(user.getId(), userWithCompanyEntity.getId()); + List preferredCallIds = preferredCalls.stream() + .map(BeneficiaryPreferredCallEntity::getCallId) + .collect(Collectors.toList()); + + // Add preferredCallIds filtering to the specification + spec = spec.and((root, query, criteriaBuilder) -> + root.get(GepafinConstant.ID).in(preferredCallIds) + ); + } + entityPage = callRepository.findAll(spec, PageRequest.of(pageNo - 1, pageLimit)); + List callIds=new ArrayList<>(); + if(entityPage!=null && entityPage.getContent()!=null && Boolean.FALSE.equals(entityPage.getContent().isEmpty())) { + callIds = entityPage.getContent().stream().map(CallEntity::getId).collect(Collectors.toList()); + } + Map preferredCallsMap = + getBeneficiaryPreferredCallsForUser(request,user, callIds, companyId); + + List callDetailsResponseBeans = entityPage.getContent().stream() + .map(callEntity -> { + CallDetailsResponseBean responseBean = convertToCallDetailsResponseBean(callEntity); + String key = user.getId() + "_" + callEntity.getId(); + BeneficiaryPreferredCallEntity preferredCall = preferredCallsMap.get(key); + Long preferredId = preferredCall != null ? preferredCall.getId() : null; + responseBean.setPreferredCallId(preferredId); + + return responseBean; + }) + .collect(Collectors.toList()); + + + PageableResponseBean> pageableResponseBean = new PageableResponseBean<>(); + pageableResponseBean.setBody(callDetailsResponseBeans); + pageableResponseBean.setCurrentPage(entityPage.getNumber() + 1); // Page numbers typically start from 0, so add 1 for user-friendly indexing + pageableResponseBean.setTotalPages(entityPage.getTotalPages()); + pageableResponseBean.setTotalRecords(entityPage.getTotalElements()); + pageableResponseBean.setPageSize(entityPage.getSize()); + + return pageableResponseBean; + } + + public Specification search(UserEntity userEntity, CallPageableRequestBean callPageableRequestBean) { + return (root, query, criteriaBuilder) -> { + + List predicates = getPredicates(callPageableRequestBean, criteriaBuilder, root, userEntity); + SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true); + + if (callPageableRequestBean.getGlobalFilters() != null + && callPageableRequestBean.getGlobalFilters().getSortBy() != null && + callPageableRequestBean.getGlobalFilters().getSortBy().getColumnName() != null && Boolean.FALSE.equals( + isEmpty(callPageableRequestBean.getGlobalFilters().getSortBy().getColumnName()))) { + sortBy.setColumnName(callPageableRequestBean.getGlobalFilters().getSortBy().getColumnName()); + sortBy.setSortDesc(true); + if (callPageableRequestBean.getGlobalFilters().getSortBy().getSortDesc() != null) { + sortBy.setSortDesc(callPageableRequestBean.getGlobalFilters().getSortBy().getSortDesc()); + } + } + + query.orderBy(criteriaBuilder.desc(root.get(sortBy.getColumnName()))); + if (Boolean.FALSE.equals(sortBy.getSortDesc())) { + query.orderBy(criteriaBuilder.asc(root.get(sortBy.getColumnName()))); + } + return query.where(criteriaBuilder.and(predicates.toArray(new Predicate[0]))).getRestriction(); + }; + } + + + private List getPredicates(CallPageableRequestBean callPageableRequestBean, + CriteriaBuilder criteriaBuilder, Root root, UserEntity userEntity) { + + Integer year = null; + String search = null; + if (callPageableRequestBean.getGlobalFilters() != null) { + year = callPageableRequestBean.getGlobalFilters().getYear(); + search = callPageableRequestBean.getGlobalFilters().getSearch(); + } + List predicates = new ArrayList<>(); + if (year != null && year > 0) { + int filterYear = callPageableRequestBean.getGlobalFilters().getYear(); + +// Create LocalDateTime boundaries for the start and end of the year + LocalDateTime startOfYear = LocalDateTime.of(filterYear, 1, 1, 0, 0); + LocalDateTime endOfYear = LocalDateTime.of(filterYear, 12, 31, 23, 59, 59); + +// Add the range comparison to filter records within the year + predicates.add(criteriaBuilder.between(root.get(GepafinConstant.CREATED_DATE), startOfYear, endOfYear)); + + } + // Search in `title` and `message` (if search term is provided) + if (search != null && !search.isEmpty()) { + Predicate descriptionShort = criteriaBuilder.like( + criteriaBuilder.upper(root.get(GepafinConstant.DESCRIPTION_SHORT)), + "%" + search.toUpperCase() + "%" + ); + predicates.add(criteriaBuilder.or(descriptionShort)); + + Predicate descriptionLong = criteriaBuilder.like( + criteriaBuilder.upper(root.get(GepafinConstant.DESCRIPTION_LONG)), + "%" + search.toUpperCase() + "%" + ); + predicates.add(criteriaBuilder.or(descriptionLong)); + + Predicate name = criteriaBuilder.like( + criteriaBuilder.upper(root.get(GepafinConstant.NAME)), + "%" + search.toUpperCase() + "%" + ); + predicates.add(criteriaBuilder.or(name)); + + + } + + // Filter by `status` (if status list is provided) + if (callPageableRequestBean.getStatus() != null && !callPageableRequestBean.getStatus().isEmpty()) { + List statusValues = callPageableRequestBean.getStatus().stream() + .map(CallStatusEnum::name) // Convert enum to string + .toList(); + predicates.add(root.get(GepafinConstant.STATUS).in(statusValues)); + } + + predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.HUB).get(GepafinConstant.ID), userEntity.getHub().getId())); + + + return predicates; + + } } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/NotificationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/NotificationDao.java index 9acacdb0..3944246c 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/NotificationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/NotificationDao.java @@ -1,5 +1,9 @@ package net.gepafin.tendermanagement.dao; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.Expression; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; import lombok.extern.slf4j.Slf4j; import net.gepafin.tendermanagement.config.Translator; import net.gepafin.tendermanagement.constants.GepafinConstant; @@ -12,8 +16,12 @@ 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.GlobalFilters; import net.gepafin.tendermanagement.model.request.NotificationReq; +import net.gepafin.tendermanagement.model.request.NotificationRequestBean; import net.gepafin.tendermanagement.model.response.NotificationResponse; +import net.gepafin.tendermanagement.model.response.PageableResponseBean; +import net.gepafin.tendermanagement.model.util.SortBy; import net.gepafin.tendermanagement.repositories.NotificationRepository; import net.gepafin.tendermanagement.repositories.NotificationTypeRepository; import net.gepafin.tendermanagement.repositories.UserRepository; @@ -23,9 +31,16 @@ 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.opensaml.xmlsec.signature.G; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; import org.springframework.messaging.simp.SimpMessagingTemplate; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; import java.time.LocalDateTime; import java.util.ArrayList; @@ -34,6 +49,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import static org.apache.commons.lang3.StringUtils.isEmpty; import static org.hibernate.internal.util.collections.CollectionHelper.listOf; @Component @@ -275,4 +291,113 @@ public class NotificationDao { return notificationEntities.stream().map(this::convertNotificationEntityToNotificationResponse).toList(); } + + public PageableResponseBean> getAllNotification(Long userId, NotificationRequestBean notificationRequestBean) { + Integer pageNo = null; + Integer pageLimit = null; + if (notificationRequestBean.getGlobalFilters() != null) { + pageNo = notificationRequestBean.getGlobalFilters().getPage(); + pageLimit = notificationRequestBean.getGlobalFilters().getLimit(); + } + if (pageLimit == null || pageLimit <= 0) { + pageLimit = GepafinConstant.DEFAULT_PAGE_LIMIT; + } + if (pageNo == null || pageNo <= 0) { + pageNo = GepafinConstant.DEFAULT_PAGE; + } + Specification spec = search(userId, notificationRequestBean); + Page entityPage = notificationRepository.findAll(spec, PageRequest.of(pageNo - 1, pageLimit)); + // Prepare the response + + + List notificationResponses = entityPage.getContent().stream() + .map(notification -> { + NotificationResponse response = convertNotificationEntityToNotificationResponse(notification); + return response; + }) + .collect(Collectors.toList()); + + + PageableResponseBean> pageableResponseBean = new PageableResponseBean<>(); + pageableResponseBean.setBody(notificationResponses); + pageableResponseBean.setCurrentPage(entityPage.getNumber() + 1); // Page numbers typically start from 0, so add 1 for user-friendly indexing + pageableResponseBean.setTotalPages(entityPage.getTotalPages()); + pageableResponseBean.setTotalRecords(entityPage.getTotalElements()); + pageableResponseBean.setPageSize(entityPage.getSize()); + + return pageableResponseBean; + } + + public Specification search(Long userId, NotificationRequestBean notificationRequestBean) { + return (root, query, criteriaBuilder) -> { + + List predicates = getPredicates(notificationRequestBean, criteriaBuilder, root, userId); + SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true); + + if (notificationRequestBean.getGlobalFilters() != null + && notificationRequestBean.getGlobalFilters().getSortBy() != null && + notificationRequestBean.getGlobalFilters().getSortBy().getColumnName() != null && Boolean.FALSE.equals( + isEmpty(notificationRequestBean.getGlobalFilters().getSortBy().getColumnName()))) { + sortBy.setColumnName(notificationRequestBean.getGlobalFilters().getSortBy().getColumnName()); + sortBy.setSortDesc(true); + if (notificationRequestBean.getGlobalFilters().getSortBy().getSortDesc() != null) { + sortBy.setSortDesc(notificationRequestBean.getGlobalFilters().getSortBy().getSortDesc()); + } + } + + query.orderBy(criteriaBuilder.desc(root.get(sortBy.getColumnName()))); + if (Boolean.FALSE.equals(sortBy.getSortDesc())) { + query.orderBy(criteriaBuilder.asc(root.get(sortBy.getColumnName()))); + } + return query.where(criteriaBuilder.and(predicates.toArray(new Predicate[0]))).getRestriction(); + }; + } + + + private List getPredicates(NotificationRequestBean notificationRequestBean, + CriteriaBuilder criteriaBuilder, Root root, Long userId) { + + Integer year = null; + String search = null; + if (notificationRequestBean.getGlobalFilters() != null) { + year = notificationRequestBean.getGlobalFilters().getYear(); + search = notificationRequestBean.getGlobalFilters().getSearch(); + } + List predicates = new ArrayList<>(); + if (year != null && year > 0) { + int filterYear = notificationRequestBean.getGlobalFilters().getYear(); + + // Create LocalDateTime boundaries for the start and end of the year + LocalDateTime startOfYear = LocalDateTime.of(filterYear, 1, 1, 0, 0); + LocalDateTime endOfYear = LocalDateTime.of(filterYear, 12, 31, 23, 59, 59); + + // Add the range comparison to filter records within the year + predicates.add(criteriaBuilder.between(root.get(GepafinConstant.CREATED_DATE), startOfYear, endOfYear)); + + } + // Search in `title` and `message` (if search term is provided) + if (search != null && !search.isEmpty()) { + Predicate titlePredicate = criteriaBuilder.like( + criteriaBuilder.upper(root.get(GepafinConstant.TITLE)), + "%" + search.toUpperCase() + "%" + ); + Predicate messagePredicate = criteriaBuilder.like( + criteriaBuilder.upper(root.get(GepafinConstant.MESSAGE)), + "%" + search.toUpperCase() + "%" + ); + predicates.add(criteriaBuilder.or(titlePredicate, messagePredicate)); + } + + // Filter by `status` (if status list is provided) + if (notificationRequestBean.getStatus() != null && !notificationRequestBean.getStatus().isEmpty()) { + List statusValues = notificationRequestBean.getStatus().stream() + .map(NotificationEnum::name) // Convert enum to string + .toList(); + predicates.add(root.get(GepafinConstant.STATUS).in(statusValues)); + } + predicates.add(criteriaBuilder.isFalse(root.get(GepafinConstant.IS_DELETED))); + + predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.USER_ID), userId)); + return predicates; + } } diff --git a/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java b/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java index 20f917fe..2408cb9c 100644 --- a/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java +++ b/src/main/java/net/gepafin/tendermanagement/enums/UserActionContextEnum.java @@ -161,7 +161,13 @@ public enum UserActionContextEnum { /** appointment action context **/ CHECK_OR_CREATE_NDG_CODE("CHECK_OR_CREATE_NDG_CODE"), CREATE_APPOINTMENT("CREATE_APPOINTMENT"), - UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM("UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM"); + UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM("UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM"), + + GET_ALL_NOTIFICATION_BY_PAGINATION("GET_ALL_NOTIFICATION_BY_PAGINATION"), + GET_ALL_CALL_BY_PAGINATION("GET_ALL_CALL_BY_PAGINATION"), + GET_ALL_APPLICATION_BY_PAGINATION("GET_ALL_APPLICATION_BY_PAGINATION"); + + private final String value; diff --git a/src/main/java/net/gepafin/tendermanagement/model/request/ApplicationPageableRequestBean.java b/src/main/java/net/gepafin/tendermanagement/model/request/ApplicationPageableRequestBean.java new file mode 100644 index 00000000..dcb2aebc --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/model/request/ApplicationPageableRequestBean.java @@ -0,0 +1,14 @@ +package net.gepafin.tendermanagement.model.request; + +import lombok.Data; +import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum; + +import java.util.List; + +@Data +public class ApplicationPageableRequestBean { + + private GlobalFilters globalFilters; + + private List status; +} diff --git a/src/main/java/net/gepafin/tendermanagement/model/request/CallPageableRequestBean.java b/src/main/java/net/gepafin/tendermanagement/model/request/CallPageableRequestBean.java new file mode 100644 index 00000000..8b848c85 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/model/request/CallPageableRequestBean.java @@ -0,0 +1,14 @@ +package net.gepafin.tendermanagement.model.request; + +import lombok.Data; +import net.gepafin.tendermanagement.enums.CallStatusEnum; + +import java.util.List; + +@Data +public class CallPageableRequestBean { + + private GlobalFilters globalFilters; + + private List status; +} diff --git a/src/main/java/net/gepafin/tendermanagement/model/request/GlobalFilters.java b/src/main/java/net/gepafin/tendermanagement/model/request/GlobalFilters.java new file mode 100644 index 00000000..d036a68d --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/model/request/GlobalFilters.java @@ -0,0 +1,18 @@ +package net.gepafin.tendermanagement.model.request; + +import lombok.Data; +import net.gepafin.tendermanagement.model.util.SortBy; + + +@Data +public class GlobalFilters { + private Integer year; + + private Integer page; + + private String search; + + private Integer limit; + + private SortBy sortBy; +} diff --git a/src/main/java/net/gepafin/tendermanagement/model/request/NotificationRequestBean.java b/src/main/java/net/gepafin/tendermanagement/model/request/NotificationRequestBean.java new file mode 100644 index 00000000..6e8c0389 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/model/request/NotificationRequestBean.java @@ -0,0 +1,14 @@ +package net.gepafin.tendermanagement.model.request; + +import lombok.Data; +import net.gepafin.tendermanagement.enums.NotificationEnum; + +import java.util.List; + +@Data +public class NotificationRequestBean { + + private GlobalFilters globalFilters; + + private List status; +} diff --git a/src/main/java/net/gepafin/tendermanagement/model/response/PageableResponseBean.java b/src/main/java/net/gepafin/tendermanagement/model/response/PageableResponseBean.java new file mode 100644 index 00000000..f4b92929 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/model/response/PageableResponseBean.java @@ -0,0 +1,13 @@ +package net.gepafin.tendermanagement.model.response; + +import lombok.Data; + +@Data +public class PageableResponseBean { + + private T body; + private Long totalRecords; + private int currentPage; + private int totalPages; + private int pageSize; +} diff --git a/src/main/java/net/gepafin/tendermanagement/model/util/SortBy.java b/src/main/java/net/gepafin/tendermanagement/model/util/SortBy.java new file mode 100644 index 00000000..5e4032a6 --- /dev/null +++ b/src/main/java/net/gepafin/tendermanagement/model/util/SortBy.java @@ -0,0 +1,12 @@ +package net.gepafin.tendermanagement.model.util; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class SortBy { + + String columnName; + Boolean sortDesc; +} diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/CallRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/CallRepository.java index 833e1d68..dc53bad7 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/CallRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/CallRepository.java @@ -1,6 +1,7 @@ package net.gepafin.tendermanagement.repositories; import net.gepafin.tendermanagement.entities.CallEntity; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @@ -9,7 +10,7 @@ import java.math.BigDecimal; import java.util.List; @Repository -public interface CallRepository extends JpaRepository { +public interface CallRepository extends JpaRepository, JpaSpecificationExecutor { // public CallEntity findByIdAndStatusNotIn(Long id, List status); diff --git a/src/main/java/net/gepafin/tendermanagement/repositories/NotificationRepository.java b/src/main/java/net/gepafin/tendermanagement/repositories/NotificationRepository.java index bce3ba68..254547f4 100644 --- a/src/main/java/net/gepafin/tendermanagement/repositories/NotificationRepository.java +++ b/src/main/java/net/gepafin/tendermanagement/repositories/NotificationRepository.java @@ -1,12 +1,18 @@ package net.gepafin.tendermanagement.repositories; import net.gepafin.tendermanagement.entities.NotificationEntity; +import org.apache.poi.ss.formula.functions.T; import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import java.util.List; -public interface NotificationRepository extends JpaRepository { +public interface NotificationRepository extends JpaRepository , JpaSpecificationExecutor { NotificationEntity findByIdAndIsDeletedFalse(Long id); @@ -17,4 +23,5 @@ public interface NotificationRepository extends JpaRepository findByUserIdAndIsDeletedFalseAndStatusIn(Long userId, List statuses); List findByUserWithCompanyIdAndUserIdAndIsDeletedFalse(Long userWithCompanyId, Long userId); + } diff --git a/src/main/java/net/gepafin/tendermanagement/service/ApplicationService.java b/src/main/java/net/gepafin/tendermanagement/service/ApplicationService.java index 3ab94ae2..24935ca9 100644 --- a/src/main/java/net/gepafin/tendermanagement/service/ApplicationService.java +++ b/src/main/java/net/gepafin/tendermanagement/service/ApplicationService.java @@ -2,18 +2,17 @@ package net.gepafin.tendermanagement.service; import jakarta.servlet.http.HttpServletRequest; import net.gepafin.tendermanagement.entities.ApplicationEntity; +import net.gepafin.tendermanagement.model.request.ApplicationPageableRequestBean; import net.gepafin.tendermanagement.model.request.ApplicationRequest; import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum; import net.gepafin.tendermanagement.enums.FormActionEnum; import net.gepafin.tendermanagement.model.request.ApplicationRequestBean; -import net.gepafin.tendermanagement.model.response.ApplicationGetResponseBean; -import net.gepafin.tendermanagement.model.response.ApplicationResponse; -import net.gepafin.tendermanagement.model.response.ApplicationResponseBean; -import net.gepafin.tendermanagement.model.response.ApplicationSignedDocumentResponse; -import net.gepafin.tendermanagement.model.response.NextOrPreviousFormResponse; +import net.gepafin.tendermanagement.model.response.*; import java.util.List; +import net.gepafin.tendermanagement.model.util.Response; +import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; public interface ApplicationService { @@ -41,5 +40,9 @@ public interface ApplicationService { public void deleteSignedDocument(HttpServletRequest request, Long applicationId); public ApplicationResponse validateApplication(HttpServletRequest request, Long applicationId); + byte[] downloadApplicationDocumentsAsZip(HttpServletRequest request, Long applicationId); -} + + PageableResponseBean> getAllApplicationByPagination(HttpServletRequest request, Long callId, Long companyId, ApplicationPageableRequestBean applicationPageableRequestBean); + + } diff --git a/src/main/java/net/gepafin/tendermanagement/service/CallService.java b/src/main/java/net/gepafin/tendermanagement/service/CallService.java index 8762d576..b12a3398 100644 --- a/src/main/java/net/gepafin/tendermanagement/service/CallService.java +++ b/src/main/java/net/gepafin/tendermanagement/service/CallService.java @@ -5,11 +5,13 @@ import java.util.List; import jakarta.servlet.http.HttpServletRequest; import net.gepafin.tendermanagement.entities.CallEntity; import net.gepafin.tendermanagement.enums.CallStatusEnum; +import net.gepafin.tendermanagement.model.request.CallPageableRequestBean; import net.gepafin.tendermanagement.model.request.CreateCallRequestStep1; import net.gepafin.tendermanagement.model.request.CreateCallRequestStep2; import net.gepafin.tendermanagement.model.request.UpdateCallRequestStep1; import net.gepafin.tendermanagement.model.response.CallDetailsResponseBean; import net.gepafin.tendermanagement.model.response.CallResponse; +import net.gepafin.tendermanagement.model.response.PageableResponseBean; public interface CallService { @@ -30,5 +32,9 @@ public interface CallService { CallEntity validateCall(Long callId); CallEntity validatePublishedCall(Long callId, Long hubId); + byte[] downloadCallDocumentsAsZip(HttpServletRequest request, Long callId); + + PageableResponseBean> getAllCallsByPagination(HttpServletRequest request, Long companyId , Boolean onlyPreferredCall,CallPageableRequestBean callPageableRequestBean); + } diff --git a/src/main/java/net/gepafin/tendermanagement/service/NotificationService.java b/src/main/java/net/gepafin/tendermanagement/service/NotificationService.java index ca5927c0..940d753e 100644 --- a/src/main/java/net/gepafin/tendermanagement/service/NotificationService.java +++ b/src/main/java/net/gepafin/tendermanagement/service/NotificationService.java @@ -2,8 +2,12 @@ package net.gepafin.tendermanagement.service; import jakarta.servlet.http.HttpServletRequest; import net.gepafin.tendermanagement.enums.NotificationEnum; +import net.gepafin.tendermanagement.model.request.GlobalFilters; import net.gepafin.tendermanagement.model.request.NotificationReq; +import net.gepafin.tendermanagement.model.request.NotificationRequestBean; import net.gepafin.tendermanagement.model.response.NotificationResponse; +import net.gepafin.tendermanagement.model.response.PageableResponseBean; +import org.springframework.data.domain.Page; import java.util.List; @@ -20,4 +24,5 @@ public interface NotificationService { public List getNotificationsByCompanyIdAndUserId(Long userId, Long companyId, List statuses); + PageableResponseBean> getAllNotification(HttpServletRequest request,Long userId, NotificationRequestBean notificationRequestBean); } diff --git a/src/main/java/net/gepafin/tendermanagement/service/impl/ApplicationServiceImpl.java b/src/main/java/net/gepafin/tendermanagement/service/impl/ApplicationServiceImpl.java index 6a3d827b..c5d937a2 100644 --- a/src/main/java/net/gepafin/tendermanagement/service/impl/ApplicationServiceImpl.java +++ b/src/main/java/net/gepafin/tendermanagement/service/impl/ApplicationServiceImpl.java @@ -8,15 +8,12 @@ import net.gepafin.tendermanagement.dao.FlowFormDao; import net.gepafin.tendermanagement.entities.ApplicationEntity; import net.gepafin.tendermanagement.entities.CompanyEntity; import net.gepafin.tendermanagement.entities.UserEntity; +import net.gepafin.tendermanagement.model.request.ApplicationPageableRequestBean; import net.gepafin.tendermanagement.model.request.ApplicationRequest; import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum; import net.gepafin.tendermanagement.enums.FormActionEnum; import net.gepafin.tendermanagement.model.request.ApplicationRequestBean; -import net.gepafin.tendermanagement.model.response.ApplicationGetResponseBean; -import net.gepafin.tendermanagement.model.response.ApplicationResponse; -import net.gepafin.tendermanagement.model.response.ApplicationResponseBean; -import net.gepafin.tendermanagement.model.response.ApplicationSignedDocumentResponse; -import net.gepafin.tendermanagement.model.response.NextOrPreviousFormResponse; +import net.gepafin.tendermanagement.model.response.*; import net.gepafin.tendermanagement.service.ApplicationService; import net.gepafin.tendermanagement.util.Validator; import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException; @@ -128,5 +125,14 @@ public class ApplicationServiceImpl implements ApplicationService { public byte[] downloadApplicationDocumentsAsZip(HttpServletRequest request, Long applicationId) { return applicationDao.downloadApplicationDocumentsAsZip(request,applicationId); } - + + @Override + public PageableResponseBean> getAllApplicationByPagination(HttpServletRequest request, Long callId, Long companyId, ApplicationPageableRequestBean applicationPageableRequestBean) { + UserEntity userEntity = validator.validateUser(request); + if (companyId != null) { + validator.validateUserWithCompany(request, companyId); + } + return applicationDao.getAllApplicationByPagination(userEntity,callId,companyId,applicationPageableRequestBean); + } + } diff --git a/src/main/java/net/gepafin/tendermanagement/service/impl/CallServiceImpl.java b/src/main/java/net/gepafin/tendermanagement/service/impl/CallServiceImpl.java index 38fd9562..07823f1c 100644 --- a/src/main/java/net/gepafin/tendermanagement/service/impl/CallServiceImpl.java +++ b/src/main/java/net/gepafin/tendermanagement/service/impl/CallServiceImpl.java @@ -5,11 +5,13 @@ import net.gepafin.tendermanagement.dao.CallDao; import net.gepafin.tendermanagement.entities.CallEntity; import net.gepafin.tendermanagement.entities.UserEntity; import net.gepafin.tendermanagement.enums.CallStatusEnum; +import net.gepafin.tendermanagement.model.request.CallPageableRequestBean; import net.gepafin.tendermanagement.model.request.CreateCallRequestStep1; import net.gepafin.tendermanagement.model.request.CreateCallRequestStep2; import net.gepafin.tendermanagement.model.request.UpdateCallRequestStep1; import net.gepafin.tendermanagement.model.response.CallDetailsResponseBean; import net.gepafin.tendermanagement.model.response.CallResponse; +import net.gepafin.tendermanagement.model.response.PageableResponseBean; import net.gepafin.tendermanagement.service.CallService; import net.gepafin.tendermanagement.util.Validator; @@ -102,5 +104,11 @@ public class CallServiceImpl implements CallService { validator.validateUserWithCall(user, callId); return callDao.downloadCallDocumentsAsZip(callId); } - + + @Override + public PageableResponseBean> getAllCallsByPagination(HttpServletRequest request,Long companyId , Boolean onlyPreferredCall, CallPageableRequestBean callPageableRequestBean) { + UserEntity user = validator.validateUser(request); + return callDao.getAllCallsByPagination(request,user,companyId,onlyPreferredCall,callPageableRequestBean); + } + } diff --git a/src/main/java/net/gepafin/tendermanagement/service/impl/NotificationServiceImpl.java b/src/main/java/net/gepafin/tendermanagement/service/impl/NotificationServiceImpl.java index 86eaa5cf..bb9f167d 100644 --- a/src/main/java/net/gepafin/tendermanagement/service/impl/NotificationServiceImpl.java +++ b/src/main/java/net/gepafin/tendermanagement/service/impl/NotificationServiceImpl.java @@ -3,11 +3,17 @@ 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.entities.UserEntity; import net.gepafin.tendermanagement.enums.NotificationEnum; +import net.gepafin.tendermanagement.model.request.GlobalFilters; import net.gepafin.tendermanagement.model.request.NotificationReq; +import net.gepafin.tendermanagement.model.request.NotificationRequestBean; import net.gepafin.tendermanagement.model.response.NotificationResponse; +import net.gepafin.tendermanagement.model.response.PageableResponseBean; import net.gepafin.tendermanagement.service.NotificationService; +import net.gepafin.tendermanagement.util.Validator; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; import org.springframework.stereotype.Service; import java.util.List; @@ -21,6 +27,9 @@ public class NotificationServiceImpl implements NotificationService { @Autowired private NotificationDao notificationDao; + @Autowired + private Validator validator; + @Override public NotificationResponse sendNotification(Long userId, NotificationReq notificationReq, Long companyId) { @@ -59,4 +68,10 @@ public class NotificationServiceImpl implements NotificationService { public List getNotificationsByCompanyIdAndUserId(Long userId, Long companyId, List statuses) { return notificationDao.getNotificationByCompanyIdAndUserId(userId, companyId, statuses); } + + @Override + public PageableResponseBean> getAllNotification(HttpServletRequest request, Long userId, NotificationRequestBean notificationRequestBean) { + UserEntity userEntity = validator.validateUser(request); + return notificationDao.getAllNotification(userId,notificationRequestBean); + } } \ No newline at end of file diff --git a/src/main/java/net/gepafin/tendermanagement/util/Utils.java b/src/main/java/net/gepafin/tendermanagement/util/Utils.java index b126e6dd..e1df59bf 100644 --- a/src/main/java/net/gepafin/tendermanagement/util/Utils.java +++ b/src/main/java/net/gepafin/tendermanagement/util/Utils.java @@ -25,6 +25,7 @@ import jakarta.persistence.OneToMany; import jakarta.persistence.OneToOne; import jakarta.servlet.http.HttpServletRequest; import net.gepafin.tendermanagement.constants.GepafinConstant; +import net.gepafin.tendermanagement.model.request.GlobalFilters; import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -690,4 +691,16 @@ public class Utils { public static String createChannelForUserAndCompany(Long userId, Long companyId) { return GepafinConstant.COMMON_SINGLE_CHANNEL_PREFIX + userId + GepafinConstant.COMPANY_PREFIX + companyId; } + public static GlobalFilters setPageNumberAndLimit(GlobalFilters globalFilters){ + if (globalFilters == null) { + if (globalFilters.getLimit() == null || globalFilters.getLimit() <= 0) { + globalFilters.setLimit(GepafinConstant.DEFAULT_PAGE_LIMIT); + } + + if (globalFilters.getPage() == null || globalFilters.getPage() <= 0) { + globalFilters.setPage(GepafinConstant.DEFAULT_PAGE); + } + } + return globalFilters; + } } \ No newline at end of file diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationApi.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationApi.java index d72f4daf..6b98b3f3 100644 --- a/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationApi.java +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationApi.java @@ -2,6 +2,9 @@ package net.gepafin.tendermanagement.web.rest.api; import java.util.List; +import net.gepafin.tendermanagement.model.request.ApplicationPageableRequestBean; +import net.gepafin.tendermanagement.model.request.NotificationRequestBean; +import net.gepafin.tendermanagement.model.response.*; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -19,12 +22,6 @@ import net.gepafin.tendermanagement.model.request.ApplicationRequest; import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum; import net.gepafin.tendermanagement.enums.FormActionEnum; import net.gepafin.tendermanagement.model.request.ApplicationRequestBean; -import net.gepafin.tendermanagement.model.response.ApplicationGetResponseBean; -import net.gepafin.tendermanagement.model.response.ApplicationResponse; -import net.gepafin.tendermanagement.model.response.ApplicationResponseBean; -import net.gepafin.tendermanagement.model.response.ApplicationSignedDocumentResponse; -import net.gepafin.tendermanagement.model.response.CompanyDelegationResponse; -import net.gepafin.tendermanagement.model.response.NextOrPreviousFormResponse; import net.gepafin.tendermanagement.model.util.Response; import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants; @@ -59,7 +56,7 @@ public interface ApplicationApi { @GetMapping(value = "/{applicationId}", produces = "application/json") ResponseEntity> getApplicationByFormId(HttpServletRequest request, @Parameter(description = "The application id", required = true) @PathVariable(value = "applicationId", required = true) Long applicationId,@Parameter(description = "The form id", required = false) @RequestParam(value = "formId",required = false) Long formId); - @Operation(summary = "Api to get all applications", + @Operation(summary = "Api to get all applications (deprecated)", responses = { @ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = { @@ -213,5 +210,18 @@ public interface ApplicationApi { @GetMapping(value = "/{applicationId}/documents/zip") ResponseEntity downloadApplicationDocumentsAsZip(HttpServletRequest httpServletRequest, @Parameter(required = true) @PathVariable("applicationId") Long applicationId); + + + @Operation(summary = "Api to get all application by pagination.", 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 = "/pagination", consumes = "application/json", produces = "application/json") + ResponseEntity>>> getAllApplicationByPagination(HttpServletRequest request,@Parameter(description = "The call id", required = false) @RequestParam(value = "callId", required = false) Long callId, + @Parameter(description = "The company id", required = false) @RequestParam(value = "companyId", required = false) Long companyId, @RequestBody ApplicationPageableRequestBean applicationPageableRequestBean); + } diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/CallApi.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/CallApi.java index 5a7d0384..e14ed8e7 100644 --- a/src/main/java/net/gepafin/tendermanagement/web/rest/api/CallApi.java +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/CallApi.java @@ -3,6 +3,9 @@ package net.gepafin.tendermanagement.web.rest.api; import java.util.List; import net.gepafin.tendermanagement.enums.CallStatusEnum; +import net.gepafin.tendermanagement.model.request.CallPageableRequestBean; +import net.gepafin.tendermanagement.model.response.ApplicationResponse; +import net.gepafin.tendermanagement.model.response.PageableResponseBean; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; @@ -89,7 +92,7 @@ public interface CallApi { @Parameter(description = "The call ID", required = true) @PathVariable("callId") Long callId,@RequestParam(value = "companyId", required = false) Long companyId); - @Operation(summary = "Api to get all calls", + @Operation(summary = "Api to get all calls (deprecated)", responses = { @ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = { @@ -149,4 +152,17 @@ public interface CallApi { ResponseEntity downloadCallDocumentsAsZip(HttpServletRequest httpServletRequest, @Parameter(description = "The call ID", required = true) @PathVariable("callId") Long callId); + + @Operation(summary = "Api to get all calls by pagination.", 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 = "/pagination", consumes = "application/json", produces = "application/json") + ResponseEntity>>> getAllCallsByPagination(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId , @RequestParam(value = "onlyPreferredCall", required = false, defaultValue = "false") Boolean onlyPreferredCall, @RequestBody CallPageableRequestBean callPageableRequestBean); + + + } diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/NotificationApi.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/NotificationApi.java index ca059499..44bc0e84 100644 --- a/src/main/java/net/gepafin/tendermanagement/web/rest/api/NotificationApi.java +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/NotificationApi.java @@ -7,10 +7,14 @@ 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.GlobalFilters; import net.gepafin.tendermanagement.model.request.NotificationReq; +import net.gepafin.tendermanagement.model.request.NotificationRequestBean; import net.gepafin.tendermanagement.model.response.NotificationResponse; +import net.gepafin.tendermanagement.model.response.PageableResponseBean; import net.gepafin.tendermanagement.model.util.Response; import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants; +import org.springframework.data.domain.Page; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; @@ -96,6 +100,16 @@ public interface NotificationApi { @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 statuses); + @Operation(summary = "Api to get all notification by pagination.", 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}/pagination", consumes = "application/json", produces = "application/json") + ResponseEntity>>> getAllNotification(HttpServletRequest request,@Parameter(description = "The user id", required = true) @PathVariable(value = "userId") Long userId, @RequestBody NotificationRequestBean notificationRequestBean); + } diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/ApplicationApiController.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/ApplicationApiController.java index 3223dda7..ccf386c7 100644 --- a/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/ApplicationApiController.java +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/ApplicationApiController.java @@ -5,16 +5,13 @@ import net.gepafin.tendermanagement.config.Translator; import net.gepafin.tendermanagement.constants.GepafinConstant; import net.gepafin.tendermanagement.enums.UserActionContextEnum; import net.gepafin.tendermanagement.enums.UserActionLogsEnum; +import net.gepafin.tendermanagement.model.request.ApplicationPageableRequestBean; import net.gepafin.tendermanagement.model.request.ApplicationRequest; import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum; import net.gepafin.tendermanagement.enums.FormActionEnum; import net.gepafin.tendermanagement.model.request.ApplicationRequestBean; import net.gepafin.tendermanagement.model.request.UserActionRequest; -import net.gepafin.tendermanagement.model.response.ApplicationGetResponseBean; -import net.gepafin.tendermanagement.model.response.ApplicationResponse; -import net.gepafin.tendermanagement.model.response.ApplicationResponseBean; -import net.gepafin.tendermanagement.model.response.ApplicationSignedDocumentResponse; -import net.gepafin.tendermanagement.model.response.NextOrPreviousFormResponse; +import net.gepafin.tendermanagement.model.response.*; import net.gepafin.tendermanagement.model.util.Response; import net.gepafin.tendermanagement.service.ApplicationService; import net.gepafin.tendermanagement.service.PdfService; @@ -229,4 +226,15 @@ public class ApplicationApiController implements ApplicationApi { return new ResponseEntity<>(zipFile, headers, HttpStatus.OK); } + @Override + public ResponseEntity>>> getAllApplicationByPagination(HttpServletRequest request, Long callId, Long companyId, ApplicationPageableRequestBean applicationPageableRequestBean) { + + /** This code is responsible for creating user action logs for the "get all notification by pagination" operation. **/ + loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_ALL_APPLICATION_BY_PAGINATION).build()); + + PageableResponseBean> pageableResponseBean=applicationService + .getAllApplicationByPagination(request, callId,companyId,applicationPageableRequestBean); + return ResponseEntity.status(HttpStatus.OK).body(new Response<>(pageableResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.GET_APPLICATION_SUCCESS_MSG))); + } + } diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/CallApiController.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/CallApiController.java index 18d2657f..85de9a1c 100644 --- a/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/CallApiController.java +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/CallApiController.java @@ -5,7 +5,8 @@ import java.util.List; import net.gepafin.tendermanagement.enums.CallStatusEnum; import net.gepafin.tendermanagement.enums.UserActionContextEnum; import net.gepafin.tendermanagement.enums.UserActionLogsEnum; -import net.gepafin.tendermanagement.model.request.UserActionRequest; +import net.gepafin.tendermanagement.model.request.*; +import net.gepafin.tendermanagement.model.response.PageableResponseBean; import net.gepafin.tendermanagement.util.LoggingUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; @@ -14,14 +15,12 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import jakarta.servlet.http.HttpServletRequest; import net.gepafin.tendermanagement.config.Translator; import net.gepafin.tendermanagement.constants.GepafinConstant; -import net.gepafin.tendermanagement.model.request.CreateCallRequestStep1; -import net.gepafin.tendermanagement.model.request.CreateCallRequestStep2; -import net.gepafin.tendermanagement.model.request.UpdateCallRequestStep1; import net.gepafin.tendermanagement.model.response.CallDetailsResponseBean; import net.gepafin.tendermanagement.model.response.CallResponse; import net.gepafin.tendermanagement.model.util.Response; @@ -151,5 +150,16 @@ public class CallApiController implements CallApi { return new ResponseEntity<>(zipFile, headers, HttpStatus.OK); } + @Override + public ResponseEntity>>> getAllCallsByPagination(HttpServletRequest request, Long companyId , Boolean onlyPreferredCall, CallPageableRequestBean callPageableRequestBean) { + + /** This code is responsible for creating user action logs for the "get all call by pagination" operation. **/ + loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_ALL_CALL_BY_PAGINATION).build()); + + PageableResponseBean> callsByPagination=callService.getAllCallsByPagination(request,companyId,onlyPreferredCall,callPageableRequestBean); + return ResponseEntity.status(HttpStatus.OK) + .body(new Response<>(callsByPagination, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG))); + } + } \ No newline at end of file diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/NotificationApiController.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/NotificationApiController.java index d2047d7a..549b6517 100644 --- a/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/NotificationApiController.java +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/impl/NotificationApiController.java @@ -4,13 +4,21 @@ 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.enums.UserActionContextEnum; +import net.gepafin.tendermanagement.enums.UserActionLogsEnum; +import net.gepafin.tendermanagement.model.request.GlobalFilters; import net.gepafin.tendermanagement.model.request.NotificationReq; +import net.gepafin.tendermanagement.model.request.NotificationRequestBean; +import net.gepafin.tendermanagement.model.request.UserActionRequest; import net.gepafin.tendermanagement.model.response.NotificationResponse; +import net.gepafin.tendermanagement.model.response.PageableResponseBean; import net.gepafin.tendermanagement.model.util.Response; import net.gepafin.tendermanagement.service.NotificationService; +import net.gepafin.tendermanagement.util.LoggingUtil; 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.data.domain.Page; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping; @@ -25,6 +33,9 @@ public class NotificationApiController implements NotificationApi { @Autowired private NotificationService notificationService; + @Autowired + LoggingUtil loggingUtil; + public ResponseEntity> sendNotification(HttpServletRequest request, NotificationReq notificationReq, Long userId, Long companyId) { NotificationResponse notificationData = notificationService.sendNotification(userId, notificationReq, companyId); @@ -71,4 +82,14 @@ public class NotificationApiController implements NotificationApi { .body(new Response<>(notificationResponses, Status.SUCCESS, Translator.toLocale(GepafinConstant.NOTIFICATION_FETCHED_SUCCESSFULLY))); } + @Override + public ResponseEntity>>> getAllNotification(HttpServletRequest request,Long userId, NotificationRequestBean notificationRequestBean) { + + /** This code is responsible for creating user action logs for the "get all notification by pagination" operation. **/ + loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_ALL_NOTIFICATION_BY_PAGINATION).build()); + + PageableResponseBean> notificationResponses=notificationService.getAllNotification(request, userId,notificationRequestBean); + return ResponseEntity.status(HttpStatus.OK).body(new Response<>(notificationResponses, Status.SUCCESS, Translator.toLocale(GepafinConstant.NOTIFICATION_FETCHED_SUCCESSFULLY))); + } + } \ No newline at end of file From 3644aa0292497103974c913d0a4a7ab1190bd048 Mon Sep 17 00:00:00 2001 From: piyushkag Date: Wed, 15 Jan 2025 12:18:46 +0530 Subject: [PATCH 11/11] Updated code --- .../net/gepafin/tendermanagement/constants/GepafinConstant.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java index 8cf8f499..f2ba75af 100644 --- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java +++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java @@ -376,7 +376,6 @@ public class GepafinConstant { public static final String AMOUNT_ACCEPTED_REQUIRED_WHILE_APPROVING_APPLICATION="amount.accepted.required"; public static final String CALL_NAME="callName"; public static final String NUMBER_OF_APPLICATIONS="numberOfApplications"; - public static final String STATUS="status"; public static final String COUNT="count"; public static final String APPLICATION_PER_CALL="applicationPerCall"; public static final String APPLICATION_PER_STATUS="applicationPerStatus";