Package: org.egov.works.service
Source File: ExpenseNotificationService.java
The ExpenseNotificationService class is responsible for processing notifications related to expenses within the eGov Works module. It handles the generation and sending of notifications for both purchase bills and supervision bills.
producer: Kafka producer for sending notifications.
config: Configuration settings for notification services.
hrmsUtils: Utility class for interacting with the HRMS (Human Resource Management System).
projectServiceUtil: Utility class for project-related operations.
locationServiceUtil: Utility class for location-related operations.
mapper: Object mapper for JSON serialization/deserialization.
repository: Repository for service requests.
notificationUtil: Utility class for notification-related operations.
localizationUtil: Utility class for localization operations.
process(final String record, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic): Processes the incoming Kafka message, determining whether it pertains to a purchase bill or a supervision bill, and sends the appropriate notification accordingly.
sendNotificationForPurchaseBill(BillRequest billRequest): Sends notifications for purchase bills, handling approval and rejection actions.
sendNotificationForSupervisionBill(BillRequest billRequest): Sends notifications for supervision bills.
getMessage(RequestInfo requestInfo, String tenantId, String msgCode, Map<String,Object> additionalFields): Retrieves the localized message for a given code and locale, optionally adding additional fields if required.
buildMessageReplaceVariables(String message, String billNumber, String amount): Replaces variables in a message template with actual values.
setAdditionalFields(RequestInfo requestInfo,String tenantId, String localizationCode, Map<String,Object> additionalFields): Sets additional fields for the notification if required.
checkAdditionalFieldAndPushONSmsTopic(String customizedMessage, Map<String, Object> additionalFields, String mobileNumber): Checks if additional fields are present and sends the SMS request accordingly.
Instantiate and configure the ExpenseNotificationService class within the application context to handle notifications related to expenses. Ensure that dependencies such as Kafka producer, configuration settings, and utility classes are properly injected.