merge with develop in local now ready to merge in origin

This commit is contained in:
Lincpay Tech
2025-12-18 23:45:47 +05:30
14 changed files with 202 additions and 128 deletions
@@ -44,7 +44,7 @@ public class SecurityConfig {
"/webjars/**", "/webjars/**",
"/error") "/error")
.permitAll() .permitAll()
.requestMatchers("/payment/callback/startPayment","/checkTicketStatus/complaints/") .requestMatchers("/payment/callback/startPayment","/complaints/checkTicketStatus")
.permitAll().requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() .permitAll().requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.anyRequest().authenticated()) .anyRequest().authenticated())
.exceptionHandling(ex -> ex.authenticationEntryPoint(jwtAuthenticationEntryPoint)) .exceptionHandling(ex -> ex.authenticationEntryPoint(jwtAuthenticationEntryPoint))
@@ -0,0 +1,24 @@
package com.billpaymentservice.bbps.dto;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ComplaintResponseDto {
private String ticketId;
private String ticketType;
private String txnNpciId;
private String status;
private String userId;
private String ticketDesp;
private String ticketDesr;
private List<ComplaintStatusDto> complaintStatusList;
private List<ComplaintHistoryDTO> historyList;
private List<ComplaintStatusDetailsDto> statusDetailsList;
private List<ViewAllComplaintDto> viewAllList;
}
@@ -0,0 +1,18 @@
package com.billpaymentservice.bbps.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ComplaintStatusDetailsDto {
private String ticketStatus;
private String ticketType;
private String txnAmount;
private String billerName;
private String ticketId;
private String totalTxnAmount;
private String billCategory;
}
@@ -0,0 +1,17 @@
package com.billpaymentservice.bbps.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ComplaintStatusDto {
private String ticketId;
private String npciTicketStatus;
private String ticketDespo;
private String createdTime;
private String npciTicketType;
}
@@ -0,0 +1,20 @@
package com.billpaymentservice.bbps.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ViewAllComplaintDto {
private String ticketStatus;
private String txnAmount;
private String billerName;
private String ticketId;
private String txnNpciId;
private String ticketType;
private String createdTime;
private String billCategory;
private String totalTxnAmount;
}
@@ -2,6 +2,7 @@ package com.billpaymentservice.bbps.entites;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@@ -71,9 +72,4 @@ public class ComplainStatus extends Auditable {
@Column(name = "user_id") @Column(name = "user_id")
private String userId; private String userId;
@ManyToOne
@JoinColumn(name = "complaint_response_id")
private ComplaintResponseEntity complaintResponse;
} }
@@ -2,6 +2,7 @@ package com.billpaymentservice.bbps.entites;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@@ -46,8 +47,5 @@ public class ComplaintHistory extends Auditable {
@Column(name = "user_id") @Column(name = "user_id")
private String userId; private String userId;
@ManyToOne
@JoinColumn(name = "complaint_response_id")
private ComplaintResponseEntity complaintResponse;
} }
@@ -1,13 +1,16 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToMany; import jakarta.persistence.OneToMany;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter; import lombok.Getter;
@@ -74,16 +77,20 @@ public class ComplaintResponseEntity extends Auditable {
@Column(name = "user_id") @Column(name = "user_id")
private String userId; private String userId;
@OneToMany(mappedBy = "complaintResponse", cascade = CascadeType.ALL, orphanRemoval = false) @OneToMany(fetch = FetchType.LAZY)
private List<ComplainStatus> complaintStatusList; @JoinColumn(name = "ticket_id", referencedColumnName = "ticket_id", insertable = false, updatable = false)
private Set<ComplainStatus> complaintStatusList = new HashSet<>();
@OneToMany(mappedBy = "complaintResponse", cascade = CascadeType.ALL, orphanRemoval = false) @OneToMany(fetch = FetchType.LAZY)
private List<ComplaintHistory> historyList; @JoinColumn(name = "ticket_id", referencedColumnName = "ticket_id", insertable = false, updatable = false)
private Set<ComplaintHistory> historyList = new HashSet<>();
@OneToMany(mappedBy = "complaintResponse", cascade = CascadeType.ALL, orphanRemoval = false) @OneToMany(fetch = FetchType.LAZY)
private List<ComplaintStatusDetails> statusDetailsList; @JoinColumn(name = "ticket_id", referencedColumnName = "ticket_id", insertable = false, updatable = false)
private Set<ComplaintStatusDetails> statusDetailsList = new HashSet<>();
@OneToMany(mappedBy = "complaintResponse", cascade = CascadeType.ALL, orphanRemoval = false) @OneToMany(fetch = FetchType.LAZY)
private List<ViewAllComplaintTicketStatusDetails> viewAllList; @JoinColumn(name = "ticket_id", referencedColumnName = "ticket_id", insertable = false, updatable = false)
private Set<ViewAllComplaintTicketStatusDetails> viewAllList = new HashSet<>();
} }
@@ -2,6 +2,7 @@ package com.billpaymentservice.bbps.entites;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@@ -88,8 +89,6 @@ public class ComplaintStatusDetails extends Auditable {
@Column(name = "biller_name") @Column(name = "biller_name")
private String billerName; private String billerName;
@ManyToOne
@JoinColumn(name = "complaint_response_id")
private ComplaintResponseEntity complaintResponse;
} }
@@ -2,6 +2,7 @@ package com.billpaymentservice.bbps.entites;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@@ -88,7 +89,4 @@ public class ViewAllComplaintTicketStatusDetails extends Auditable {
@Column(name = "biller_name") @Column(name = "biller_name")
private String billerName; private String billerName;
@ManyToOne
@JoinColumn(name = "complaint_response_id")
private ComplaintResponseEntity complaintResponse;
} }
@@ -15,7 +15,17 @@ public interface ComplaintResponseRepository extends JpaRepository<ComplaintResp
// @Query("SELECT c FROM ComplaintResponseEntity c WHERE c.userId = :userId") // @Query("SELECT c FROM ComplaintResponseEntity c WHERE c.userId = :userId")
// List<ComplaintResponseEntity> findByUserIdCustom(@Param("userId") String userId); // List<ComplaintResponseEntity> findByUserIdCustom(@Param("userId") String userId);
@Query("SELECT c FROM ComplaintResponseEntity c WHERE c.userId = :userId") // @Query("SELECT c FROM ComplaintResponseEntity c WHERE c.userId = :userId")
// Page<ComplaintResponseEntity> findByUserIdCustom(@Param("userId") String userId, Pageable pageable);
@Query("""
SELECT DISTINCT c FROM ComplaintResponseEntity c
LEFT JOIN FETCH c.complaintStatusList cs
LEFT JOIN FETCH c.historyList ch
LEFT JOIN FETCH c.statusDetailsList sd
LEFT JOIN FETCH c.viewAllList va
WHERE c.userId = :userId
""")
Page<ComplaintResponseEntity> findByUserIdCustom(@Param("userId") String userId, Pageable pageable); Page<ComplaintResponseEntity> findByUserIdCustom(@Param("userId") String userId, Pageable pageable);
@Query(value = "SELECT * FROM bbps_complaint_responses WHERE user_id = :userId", nativeQuery = true) @Query(value = "SELECT * FROM bbps_complaint_responses WHERE user_id = :userId", nativeQuery = true)
@@ -15,6 +15,7 @@ import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.client.RestClient; import org.springframework.web.client.RestClient;
import com.billpaymentservice.bbps.dto.ComplaintResponseDto;
import com.billpaymentservice.bbps.dto.GeneralResp; import com.billpaymentservice.bbps.dto.GeneralResp;
import com.billpaymentservice.bbps.dto.ResponseModel; import com.billpaymentservice.bbps.dto.ResponseModel;
import com.billpaymentservice.bbps.dto.request.AllMasterOptionsRequest; import com.billpaymentservice.bbps.dto.request.AllMasterOptionsRequest;
@@ -103,7 +104,7 @@ public class ComplainServiceImpl implements ComplainService {
String requestId = complainRequestDTO.getReqId(); String requestId = complainRequestDTO.getReqId();
String mid = complainRequestDTO.getMid(); String mid = complainRequestDTO.getMid();
String userId = complainRequestDTO.getClientUserId(); String userId = complainRequestDTO.getClientUserId();
String requestTxnId=complainRequestDTO.getTxnId(); String requestTxnId = complainRequestDTO.getTxnId();
LOGGER.info("[{}] START | reqId={} | mid={} | clientUserId={}", apiName, requestId, mid, userId); LOGGER.info("[{}] START | reqId={} | mid={} | clientUserId={}", apiName, requestId, mid, userId);
String txnId = helper.generateTxnId(15); String txnId = helper.generateTxnId(15);
@@ -196,7 +197,7 @@ public class ComplainServiceImpl implements ComplainService {
ComplaintResponse responseWrapper = objectMapper.convertValue(dataMap, ComplaintResponse.class); ComplaintResponse responseWrapper = objectMapper.convertValue(dataMap, ComplaintResponse.class);
String saveComplaintResponseEntity = mapperHelper.saveComplaintResponseEntity(responseWrapper, requestId, String saveComplaintResponseEntity = mapperHelper.saveComplaintResponseEntity(responseWrapper, requestId,
txnId, userId,requestTxnId); txnId, userId, requestTxnId);
LOGGER.info("Save Complaint Response Count" + saveComplaintResponseEntity); LOGGER.info("Save Complaint Response Count" + saveComplaintResponseEntity);
ResponseModel responseModel = new ResponseModel(responseWrapper.getMessage(), responseWrapper.getStatus(), ResponseModel responseModel = new ResponseModel(responseWrapper.getMessage(), responseWrapper.getStatus(),
Integer.parseInt(responseWrapper.getStatusCode()), responseWrapper); Integer.parseInt(responseWrapper.getStatusCode()), responseWrapper);
@@ -208,7 +209,8 @@ public class ComplainServiceImpl implements ComplainService {
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
LOGGER.error("JSON Parsing Error: {}", e.getMessage()); LOGGER.error("JSON Parsing Error: {}", e.getMessage());
helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR); helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR);
throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED", BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage()); throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED",
BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage());
} }
} }
@@ -291,7 +293,8 @@ public class ComplainServiceImpl implements ComplainService {
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
LOGGER.error("Error parsing JSON in complaint status API: {}", e.getMessage(), e); LOGGER.error("Error parsing JSON in complaint status API: {}", e.getMessage(), e);
helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR); helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR);
throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED", BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage()); throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED",
BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage());
} }
} }
@@ -357,7 +360,8 @@ public class ComplainServiceImpl implements ComplainService {
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
LOGGER.error("Error parsing Complaint Id JSON: {}", e.getMessage(), e); LOGGER.error("Error parsing Complaint Id JSON: {}", e.getMessage(), e);
helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR); helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR);
throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED", BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage()); throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED",
BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage());
} }
} }
@@ -421,7 +425,8 @@ public class ComplainServiceImpl implements ComplainService {
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
LOGGER.error("Error parsing Complaint Id JSON: {}", e.getMessage(), e); LOGGER.error("Error parsing Complaint Id JSON: {}", e.getMessage(), e);
helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR); helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR);
throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED", BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage()); throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED",
BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage());
} }
} }
@@ -533,7 +538,8 @@ public class ComplainServiceImpl implements ComplainService {
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
LOGGER.error("Error parsing Complaint Id JSON: {}", e.getMessage(), e); LOGGER.error("Error parsing Complaint Id JSON: {}", e.getMessage(), e);
helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR); helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR);
throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED", BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage()); throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED",
BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage());
} }
} }
@@ -600,7 +606,8 @@ public class ComplainServiceImpl implements ComplainService {
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
LOGGER.error("Error parsing Complaint Id JSON: {}", e.getMessage(), e); LOGGER.error("Error parsing Complaint Id JSON: {}", e.getMessage(), e);
helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR); helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR);
throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED", BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage()); throw new CustomException(BBPSConstant.MSG_INVALID_JSON_FROM_UPSTREAM, "FAILED",
BBPSConstant.INVALID_JSON_STATUS_CODE, e.getMessage());
} }
} }
@@ -656,14 +663,15 @@ public class ComplainServiceImpl implements ComplainService {
LOGGER.info("[{}] Complaints found for userId={} | count={}", apiName, userId, LOGGER.info("[{}] Complaints found for userId={} | count={}", apiName, userId,
complaintUserData.getContent().size()); complaintUserData.getContent().size());
List<ComplaintResponseDto> dtoList = complaintUserData.getContent().stream().map(mapperHelper::toDto)
.toList();
// Update outbound log with the count // Update outbound log with the count
String count = String.valueOf(complaintUserData.getContent().size()); String count = String.valueOf(dtoList.size());
helper.updateOutboundLogResponse(outboundLog, count); helper.updateOutboundLogResponse(outboundLog, count);
// Return successful response with complaints data // Return successful response with complaints data
return new ResponseModel(BBPSConstant.ALL_COMPLAINT_FIELDS_FETCH, BBPSConstant.SUCCESS_RESPONSE, return new ResponseModel(BBPSConstant.ALL_COMPLAINT_FIELDS_FETCH, BBPSConstant.SUCCESS_RESPONSE,
BBPSConstant.HTTP_OK_INT, complaintUserData.getContent(), // Only the list of complaints (data) BBPSConstant.HTTP_OK_INT, dtoList, dtoList.size());
complaintUserData.getContent().size());
} catch (CustomException e) { } catch (CustomException e) {
// Rethrow custom exception for handling at the controller level // Rethrow custom exception for handling at the controller level
@@ -28,6 +28,9 @@ import com.billpaymentservice.bbps.dto.BillCustomerParamsDTO;
import com.billpaymentservice.bbps.dto.BillerIconDTO; import com.billpaymentservice.bbps.dto.BillerIconDTO;
import com.billpaymentservice.bbps.dto.CheckClientBillerResponseDTO; import com.billpaymentservice.bbps.dto.CheckClientBillerResponseDTO;
import com.billpaymentservice.bbps.dto.ComplaintHistoryDTO; import com.billpaymentservice.bbps.dto.ComplaintHistoryDTO;
import com.billpaymentservice.bbps.dto.ComplaintResponseDto;
import com.billpaymentservice.bbps.dto.ComplaintStatusDetailsDto;
import com.billpaymentservice.bbps.dto.ComplaintStatusDto;
import com.billpaymentservice.bbps.dto.ContactMaster; import com.billpaymentservice.bbps.dto.ContactMaster;
import com.billpaymentservice.bbps.dto.CustomerParamDAO; import com.billpaymentservice.bbps.dto.CustomerParamDAO;
import com.billpaymentservice.bbps.dto.CustomerParamGroupsDTO; import com.billpaymentservice.bbps.dto.CustomerParamGroupsDTO;
@@ -39,11 +42,10 @@ import com.billpaymentservice.bbps.dto.TicketDetailsDTO;
import com.billpaymentservice.bbps.dto.TicketDispositionsDTO; import com.billpaymentservice.bbps.dto.TicketDispositionsDTO;
import com.billpaymentservice.bbps.dto.TransactionHistoryMasterDTO; import com.billpaymentservice.bbps.dto.TransactionHistoryMasterDTO;
import com.billpaymentservice.bbps.dto.TransactionHistoryParticularDetailsDTO; import com.billpaymentservice.bbps.dto.TransactionHistoryParticularDetailsDTO;
import com.billpaymentservice.bbps.dto.ViewAllComplaintDto;
import com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest; import com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest;
import com.billpaymentservice.bbps.dto.request.BillPaymentRequest; import com.billpaymentservice.bbps.dto.request.BillPaymentRequest;
import com.billpaymentservice.bbps.dto.request.ComplaintRequestDTO; import com.billpaymentservice.bbps.dto.request.ComplaintRequestDTO;
import com.billpaymentservice.bbps.dto.request.FetchBillRequest;
import com.billpaymentservice.bbps.dto.request.FetchBillValidatestRequest;
import com.billpaymentservice.bbps.dto.request.GetTicketLatestStausRequest; import com.billpaymentservice.bbps.dto.request.GetTicketLatestStausRequest;
import com.billpaymentservice.bbps.dto.request.PaymentStartUserRequest; import com.billpaymentservice.bbps.dto.request.PaymentStartUserRequest;
import com.billpaymentservice.bbps.dto.response.AmountOptionsResponse; import com.billpaymentservice.bbps.dto.response.AmountOptionsResponse;
@@ -51,7 +53,6 @@ import com.billpaymentservice.bbps.dto.response.BillDataResponse;
import com.billpaymentservice.bbps.dto.response.ClientReqIdResponse; import com.billpaymentservice.bbps.dto.response.ClientReqIdResponse;
import com.billpaymentservice.bbps.dto.response.ComplaintHistoryStatusResponse; import com.billpaymentservice.bbps.dto.response.ComplaintHistoryStatusResponse;
import com.billpaymentservice.bbps.dto.response.ComplaintResponse; import com.billpaymentservice.bbps.dto.response.ComplaintResponse;
import com.billpaymentservice.bbps.dto.response.FetchBillValidateResponse;
import com.billpaymentservice.bbps.dto.response.PaymentStartApiResponse; import com.billpaymentservice.bbps.dto.response.PaymentStartApiResponse;
import com.billpaymentservice.bbps.dto.response.PlanResponse; import com.billpaymentservice.bbps.dto.response.PlanResponse;
import com.billpaymentservice.bbps.dto.response.TicketCheckStatusResponse; import com.billpaymentservice.bbps.dto.response.TicketCheckStatusResponse;
@@ -59,8 +60,6 @@ import com.billpaymentservice.bbps.dto.response.ViewAllComplaintsResponse;
import com.billpaymentservice.bbps.dto.response.ViewAllComplaintsTicketsResponse; import com.billpaymentservice.bbps.dto.response.ViewAllComplaintsTicketsResponse;
import com.billpaymentservice.bbps.dto.response.ViewComplainByIdResponse; import com.billpaymentservice.bbps.dto.response.ViewComplainByIdResponse;
import com.billpaymentservice.bbps.dto.sentRequest.BillPaymentForwardRequest; import com.billpaymentservice.bbps.dto.sentRequest.BillPaymentForwardRequest;
import com.billpaymentservice.bbps.dto.sentRequest.FetchBillForwardRequest;
import com.billpaymentservice.bbps.dto.sentRequest.FetchBillValidatestForwardRequest;
import com.billpaymentservice.bbps.dto.sentRequest.FetchComplaintForwardRequest; import com.billpaymentservice.bbps.dto.sentRequest.FetchComplaintForwardRequest;
import com.billpaymentservice.bbps.dto.sentRequest.FetchTicketLatestStatusRequest; import com.billpaymentservice.bbps.dto.sentRequest.FetchTicketLatestStatusRequest;
import com.billpaymentservice.bbps.entites.AdditionalInfoBill; import com.billpaymentservice.bbps.entites.AdditionalInfoBill;
@@ -120,8 +119,6 @@ import com.billpaymentservice.bbps.repository.ReOpenComplaintRepository;
import com.billpaymentservice.bbps.repository.TicketDispositionRepository; import com.billpaymentservice.bbps.repository.TicketDispositionRepository;
import com.billpaymentservice.bbps.repository.ViewAllComplainTicketDetailRepository; import com.billpaymentservice.bbps.repository.ViewAllComplainTicketDetailRepository;
import jakarta.persistence.Column;
@Component @Component
public class BillerMapperHelper { public class BillerMapperHelper {
@@ -577,87 +574,6 @@ public class BillerMapperHelper {
} }
} }
public Map<String, Object> getComplaintStatusJson() {
Map<String, Object> complaints = new HashMap<>();
complaints.put("assignedTo", "XYZ Bank");
complaints.put("complaintDescr", "Testing complaint");
complaints.put("complaintDispos", "Transaction Successful, account not updated");
complaints.put("complaintId", "2dfecc3c-9114-4094-9aa8-ff26f03a9bfd");
complaints.put("complaintNpciId", "FE4123109489834");
complaints.put("complaintRaisedFrom", "agent");
complaints.put("complaintType", "npciComplaint");
complaints.put("createdEpochDate", 1681905485);
complaints.put("creationDate", "2023-04-19T17:28:05.508679Z");
complaints.put("modifiedDate", "2023-04-19T17:28:10.001432Z");
complaints.put("modifiedEpochDate", 1681905490);
complaints.put("refId", "mqcXfZs2XMkRKQfpIwoSYQDnIr231091728");
complaints.put("status", "COMPLAINT_OPEN_SUCCESS");
complaints.put("tenantId", "FE41");
complaints.put("txnId", "24fe190c-42c9-4cb5-9d36-965839b0cb5f");
complaints.put("txnNpciId", "FE4131090DAI26Y0mAxl");
complaints.put("userId", "FE41FE42BNK519012345");
complaints.put("agentId", "FE41FE42BNK519012345");
Map<String, Object> finalJson = new HashMap<>();
finalJson.put("complaints", complaints);
return finalJson;
}
public Map<String, Object> getDummyReopenComplaintJson() {
Map<String, Object> complaints = new HashMap<>();
complaints.put("assignedTo", "Federal Bank");
complaints.put("complaintDescr", "Issue not yet solved - reopening");
complaints.put("complaintDispos", "Transaction Successful, account not updated");
complaints.put("complaintId", "809ec4c7-d81b-4d2b-9c66-3011a6fae714");
complaints.put("complaintNpciId", "FE4123109776644");
complaints.put("complaintRaisedFrom", "agent");
complaints.put("complaintType", "npciComplaint");
complaints.put("createdEpochDate", 1681893776);
complaints.put("creationDate", "2023-04-19T14:12:56.329935Z");
complaints.put("modifiedDate", "2023-04-19T14:19:44.891423Z");
complaints.put("modifiedEpochDate", 1681894184);
complaints.put("refId", "7sQwBamvWFyLxhK84dYgGmV24r831091419");
complaints.put("status", "COMPLAINT_REOPEN_SUCCESS");
complaints.put("tenantId", "FE41");
complaints.put("txnId", "155a4a71-141f-40fd-b772-9d0e020963e8");
complaints.put("txnNpciId", "FE413045Hl3L90ZWg59o");
complaints.put("userId", "FE41FE42BNK519012345");
complaints.put("agentId", "FE41FE42BNK519012345");
Map<String, Object> finalJson = new HashMap<>();
finalJson.put("complaints", complaints);
return finalJson;
}
public Map<String, Object> getDummyClosureComplaintJson() {
Map<String, Object> complaints = new HashMap<>();
complaints.put("complaintDescr", "Closing complaint Issue resolved");
complaints.put("complaintDispos", "Transaction Successful, account not updated");
complaints.put("complaintId", "809ec4c7-d81b-4d2b-9c66-3011a6fae714");
complaints.put("complaintNpciId", "FE4123109776644");
complaints.put("complaintRaisedFrom", "agent");
complaints.put("complaintType", "npciComplaint");
complaints.put("createdEpochDate", 1681893776);
complaints.put("creationDate", "2023-04-19T14:12:56.329935Z");
complaints.put("modifiedDate", "2023-04-19T14:13:32.25255Z");
complaints.put("modifiedEpochDate", 1681893812);
complaints.put("refId", "hHfEKYZExIpxNEV65HMQZ2Lh0DA31091413");
complaints.put("status", "COMPLAINT_CLOSURE_REQUEST_SUCCESS"); // removed spaces
complaints.put("tenantId", "FE41");
complaints.put("txnId", "155a4a71-141f-40fd-b772-9d0e020963e8");
complaints.put("txnNpciId", "FE413045Hl3L90ZWg59o");
complaints.put("userId", "FE41FE42BNK519012345");
complaints.put("agentId", "FE41FE42BNK519012345");
Map<String, Object> finalJson = new HashMap<>();
finalJson.put("complaints", complaints);
return finalJson;
}
public String saveComplainStatusDetail(ViewComplainByIdResponse responseWrapper, String reqId, String txnId, public String saveComplainStatusDetail(ViewComplainByIdResponse responseWrapper, String reqId, String txnId,
String userId) { String userId) {
@@ -1301,4 +1217,67 @@ public class BillerMapperHelper {
LOGGER.error("Error saving BillValidation: {}", e.getMessage(), e); LOGGER.error("Error saving BillValidation: {}", e.getMessage(), e);
} }
} }
public ComplaintResponseDto toDto(ComplaintResponseEntity e) {
ComplaintResponseDto dto = new ComplaintResponseDto();
dto.setTicketId(e.getTicketId());
dto.setTicketType(e.getTicketType());
dto.setStatus(e.getStatus());
dto.setUserId(e.getUserId());
dto.setTxnNpciId(e.getTxnNpciId());
dto.setTicketDesr(e.getTicketDesr());
dto.setTicketDesp(e.getTicketDesp());
dto.setComplaintStatusList(e.getComplaintStatusList().stream().map(cs -> {
ComplaintStatusDto d = new ComplaintStatusDto();
d.setNpciTicketStatus(cs.getNpciTicketStatus());
d.setTicketDespo(cs.getTicketDespo());
d.setCreatedTime(cs.getCreatedTime());
d.setTicketId(cs.getTicketId());
d.setNpciTicketStatus(cs.getNpciTicketStatus());
d.setTicketDespo(cs.getTicketDespo());
d.setNpciTicketType(cs.getNpciTicketType());
return d;
}).collect(Collectors.toList()));
dto.setHistoryList(e.getHistoryList().stream().map(h -> {
ComplaintHistoryDTO d = new ComplaintHistoryDTO();
d.setHistoryStatus(h.getHistoryStatus());
d.setTime(h.getTime());
d.setHistoryId(h.getHistoryId());
d.setTicketId(h.getTicketId());
return d;
}).collect(Collectors.toList()));
dto.setStatusDetailsList(e.getStatusDetailsList().stream().map(sd -> {
ComplaintStatusDetailsDto d = new ComplaintStatusDetailsDto();
d.setTicketStatus(sd.getTicketStatus());
d.setTicketType(sd.getTicketType());
d.setTxnAmount(sd.getTxnAmount());
d.setBillerName(sd.getBillerName());
d.setTicketId(sd.getTicketId());
d.setTotalTxnAmount(sd.getTotalTxnAmount());
d.setBillCategory(sd.getBillCategory());
return d;
}).collect(Collectors.toList()));
dto.setViewAllList(e.getViewAllList().stream().map(v -> {
ViewAllComplaintDto d = new ViewAllComplaintDto();
d.setTicketStatus(v.getTicketStatus());
d.setTxnAmount(v.getTxnAmount());
d.setBillerName(v.getBillerName());
d.setTicketId(v.getTicketId());
d.setTxnNpciId(v.getTxnNpciId());
d.setTicketType(v.getTicketType());
d.setBillCategory(v.getBillCategory());
d.setCreatedTime(v.getCreatedTime());
d.setTotalTxnAmount(v.getTotalTxnAmount());
return d;
}).collect(Collectors.toList()));
return dto;
}
} }
@@ -21,11 +21,11 @@ swagger.server.description=Local Development Server
#spring.datasource.url=jdbc:postgresql://localhost:5432/bbps_new_updated #spring.datasource.url=jdbc:postgresql://localhost:5432/bbps_new_updated
spring.datasource.url=jdbc:postgresql://localhost:5432/bbps_enhanced spring.datasource.url=jdbc:postgresql://localhost:5432/bbps_enhanced
>>>>>>> Stashed changes
spring.datasource.username=postgres
#spring.datasource.password=UAT@DB_2025
spring.datasource.password=himanshu@123 spring.datasource.username=postgres
spring.datasource.password=UAT@DB_2025
#spring.datasource.password=himanshu@123
spring.datasource.driver-class-name=org.postgresql.Driver spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.type=com.zaxxer.hikari.HikariDataSource spring.datasource.type=com.zaxxer.hikari.HikariDataSource