Contact Notification Service
Package: org.egov.works.service
Source File: ContractNotificationService.java
Dependencies: Spring Framework, Kafka, Lombok
Overview
The ContractNotificationService class manages the notification workflow for contract-related actions within the eGov Works module. It processes contract-related Kafka messages and sends appropriate notifications to relevant stakeholders.
Attributes
notificationServiceConfiguration: Configuration settings for notification services.
restTemplate: Template for making RESTful HTTP requests.
producer: Kafka producer for sending notifications.
mapper: Object mapper for JSON serialization and deserialization.
hrmsUtils: Utility class for HRMS (Human Resource Management System) operations.
estimateServiceUtil: Utility class for estimate-related operations.
projectServiceUtil: Utility class for project-related operations.
locationServiceUtil: Utility class for location-related operations.
organisationServiceUtil: Utility class for organization-related operations.
repository: Repository for service request operations.
localizationUtil: Utility class for localization operations.
contractsUtil: Utility class for contract-related operations.
Methods
process(final String record, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic): Processes the Kafka message for contract-related actions and sends notifications accordingly.
sendNotification(ContractRequest request): Sends notifications based on the type of contract action.
pushNotificationForRevisedContract(ContractRequest request): Sends notifications for revised contracts.
pushNotificationToOriginator(ContractRequest request, String message, String cboMobileNumber): Sends notifications to the originator.
pushNotificationToCreatorForRejectAction(ContractRequest request): Sends notifications to the creator for reject actions.
pushNotificationToCreatorForApproveAction(ContractRequest request): Sends notifications to the creator for approve actions.
pushNotificationToCreatorForDeclineAction(ContractRequest request): Sends notifications to the creator for decline actions.
pushNotificationToCreatorForAcceptAction(ContractRequest request): Sends notifications to the creator for accept actions.
pushNotificationToCBOForApproveAction(ContractRequest request): Sends notifications to the(CBO) for approve actions.
getDetailsForSMS(ContractRequest request, String uuid): Retrieves details required for SMS notifications.
getProjectNumber(ContractRequest request): Retrieves project details for SMS notifications.
getOrgDetailsForCBOAdmin(ContractRequest request): Retrieves organization details for CBO administrators.
getMessage(ContractRequest request, boolean isCBORole): Retrieves the message based on the contract action.
getMessage(ContractRequest request, String msgCode): Retrieves the message from localization.
buildMessageForRevisedContract(Map<String, String> userDetailsForSMS, String message, Boolean isSendBack): Builds the message for revised contracts.
buildMessageForRejectAction(Contract contract, Map<String, String> userDetailsForSMS, String message): Builds the message for reject actions.
buildMessageForApproveActionWOCBO(Contract contract, Map<String, String> userDetailsForSMS, String message): Builds the message for approve actions by WO creator.
buildMessageForWOCreator(Contract contract, Map<String, String> userDetailsForSMS, String message): Builds the message for WO creator.
buildMessageForDeclineAction_WOCreator(Contract contract, Map<String, String> userDetailsForSMS, String message): Builds the message for decline actions by WO creator.
buildMessageForAcceptAction_WOCreator(Contract contract, Map<String, String> userDetailsForSMS, String message): Builds the message for accept actions by WO creator.
getLocalisedMessages(RequestInfo requestInfo, String tenantId, String locale, String module): Retrieves localized messages.
getShortnerURL(String actualURL): Retrieves the shortened URL.
setAdditionalFields(ContractRequest request, String localizationCode,Map<String, Object> additionalField ): Sets additional fields for notifications.
checkAdditionalFieldAndPushONSmsTopic(String customizedMessage, Map<String, Object> additionalField,Map<String,String> smsDetails): Checks additional fields and pushes notifications onto the SMS topic.
Last updated