improved bill fetching data is getting saved before making call
This commit is contained in:
@@ -22,8 +22,8 @@ public class TransactionHistoryMasterDTO {
|
||||
private String billId;
|
||||
private String userType;
|
||||
private String userId;
|
||||
private Double txnAmount;
|
||||
private Double totalTxnAmount;
|
||||
private String txnAmount;
|
||||
private String totalTxnAmount;
|
||||
private String billerId;
|
||||
private String billerCategory;
|
||||
private String billerName;
|
||||
@@ -33,15 +33,15 @@ public class TransactionHistoryMasterDTO {
|
||||
private String quickPay;
|
||||
private String paymentMode;
|
||||
private String agentPaymentInformation;
|
||||
private Double custConvFee;
|
||||
private String custConvFee;
|
||||
private String currency;
|
||||
private String status;
|
||||
private String requestedIp;
|
||||
private String customerMobNo;
|
||||
private String macAddress;
|
||||
private Double splitPayAmount;
|
||||
private Double couCustConvFee;
|
||||
private Boolean settlementVerification;
|
||||
private String splitPayAmount;
|
||||
private String couCustConvFee;
|
||||
private String settlementVerification;
|
||||
private String fundTxnType;
|
||||
private String reason;
|
||||
private String amountTags;
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ public class TransactionHistoryParticularDetailsDTO {
|
||||
|
||||
private String billerName;
|
||||
|
||||
private Double totalTxnAmount;
|
||||
private String totalTxnAmount;
|
||||
|
||||
private String bankTxnId;
|
||||
|
||||
|
||||
@@ -3,7 +3,15 @@ package com.billpaymentservice.bbps.dto.auth;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LoginRequest {
|
||||
|
||||
@NotNull(message = "Mobile number cannot be null.")
|
||||
@@ -11,18 +19,5 @@ public class LoginRequest {
|
||||
@Pattern(regexp = "^[0-9]{10}$", message = "Mobile number must contain only digits.")
|
||||
private String mobile;
|
||||
|
||||
public LoginRequest() {
|
||||
}
|
||||
|
||||
public LoginRequest(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,17 @@
|
||||
package com.billpaymentservice.bbps.dto.auth;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OtpSendResponse {
|
||||
private boolean success;
|
||||
private String message;
|
||||
|
||||
public OtpSendResponse() {}
|
||||
|
||||
public OtpSendResponse(boolean success, String message) {
|
||||
this.success = success;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,11 +6,15 @@ import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RegisterRequest extends BaseClass {
|
||||
|
||||
@NotNull(message = "Mobile number cannot be null.")
|
||||
|
||||
@@ -3,7 +3,15 @@ package com.billpaymentservice.bbps.dto.auth;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VerifyOtpRequest {
|
||||
|
||||
@NotNull(message = "Mobile number cannot be null.")
|
||||
@@ -16,27 +24,5 @@ public class VerifyOtpRequest {
|
||||
@Pattern(regexp = "^[0-9]{6}$", message = "OTP must contain only 6 digits.")
|
||||
private String otp;
|
||||
|
||||
public VerifyOtpRequest() {
|
||||
}
|
||||
|
||||
public VerifyOtpRequest(String mobile, String otp) {
|
||||
this.mobile = mobile;
|
||||
this.otp = otp;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getOtp() {
|
||||
return otp;
|
||||
}
|
||||
|
||||
public void setOtp(String otp) {
|
||||
this.otp = otp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import java.util.List;
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.OneToMany;
|
||||
@@ -26,16 +28,23 @@ import lombok.Setter;
|
||||
public class BillMaster extends Auditable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(name = "bill_id", unique = true)
|
||||
private String billId; // primary key
|
||||
|
||||
private String reqId; // client se aaya hua
|
||||
private String txnId; // system-generated
|
||||
private String refId;
|
||||
private String billerId;
|
||||
private String status;
|
||||
private String mid;
|
||||
private String actionType;
|
||||
private String clientUserId;
|
||||
private String userId;
|
||||
@Column(name = "initiator_txn_id")
|
||||
private String initiatorTxnId;
|
||||
@Column(name = "checker_txn_id")
|
||||
private String checkerTxnId;
|
||||
@OneToOne(cascade = CascadeType.ALL)
|
||||
@JoinColumn(name = "biller_response_id")
|
||||
private BillerResponse billerResponse;
|
||||
|
||||
@@ -8,15 +8,24 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Entity
|
||||
@Table(name = "bbps_bill_validation")
|
||||
@Table(name = "bbps_bill_validation_master")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BillValidation extends Auditable {
|
||||
|
||||
@Id
|
||||
@Column(name = "bill_id", nullable = false, length = 100)
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "bill_id", unique = true)
|
||||
private String billId;
|
||||
|
||||
private String mid;
|
||||
|
||||
private String initiatorTxnId;
|
||||
|
||||
private String checkerTxnId;
|
||||
|
||||
@Column(name = "ref_id", length = 100)
|
||||
private String refId;
|
||||
@@ -55,6 +64,4 @@ public class BillValidation extends Auditable {
|
||||
@Column(name = "client_user_id")
|
||||
private String clientUserId;
|
||||
|
||||
// Removed local audit fields: creationDate, modifiedDate, createdEpochDate, modifiedEpochDate
|
||||
// They are now handled by Auditable base class
|
||||
}
|
||||
@@ -82,10 +82,10 @@ public class TransactionMaster extends Auditable {
|
||||
private String userId;
|
||||
|
||||
@Column(name = "txn_amount")
|
||||
private Double txnAmount;
|
||||
private String txnAmount;
|
||||
|
||||
@Column(name = "total_txn_amount")
|
||||
private Double totalTxnAmount;
|
||||
private String totalTxnAmount;
|
||||
|
||||
@Column(name = "biller_id")
|
||||
private String billerId;
|
||||
@@ -115,7 +115,7 @@ public class TransactionMaster extends Auditable {
|
||||
private String agentPaymentInformation;
|
||||
|
||||
@Column(name = "cust_conv_fee")
|
||||
private Double custConvFee;
|
||||
private String custConvFee;
|
||||
|
||||
@Column(name = "currency")
|
||||
private String currency;
|
||||
@@ -133,13 +133,13 @@ public class TransactionMaster extends Auditable {
|
||||
private String macAddress;
|
||||
|
||||
@Column(name = "split_pay_amount")
|
||||
private Double splitPayAmount;
|
||||
private String splitPayAmount;
|
||||
|
||||
@Column(name = "cou_cust_conv_fee")
|
||||
private Double couCustConvFee;
|
||||
private String couCustConvFee;
|
||||
|
||||
@Column(name = "settlement_verification")
|
||||
private Boolean settlementVerification;
|
||||
private String settlementVerification;
|
||||
|
||||
@Column(name = "fund_txn_type")
|
||||
private String fundTxnType;
|
||||
|
||||
@@ -4,6 +4,17 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import com.billpaymentservice.bbps.entites.BillMaster;
|
||||
|
||||
public interface BillMasterRepository extends JpaRepository<BillMaster, String> {
|
||||
import java.util.Optional;
|
||||
|
||||
}
|
||||
/**
|
||||
* Repository for BillMaster. Added convenience finder methods so service
|
||||
* can look up records by client request id (reqId) or txnId.
|
||||
*/
|
||||
public interface BillMasterRepository extends JpaRepository<BillMaster, Long> {
|
||||
|
||||
Optional<BillMaster> findByReqId(String reqId);
|
||||
|
||||
Optional<BillMaster> findByTxnId(String txnId);
|
||||
BillMaster findByInitiatorTxnId(String initiatorTxnId);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import org.springframework.stereotype.Repository;
|
||||
import com.billpaymentservice.bbps.entites.BillValidation;
|
||||
|
||||
@Repository
|
||||
public interface BillValidationRepository extends JpaRepository<BillValidation, String> {
|
||||
public interface BillValidationRepository extends JpaRepository<BillValidation, Long> {
|
||||
|
||||
BillValidation findByInitiatorTxnId(String txnId);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,12 +22,14 @@ import com.billpaymentservice.bbps.dto.sentRequest.FetchBillForwardRequest;
|
||||
import com.billpaymentservice.bbps.dto.sentRequest.FetchBillValidatestForwardRequest;
|
||||
import com.billpaymentservice.bbps.entites.BillInitiate;
|
||||
import com.billpaymentservice.bbps.entites.BillMaster;
|
||||
import com.billpaymentservice.bbps.entites.BillValidation;
|
||||
import com.billpaymentservice.bbps.entites.InboundTraceLog;
|
||||
import com.billpaymentservice.bbps.entites.OutboundTraceLog;
|
||||
import com.billpaymentservice.bbps.exception.CustomException;
|
||||
import com.billpaymentservice.bbps.repository.BharatConnectMasterRepository;
|
||||
import com.billpaymentservice.bbps.repository.BillInitateRepository;
|
||||
import com.billpaymentservice.bbps.repository.BillMasterRepository;
|
||||
import com.billpaymentservice.bbps.repository.BillValidationRepository;
|
||||
import com.billpaymentservice.bbps.repository.InboundTraceLogRepository;
|
||||
import com.billpaymentservice.bbps.repository.OutboundTraceLogRepository;
|
||||
import com.billpaymentservice.bbps.service.AgentService;
|
||||
@@ -52,6 +54,7 @@ public class AgentServiceImpl implements AgentService {
|
||||
private final BillerMapperHelper mapperHelper;
|
||||
private final BillMasterRepository billMasterRepository;
|
||||
private final BillInitateRepository billIntiateRepository;
|
||||
private final BillValidationRepository billValidationRepository;
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AgentServiceImpl.class);
|
||||
|
||||
// Reusable ObjectMapper instance
|
||||
@@ -62,7 +65,7 @@ public class AgentServiceImpl implements AgentService {
|
||||
BharatConnectMasterRepository beneficiaryDetailsRepository,
|
||||
InboundTraceLogRepository inboundTraceLogRepository, OutboundTraceLogRepository outboundTraceLogRepository,
|
||||
BillMasterRepository billMasterRepository, BillInitateRepository billIntiateRepository,
|
||||
BillerMapperHelper mapperHelper) {
|
||||
BillerMapperHelper mapperHelper,BillValidationRepository billValidationRepository) {
|
||||
this.restClient = restClient;
|
||||
this.httpService = httpService;
|
||||
this.helper = helper;
|
||||
@@ -70,6 +73,7 @@ public class AgentServiceImpl implements AgentService {
|
||||
this.billMasterRepository = billMasterRepository;
|
||||
this.billIntiateRepository = billIntiateRepository;
|
||||
this.mapperHelper = mapperHelper;
|
||||
this.billValidationRepository=billValidationRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,7 +98,13 @@ public class AgentServiceImpl implements AgentService {
|
||||
OutboundTraceLog outboundLog = helper.createOutboundLog(txnId, requestId, apiName, fullUrl,
|
||||
BBPSConstant.HTTP_POST, forwardJson);
|
||||
LOGGER.debug("Outbound log created successfully for txnId: {} and reqId: {}", txnId, requestId);
|
||||
|
||||
|
||||
BillMaster billMaster =new BillMaster();
|
||||
billMaster.setReqId(fetchBillRequest.getReqId());
|
||||
billMaster.setInitiatorTxnId(txnId);
|
||||
billMaster.setMid(fetchBillRequest.getMid());
|
||||
billMaster.setClientUserId(fetchBillRequest.getClientUserId());
|
||||
billMasterRepository.save(billMaster);
|
||||
try {
|
||||
LOGGER.info("[{}] Calling external API | URL={}", apiName, fullUrl);
|
||||
Map<String, String> responseMap = httpService.postRequest(fullUrl, forwardJson,
|
||||
@@ -114,26 +124,13 @@ public class AgentServiceImpl implements AgentService {
|
||||
Integer.parseInt(String.valueOf(dataMap.get("statusCode"))),
|
||||
String.valueOf(dataMap.get("remarks")));
|
||||
}
|
||||
|
||||
BillMaster billMaster = new BillMaster();
|
||||
billMaster.setBillId((String) dataMap.get("billId"));
|
||||
billMaster.setReqId(fetchBillRequest.getReqId());
|
||||
billMaster.setTxnId(txnId);
|
||||
billMaster.setClientUserId(fetchBillRequest.getClientUserId());
|
||||
billMasterRepository.save(billMaster);
|
||||
|
||||
LOGGER.info("BillMaster saved for billId: {}", billMaster.getBillId());
|
||||
|
||||
FetchBillResponse fetchBillResponse = objectMapper.convertValue(dataMap, FetchBillResponse.class);
|
||||
GeneralResp generalResponse = fetchBillResponse.getGenericResponse();
|
||||
helper.updateInboundLogSuccess(inboundLog, responseData, generalResponse.getStatus());
|
||||
|
||||
BillInitiate billInitiate = new BillInitiate();
|
||||
billInitiate.setBillId((String) dataMap.get("billId"));
|
||||
billInitiate.setReqId(fetchBillRequest.getReqId());
|
||||
billInitiate.setTxnId(txnId);
|
||||
billInitiate.setClientUserId(fetchBillRequest.getClientUserId());
|
||||
billIntiateRepository.save(billInitiate);
|
||||
LOGGER.info("BillInitiate entry saved for billId: {}", billInitiate.getBillId());
|
||||
|
||||
BillFetchByBillIdRequest billFetchByBillIdRequest = new BillFetchByBillIdRequest();
|
||||
billFetchByBillIdRequest.setBillId(fetchBillResponse.getBillId());
|
||||
@@ -146,6 +143,7 @@ public class AgentServiceImpl implements AgentService {
|
||||
Thread.currentThread().interrupt();
|
||||
LOGGER.warn("Thread interrupted during delay: {}", e.getMessage());
|
||||
}
|
||||
|
||||
LOGGER.info("Calling internal method Fetching bill by ID: {}", billFetchByBillIdRequest.getBillId());
|
||||
LOGGER.info("[{}] END | reqId={} | status={}", apiName, requestId, generalResponse.getStatus());
|
||||
return fetchBillById(billFetchByBillIdRequest, inboundLog);
|
||||
@@ -171,6 +169,8 @@ public class AgentServiceImpl implements AgentService {
|
||||
LOGGER.debug("Outbound log created successfully for FetchBillById: {}", fullUrl);
|
||||
|
||||
try {
|
||||
|
||||
|
||||
LOGGER.info("Calling external API: {}", fullUrl);
|
||||
Map<String, String> responseMap = httpService.getRequest(fullUrl,
|
||||
helper.buildHeaders(beneficiaryDetailsRepository.findByOrgId(BBPSConstant.ORG_ID)));
|
||||
@@ -192,15 +192,18 @@ public class AgentServiceImpl implements AgentService {
|
||||
}
|
||||
|
||||
BillDataResponse responseWrapper = objectMapper.convertValue(dataMap, BillDataResponse.class);
|
||||
GeneralResp generalResp = responseWrapper.getGenericResponse();
|
||||
|
||||
GeneralResp generalResp = responseWrapper.getGenericResponse();
|
||||
|
||||
|
||||
BillMaster
|
||||
existingbill=billMasterRepository.findByInitiatorTxnId(
|
||||
inboundLog.getTxnId());
|
||||
String status = generalResp.getStatus();
|
||||
LOGGER.info("Current Bill Status: {}", status);
|
||||
|
||||
helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus());
|
||||
mapperHelper.saveOrUpdateBillData(responseWrapper, billFetchByBillIdRequest, txnId, reqId, userId);
|
||||
mapperHelper.saveOrUpdateBillData(responseWrapper, billFetchByBillIdRequest, txnId, reqId,billFetchByBillIdRequest.getClientUserId(), existingbill);
|
||||
LOGGER.info("Bill data saved successfully for billId: {}", billId);
|
||||
|
||||
return new ResponseModel(generalResp.getMessage(), generalResp.getStatus(),
|
||||
Integer.parseInt(generalResp.getStatusCode()), responseWrapper);
|
||||
} catch (JsonProcessingException e) {
|
||||
@@ -255,7 +258,7 @@ public class AgentServiceImpl implements AgentService {
|
||||
|
||||
// update inbound log success and persist bill data
|
||||
helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus());
|
||||
mapperHelper.saveOrUpdateBillData(responseWrapper, billFetchByBillIdRequest, txnId, reqId, userId);
|
||||
//mapperHelper.saveOrUpdateBillData(responseWrapper, billFetchByBillIdRequest, txnId, reqId, userId);
|
||||
LOGGER.info("Bill data saved successfully for billId={} | Status={}", billId, generalResp.getStatus());
|
||||
LOGGER.info("[{}] END | reqId={} | status={}", apiName, reqId, generalResp.getStatus());
|
||||
return responseModel;
|
||||
@@ -294,8 +297,14 @@ public class AgentServiceImpl implements AgentService {
|
||||
forwardJson);
|
||||
LOGGER.debug("Outbound log created successfully for txnId: {} and reqId: {}", txnId, reqId);
|
||||
|
||||
BillValidation billValidation = new BillValidation();
|
||||
billValidation.setReqId(fetchBillValidateRequest.getReqId());
|
||||
billValidation.setInitiatorTxnId(txnId);
|
||||
billValidation.setMid(fetchBillValidateRequest.getMid());
|
||||
billValidation.setClientUserId(fetchBillValidateRequest.getClientUserId());
|
||||
billValidationRepository.save(billValidation);
|
||||
|
||||
try {
|
||||
|
||||
LOGGER.info("[{}] Calling external API | URL={}", apiName, fullUrl);
|
||||
Map<String, String> responseMap = httpService.postRequest(fullUrl, forwardJson,
|
||||
helper.buildHeaders(beneficiaryDetailsRepository.findByOrgId(BBPSConstant.ORG_ID)));
|
||||
@@ -314,24 +323,11 @@ public class AgentServiceImpl implements AgentService {
|
||||
Integer.parseInt(String.valueOf(dataMap.get("statusCode"))),
|
||||
String.valueOf(dataMap.get("remarks")));
|
||||
}
|
||||
|
||||
BillMaster billMaster = new BillMaster();
|
||||
billMaster.setBillId((String) dataMap.get("billId"));
|
||||
billMaster.setReqId(fetchBillValidateRequest.getReqId());
|
||||
billMaster.setTxnId(txnId);
|
||||
billMasterRepository.save(billMaster);
|
||||
LOGGER.info("BillMaster saved for billId: {}", billMaster.getBillId());
|
||||
|
||||
FetchBillResponse fetchBillResponse = objectMapper.convertValue(dataMap, FetchBillResponse.class);
|
||||
GeneralResp generalResponse = fetchBillResponse.getGenericResponse();
|
||||
helper.updateInboundLogSuccess(inboundLog, responseData, generalResponse.getStatus());
|
||||
|
||||
BillInitiate billInitiate = new BillInitiate();
|
||||
billInitiate.setBillId((String) dataMap.get("billId"));
|
||||
billInitiate.setReqId(fetchBillValidateRequest.getReqId());
|
||||
billInitiate.setTxnId(txnId);
|
||||
billIntiateRepository.save(billInitiate);
|
||||
LOGGER.info("BillInitiate entry saved for billId: {}", billInitiate.getBillId());
|
||||
|
||||
|
||||
BillFetchByBillIdRequest billFetchByBillIdRequest = new BillFetchByBillIdRequest();
|
||||
billFetchByBillIdRequest.setBillId(fetchBillResponse.getBillId());
|
||||
billFetchByBillIdRequest.setMid(fetchBillValidateRequest.getMid());
|
||||
@@ -362,7 +358,11 @@ public class AgentServiceImpl implements AgentService {
|
||||
String reqId = billRequest.getReqId();
|
||||
String billId = billRequest.getBillId();
|
||||
String fullUrl = agentDtaUrl + BBPSConstant.BILL_VALIDATE_ID_URL + billRequest.getBillId();
|
||||
|
||||
|
||||
BillValidation
|
||||
billValidation=billValidationRepository.findByInitiatorTxnId(
|
||||
inboundLog.getTxnId());
|
||||
billValidation.setCheckerTxnId(txnId);
|
||||
OutboundTraceLog outboundLog = helper.createOutboundLog(txnId, reqId, apiName, fullUrl,
|
||||
BBPSConstant.HTTP_GET, null);
|
||||
LOGGER.debug("Outbound log created successfully for FetchBillById: {}", fullUrl);
|
||||
@@ -392,13 +392,14 @@ public class AgentServiceImpl implements AgentService {
|
||||
FetchBillValidateResponse responseWrapper = objectMapper.convertValue(dataMap,
|
||||
FetchBillValidateResponse.class);
|
||||
GeneralResp generalResp = responseWrapper.getGenericResponse();
|
||||
|
||||
|
||||
|
||||
String status = generalResp.getStatus();
|
||||
LOGGER.info("Current Bill Status: {}", status);
|
||||
|
||||
helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus());
|
||||
System.out.println("responseWrapper:" + responseWrapper);
|
||||
mapperHelper.saveBillValidation(responseWrapper, billRequest, txnId);
|
||||
mapperHelper.saveBillValidation(responseWrapper, billRequest, txnId,billValidation);
|
||||
return new ResponseModel(generalResp.getMessage(), generalResp.getStatus(),
|
||||
Integer.parseInt(generalResp.getStatusCode()), responseWrapper);
|
||||
} catch (JsonProcessingException e) {
|
||||
@@ -456,7 +457,7 @@ public class AgentServiceImpl implements AgentService {
|
||||
GeneralResp generalResp = responseWrapper.getGenericResponse();
|
||||
|
||||
helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus());
|
||||
mapperHelper.saveBillValidation(responseWrapper, billRequest, txnId);
|
||||
//mapperHelper.saveBillValidation(responseWrapper, billRequest, txnId);
|
||||
LOGGER.info("Bill validation saved successfully for billId: {}", billId);
|
||||
LOGGER.info("[{}] END | reqId={} | status={}", apiName, reqId, generalResp.getStatus());
|
||||
return new ResponseModel(generalResp.getMessage(), generalResp.getStatus(),
|
||||
|
||||
@@ -112,7 +112,6 @@ public class PaymentServiceImpl implements PaymentService {
|
||||
LOGGER.debug("Outbound log created for api={} | reqId={} | txnId={}", apiName, requestId, txnId);
|
||||
|
||||
TransactionMaster preTransaction=null;
|
||||
|
||||
preTransaction = new TransactionMaster();
|
||||
preTransaction.setTxnId(txnId);
|
||||
preTransaction.setInitiatorTxnId(txnId);
|
||||
|
||||
@@ -53,6 +53,7 @@ import com.billpaymentservice.bbps.dto.response.BillDataResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.ClientReqIdResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.ComplaintHistoryStatusResponse;
|
||||
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.PlanResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.TicketCheckStatusResponse;
|
||||
@@ -817,9 +818,8 @@ public class BillerMapperHelper {
|
||||
}
|
||||
|
||||
public void saveOrUpdateBillData(BillDataResponse responseWrapper,
|
||||
BillFetchByBillIdRequest billFetchByBillIdRequest, String txnId, String reqId, String userId) {
|
||||
BillFetchByBillIdRequest billFetchByBillIdRequest, String txnId, String reqId, String userId,BillMaster billMaster) {
|
||||
|
||||
BillMaster billMaster = new BillMaster();
|
||||
|
||||
billMaster.setBillId(responseWrapper.getBillId());
|
||||
billMaster.setRefId(responseWrapper.getRefId());
|
||||
@@ -1166,11 +1166,11 @@ public class BillerMapperHelper {
|
||||
return f;
|
||||
}
|
||||
|
||||
public void saveBillValidation(com.billpaymentservice.bbps.dto.response.FetchBillValidateResponse responseWrapper,
|
||||
com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest billRequest, String txnId) {
|
||||
public void saveBillValidation(FetchBillValidateResponse responseWrapper,
|
||||
BillFetchByBillIdRequest billRequest, String txnId,BillValidation entity) {
|
||||
if (responseWrapper == null || billRequest == null)
|
||||
return;
|
||||
BillValidation entity = new BillValidation();
|
||||
|
||||
entity.setBillId(responseWrapper.getBillId());
|
||||
entity.setRefId(responseWrapper.getRefId());
|
||||
entity.setBillerId(responseWrapper.getBillerId());
|
||||
|
||||
@@ -14,8 +14,10 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import com.billpaymentservice.bbps.dto.UserDetailsDTO;
|
||||
import com.billpaymentservice.bbps.dto.auth.RegisterRequest;
|
||||
import com.billpaymentservice.bbps.dto.response.BillDataResponse;
|
||||
import com.billpaymentservice.bbps.entites.BBPSMastersData;
|
||||
import com.billpaymentservice.bbps.entites.BharatConnectMaster;
|
||||
import com.billpaymentservice.bbps.entites.BillMaster;
|
||||
import com.billpaymentservice.bbps.entites.InboundTraceLog;
|
||||
import com.billpaymentservice.bbps.entites.OutboundTraceLog;
|
||||
import com.billpaymentservice.bbps.entites.TransactionMaster;
|
||||
@@ -284,5 +286,10 @@ public class Helper {
|
||||
LOGGER.info("TransactionMaster dest after merge: {}", dest);
|
||||
}
|
||||
|
||||
public void mergeNonNullFieldsBillIntiate(BillDataResponse responseWrapper, BillMaster existingbill) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -23,9 +23,9 @@ swagger.server.description=Local Development Server
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/bbps_enhanced
|
||||
|
||||
spring.datasource.username=postgres
|
||||
spring.datasource.password=UAT@DB_2025
|
||||
#spring.datasource.password=UAT@DB_2025
|
||||
|
||||
#spring.datasource.password=himanshu@123
|
||||
spring.datasource.password=himanshu@123
|
||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
|
||||
|
||||
|
||||
Reference in New Issue
Block a user