diff --git a/pom.xml b/pom.xml
index 8ea65ce..a690489 100644
--- a/pom.xml
+++ b/pom.xml
@@ -172,7 +172,10 @@
org.springframework.boot
spring-boot-maven-plugin
+
+
+ BBPS
diff --git a/src/main/java/com/billpaymentservice/bbps/config/CORSConfig.java b/src/main/java/com/billpaymentservice/bbps/config/CORSConfig.java
new file mode 100644
index 0000000..2b8dbde
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/config/CORSConfig.java
@@ -0,0 +1,18 @@
+package com.billpaymentservice.bbps.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+@Configuration
+public class CORSConfig implements WebMvcConfigurer {
+
+ @Override
+ public void addCorsMappings(CorsRegistry registry) {
+ registry.addMapping("/**")
+ .allowedOrigins("*") // Or specific origin like "http://localhost:4200"
+ .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
+ .allowedHeaders("*")
+ .allowCredentials(false); // Set to true if you're sending cookies
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/billpaymentservice/bbps/config/SecurityConfig.java b/src/main/java/com/billpaymentservice/bbps/config/SecurityConfig.java
new file mode 100644
index 0000000..ebe19d9
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/config/SecurityConfig.java
@@ -0,0 +1,28 @@
+package com.billpaymentservice.bbps.config;
+
+import java.util.Arrays;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.CorsConfigurationSource;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+
+@Configuration
+public class SecurityConfig {
+
+ @Bean
+ public CorsConfigurationSource corsConfigurationSource() {
+ CorsConfiguration config = new CorsConfiguration();
+ config.setAllowedOrigins(Arrays.asList("*")); // Or use specific origin like "http://localhost:4200"
+ config.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
+ config.setAllowedHeaders(Arrays.asList("*"));
+ config.setAllowCredentials(false); // true only if you're sending cookies
+
+ // Use UrlBasedCorsConfigurationSource as it implements CorsConfigurationSource
+ UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+ source.registerCorsConfiguration("/**", config); // Apply CORS to all paths
+ return source; // Return as CorsConfigurationSource
+ }
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/controller/AgentController.java b/src/main/java/com/billpaymentservice/bbps/controller/AgentController.java
index 92737af..100d063 100644
--- a/src/main/java/com/billpaymentservice/bbps/controller/AgentController.java
+++ b/src/main/java/com/billpaymentservice/bbps/controller/AgentController.java
@@ -3,6 +3,7 @@ package com.billpaymentservice.bbps.controller;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -16,45 +17,37 @@ import com.billpaymentservice.bbps.service.AgentService;
@RestController
@RequestMapping("/agent")
+@CrossOrigin(origins = "*")
public class AgentController {
- private final AgentService agentService;
+ private final AgentService agentService;
- public AgentController(AgentService agentService) {
- this.agentService = agentService;
- }
+ public AgentController(AgentService agentService) {
+ this.agentService = agentService;
+ }
- /**
- * Fetches bill details from external BBPS service
- */
- @PostMapping(
- value = "/requestBillFetch",
- consumes = MediaType.APPLICATION_JSON_VALUE,
- produces = MediaType.APPLICATION_JSON_VALUE
- )
- public ResponseEntity requestBillFetch(
- @Validated @RequestBody FetchBillRequest fetchBillRequest) {
+ /**
+ * Fetches bill details from external BBPS service
+ */
+ @PostMapping(value = "/requestBillFetch", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity requestBillFetch(@Validated @RequestBody FetchBillRequest fetchBillRequest) {
- ResponseModel response = agentService.initiateBillFetch(fetchBillRequest);
- return ResponseEntity.ok(response);
- }
-
- /**
- * Fetches bill details from external BBPS service
- */
- @PostMapping(
- value = "/fetchBillById",
- consumes = MediaType.APPLICATION_JSON_VALUE,
- produces = MediaType.APPLICATION_JSON_VALUE
- )
- public ResponseEntity fetchBillById(
- @Validated @RequestBody BillFetchByBillIdRequest billFetchByBillIdRequest) {
+ ResponseModel response = agentService.initiateBillFetch(fetchBillRequest);
+ return ResponseEntity.ok(response);
+ }
- ResponseModel response = agentService.fetchBillById(billFetchByBillIdRequest);
- return ResponseEntity.ok(response);
- }
-
- /**
+ /**
+ * Fetches bill details from external BBPS service
+ */
+ @PostMapping(value = "/fetchBillById", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity fetchBillById(
+ @Validated @RequestBody BillFetchByBillIdRequest billFetchByBillIdRequest) {
+
+ ResponseModel response = agentService.fetchBillById(billFetchByBillIdRequest);
+ return ResponseEntity.ok(response);
+ }
+
+ /**
* Fetches bill details validate from external BBPS service
*/
@PostMapping(value = "/requestBillValidate", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@@ -69,7 +62,8 @@ public class AgentController {
* Fetches bill details by bill Id from external BBPS service
*/
@PostMapping(value = "/requestBillValidateByBillId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity requestBillByBillId(@Validated @RequestBody BillFetchByBillIdRequest billRequest) {
+ public ResponseEntity requestBillByBillId(
+ @Validated @RequestBody BillFetchByBillIdRequest billRequest) {
ResponseModel response = agentService.initiateBillValidateByBillId(billRequest);
return ResponseEntity.ok(response);
diff --git a/src/main/java/com/billpaymentservice/bbps/controller/MasterDataController.java b/src/main/java/com/billpaymentservice/bbps/controller/MasterDataController.java
index 1db5cc0..e0b8989 100644
--- a/src/main/java/com/billpaymentservice/bbps/controller/MasterDataController.java
+++ b/src/main/java/com/billpaymentservice/bbps/controller/MasterDataController.java
@@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -25,6 +26,7 @@ import jakarta.validation.Valid;
@RequestMapping("/masterData")
@RestController
@Validated
+@CrossOrigin(origins="*")
public class MasterDataController {
private static final Logger log = LoggerFactory.getLogger(MasterDataController.class);
@@ -73,7 +75,7 @@ public class MasterDataController {
return ResponseEntity.ok(masterDataService.getCustomerParamByBillerId(customerParamRequest));
}
/**
- * Get All Master Data .The parameter is different from the data we are getting
+ * Get All Master Data .The parameter is different from the data we are getting Made By Arham
* in the MasterRequest
**/
@PostMapping("/getAllMastersData")
@@ -81,14 +83,14 @@ public class MasterDataController {
return masterDataService.getMasterData(masterRequest);
}
- /** POST Master Category Wise API Fetch Category Wise from BBPS URL **/
+ /** POST Master CategoryResponseList Wise API Fetch CategoryResponseList Wise from BBPS URL Made By Arham **/
@PostMapping(value = "/getMasterCategoryWise", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity getMasterDataCategoryWise(
- @Validated @RequestBody MasterCategoryRequest masterRequest) {
+ @Valid @RequestBody MasterCategoryRequest masterRequest) {
return ResponseEntity.ok(masterDataService.fetchMasterDataCategoryWise(masterRequest));
}
- /** POST Customer Param Groups API Fetch Category Wise from BBPS URL **/
+ /** POST Customer Param Groups API Fetch CategoryResponseList Wise from BBPS URL Made By Arham**/
@PostMapping(value = "/customerParamGroupsByBillerId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity getCustomerParamGroup(
@Validated @RequestBody BillerDetailRequest requestModel) {
@@ -96,8 +98,8 @@ public class MasterDataController {
}
/**
- * POST Fetch All AMount Options By Biller Id API Fetch Category Wise from BBPS
- * URL
+ * POST Fetch All AMount Options By Biller Id API Fetch CategoryResponseList Wise from BBPS
+ * URL Made By Arham
**/
@PostMapping(value = "/fetchAmountOptionsByBillerId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity fetchAllMasterAmountOptionsByBillerId(
@@ -106,8 +108,8 @@ public class MasterDataController {
}
/**
- * POST Fetch All AMount Options By Biller Id API Fetch Category Wise from BBPS
- * URL
+ * POST Fetch All AMount Options By Biller Id API Fetch CategoryResponseList Wise from BBPS
+ * URL Made By Arham
**/
@PostMapping(value = "/fetchAllPlanCategoriesByBillerId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity fetchPlanCategories(@Validated @RequestBody BillerDetailRequest requestModel) {
@@ -115,7 +117,7 @@ public class MasterDataController {
}
/**
- * POST Fetch Initiating Channel API Fetch Category Wise from BBPS URL
+ * POST Fetch Initiating Channel API Fetch CategoryResponseList Wise from BBPS URL Made By Arham
**/
@PostMapping(value = "/initiatingChannel", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity initiatingChannel(@Validated @RequestBody BillerDetailRequest requestModel) {
@@ -123,7 +125,7 @@ public class MasterDataController {
}
/**
- * POST Fetch All AMount Options By Biller Id API Fetch Category Wise from BBPS
+ * POST Fetch All AMount Options By Biller Id API Fetch CategoryResponseList Wise from BBPS Made By Arham
* URL
**/
@PostMapping(value = "/fetchPlanByCategoryName", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/BaseClass.java b/src/main/java/com/billpaymentservice/bbps/dto/request/BaseClass.java
index aba2db5..ab7388c 100644
--- a/src/main/java/com/billpaymentservice/bbps/dto/request/BaseClass.java
+++ b/src/main/java/com/billpaymentservice/bbps/dto/request/BaseClass.java
@@ -10,43 +10,42 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
-@Getter
-@Setter
-@AllArgsConstructor
+@Getter
+@Setter
+@AllArgsConstructor
@NoArgsConstructor
@ToString
public abstract class BaseClass {
@NotBlank(message = "MID cannot be null or blank")
- private String mid;
-
+ private String mid;
+
@NotBlank(message = "Secret key cannot be null or blank")
private String secretKey;
+
@NotBlank(message = "Request ID cannot be null or blank")
private String reqId;
-
- private DeviceDetail deviceDetial;
-
- private String udf1;
+ private DeviceDetail deviceDetial;
+ // ✅ 10 User Defined Fields (UDF1–UDF10)
+ private String udf1;
- @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
- private String udf2;
+ @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+ private String udf2;
- private String udf3;
+ private String udf3;
- private String udf4;
+ private String udf4;
- private String udf5;
+ private String udf5;
- private String udf6;
-
- private String udf7;
+ private String udf6;
- private String udf8;
+ private String udf7;
- private String udf9;
+ private String udf8;
- private String udf10;
+ private String udf9;
+
+ private String udf10;
}
-
diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/FetchBillValidatestRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/request/FetchBillValidatestRequest.java
index e8bd83f..04bf04c 100644
--- a/src/main/java/com/billpaymentservice/bbps/dto/request/FetchBillValidatestRequest.java
+++ b/src/main/java/com/billpaymentservice/bbps/dto/request/FetchBillValidatestRequest.java
@@ -19,7 +19,7 @@ public class FetchBillValidatestRequest extends BaseClass {
@NotNull
private String billerName; // String, Name of the biller
@NotNull
- private String billerCategory; // String, Category of the biller
+ private String billerCategory; // String, CategoryResponseList of the biller
@NotNull
private String customerMobNo; // String, Mobile of the Customer
diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/MasterCategoryRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/request/MasterCategoryRequest.java
index ed00f47..0218ff4 100644
--- a/src/main/java/com/billpaymentservice/bbps/dto/request/MasterCategoryRequest.java
+++ b/src/main/java/com/billpaymentservice/bbps/dto/request/MasterCategoryRequest.java
@@ -1,5 +1,6 @@
package com.billpaymentservice.bbps.dto.request;
+import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -19,6 +20,8 @@ public class MasterCategoryRequest extends BaseClass {
private Integer pageStart = 0;
- private Integer pageEnd = 10;
+ @NotNull(message = "pageEnd is required")
+ @Min(value = 1, message = "pageEnd must be greater than 0")
+ private Integer pageEnd;
}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoPlans.java b/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoPlans.java
new file mode 100644
index 0000000..0bce4a9
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoPlans.java
@@ -0,0 +1,33 @@
+package com.billpaymentservice.bbps.entites;
+
+import java.util.List;
+import java.util.UUID;
+
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Entity
+@Table(name = "additional_info")
+@Getter
+@Setter
+public class AdditionalInfoPlans {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ private Long id;
+
+ @Column(name = "plan_ddditional_info_id")
+ private Long planAdditionalInfoId;
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ private List tags;
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionByBillerId.java b/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionByBillerId.java
new file mode 100644
index 0000000..b87b654
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionByBillerId.java
@@ -0,0 +1,36 @@
+package com.billpaymentservice.bbps.entites;
+
+import java.util.List;
+
+import com.billpaymentservice.bbps.audit.Auditable;
+
+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;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+@Entity
+@Table(name = "amount_option_biller_id")
+public class AmountOptionByBillerId extends Auditable {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
+ private Long id; // Use Long for auto-increment identity
+
+ @Column(name = "amount_options")
+ private Boolean amountOptions; // This is true or false
+
+ @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
+ @JoinColumn(name = "amount_option_id_long") // Foreign key field that links to the 'Long' column
+ private List amountOptionDetails; // List of AmountOptionDetails
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionDetails.java
new file mode 100644
index 0000000..df22ecd
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionDetails.java
@@ -0,0 +1,38 @@
+package com.billpaymentservice.bbps.entites;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+@Entity
+@Table(name = "amount_option_details")
+public class AmountOptionDetails {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
+ private Long id; // Primary Key
+
+ @Column(name = "amount_breakup_set")
+ private String amountBreakupSet; // Each string in the list (BASE_BILL_AMOUNT, Apple_Sab, etc.)
+
+ @Column(name = "amount_option_id")
+ private String amountOptionId; // Now a String (change this from Long to String, to match the foreign key)
+
+ @Column(name = "amount_option_id_long")
+ private Long amountOptionIdLong; // Long type for foreign key (added for the FK relationship)
+
+ @Column(name = "request_id")
+ private String requestId;
+
+ @Column(name = "txn_id")
+ private String txnId;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryIcon.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryIcon.java
new file mode 100644
index 0000000..685775a
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryIcon.java
@@ -0,0 +1,45 @@
+package com.billpaymentservice.bbps.entites;
+
+import com.billpaymentservice.bbps.audit.Auditable;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.ForeignKey;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Entity
+@Table(name = "biller_category_icon")
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class BillerCategoryIcon extends Auditable{
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "icon_id")
+ private Long id;
+
+ @Column(name = "icon_data")
+ private String iconData;
+
+ @Column(name = "icon_type")
+ private String iconType;
+
+ // Owning side of One-to-One
+ @OneToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "biller_id", nullable = false, referencedColumnName = "biller_id",
+ foreignKey = @ForeignKey(name = "fk_icon_biller"))
+ private BillerCategoryWise biller;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryWise.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryWise.java
new file mode 100644
index 0000000..beef7d1
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryWise.java
@@ -0,0 +1,66 @@
+package com.billpaymentservice.bbps.entites;
+
+import com.billpaymentservice.bbps.audit.Auditable;
+
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Id;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Entity
+@Table(name = "biller_category_wise")
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class BillerCategoryWise extends Auditable {
+
+ @Id
+ @Column(name = "biller_id")
+ private String billerId;
+
+ @Column(name = "biller_name", columnDefinition = "TEXT")
+ private String billerName;
+
+ @Column(name = "biller_type", columnDefinition = "TEXT")
+ private String billerType;
+
+ @Column(name = "biller_category", columnDefinition = "TEXT")
+ private String billerCategory;
+
+ @Column(name = "biller_coverage", columnDefinition = "TEXT")
+ private String billerCoverage;
+
+ @Column(name = "biller_response_type", columnDefinition = "TEXT")
+ private String billerResponseType;
+
+ @Column(name = "biller_description", columnDefinition = "TEXT")
+ private String billerDescription;
+
+ @Column(name = "plan_mdm_requirement", columnDefinition = "TEXT")
+ private String planMDMRequirement;
+
+ @Column(name = "adhoc_biller", columnDefinition = "TEXT")
+ private String adhocBiller;
+
+ @Column(name = "payment_amount_exactness", columnDefinition = "TEXT")
+ private String paymentAmountExactness;
+
+ @Column(name = "request_id")
+ private String requestId;
+
+ @Column(name = "txn_id")
+ private String txnId;
+
+ // One-to-One mapping with icon
+ @OneToOne(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
+ private BillerCategoryIcon icon;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CategoryResponseList.java b/src/main/java/com/billpaymentservice/bbps/entites/CategoryResponseList.java
new file mode 100644
index 0000000..0418e3a
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/CategoryResponseList.java
@@ -0,0 +1,33 @@
+package com.billpaymentservice.bbps.entites;
+
+import com.billpaymentservice.bbps.audit.Auditable;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Entity
+@Table(name = "category_response_list")
+@Getter
+@Setter
+public class CategoryResponseList extends Auditable {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @Column(name = "category_resp_list", columnDefinition = "TEXT")
+ private String categoryRespList;
+
+ @Column(name = "reqquest_id")
+ private String requestId;
+
+ @Column(name = "txn_id")
+ private String txnId;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroupById.java b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroupById.java
new file mode 100644
index 0000000..577dd4d
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroupById.java
@@ -0,0 +1,59 @@
+package com.billpaymentservice.bbps.entites;
+
+import java.util.List;
+
+import com.billpaymentservice.bbps.audit.Auditable;
+
+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.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+@Entity
+@Table(name = "customer_param_group_by_biller_id")
+public class CustomerParamGroupById extends Auditable {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @Column(name = "group_id")
+ private String groupId; // Unique ID for each group, it’s a UUID
+
+ @Column(name = "name")
+ private String name; // Name of the group
+
+ @Column(name = "input")
+ private String input; // Input data for the group (can be a simple string)
+
+ // One-to-many relationship with parameters of this group
+ @OneToMany(mappedBy = "group", cascade = CascadeType.ALL, orphanRemoval = true)
+ private List params; // List of parameters related to this group
+
+ // One-to-many relationship with child groups (recursively)
+ @OneToMany(mappedBy = "parentGroup", cascade = CascadeType.ALL, orphanRemoval = true)
+ private List childGroups; // Child groups of this group
+
+ // Many-to-one relationship with parent group (optional, for root groups, this
+ // will be null)
+ @ManyToOne
+ @JoinColumn(name = "parent_group_id")
+ private CustomerParamGroupById parentGroup; // Link to the parent group
+
+ @Column(name = "request_id")
+ private String requestId;
+
+ @Column(name = "txn_id")
+ private String txnId;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/FetchBillValidate.java b/src/main/java/com/billpaymentservice/bbps/entites/FetchBillValidate.java
new file mode 100644
index 0000000..c955dd1
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/FetchBillValidate.java
@@ -0,0 +1,77 @@
+package com.billpaymentservice.bbps.entites;
+
+import com.billpaymentservice.bbps.audit.Auditable;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+@Table(name = "fetch_bill_validate_response")
+public class FetchBillValidate extends Auditable {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
+ private Long id;
+
+ @Column(name = "bill_id")
+ private String billId;
+
+ @Column(name = "ref_id")
+ private String refId;
+
+ @Column(name = "biller_id")
+ private String billerId;
+
+ @Column(name = "status")
+ private String status;
+
+ @Column(name = "action_type")
+ private String actionType;
+
+ @Column(name = "user_id")
+ private String userId;
+
+ @Column(name = "biller_response")
+ private String billerResponse;
+
+ @Column(name = "additional_info")
+ private String additionalInfo;
+
+ @Column(name = "customer_params")
+ private String customerParams;
+
+ @Column(name = "plan_info_daos")
+ private String planInfoDaos;
+
+ @Column(name = "creation_date")
+ private String creationDate;
+
+ @Column(name = "modified_date")
+ private String modifiedDate;
+
+ @Column(name = "created_epoch_date")
+ private long createdEpochDate;
+
+ @Column(name = "modified_epoch_date")
+ private long modifiedEpochDate;
+
+ @Column(name = "request_id")
+ private String requestId;
+
+ @Column(name = "txn_id")
+ private String txnId;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/GroupParam.java b/src/main/java/com/billpaymentservice/bbps/entites/GroupParam.java
new file mode 100644
index 0000000..648ca14
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/GroupParam.java
@@ -0,0 +1,31 @@
+package com.billpaymentservice.bbps.entites;
+
+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.ManyToOne;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+@Entity
+@Table(name = "group_params")
+public class GroupParam {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @Column(name = "param_name")
+ private String paramName; // The parameter name (e.g., "Admission No")
+
+ @ManyToOne
+ @JoinColumn(name = "group_id")
+ private CustomerParamGroupById group; // Link to the group this parameter belongs to
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/Plan.java b/src/main/java/com/billpaymentservice/bbps/entites/Plan.java
new file mode 100644
index 0000000..fa0166d
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/Plan.java
@@ -0,0 +1,65 @@
+package com.billpaymentservice.bbps.entites;
+
+import java.util.List;
+
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Entity
+@Table(name = "plan")
+@Getter
+@Setter
+public class Plan {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @Column(name = "plan_id")
+ private String planId;
+
+ @Column(name = "description")
+ private String description;
+
+ @Column(name = "biller_id")
+ private String billerId;
+
+ @Column(name = "category_type")
+ private String categoryType;
+
+ @Column(name = "amount_rupees")
+ private String amountInRupees;
+
+ @Column(name = "effectv_form")
+ private String effctvFrom;
+
+ @Column(name = "effectv_to")
+ private String effctvTo;
+
+ @Column(name = "status")
+ private String status;
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "plan")
+ private List categorySubTypes; // List of categorySubTypes
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "plans_list_id")
+ private PlansList plansList;
+
+ @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ @JoinColumn(name = "additional_info_id")
+ private AdditionalInfoPlans additionalInfo;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PlanCategorySubType.java b/src/main/java/com/billpaymentservice/bbps/entites/PlanCategorySubType.java
new file mode 100644
index 0000000..f73e53e
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/PlanCategorySubType.java
@@ -0,0 +1,30 @@
+package com.billpaymentservice.bbps.entites;
+
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Entity
+@Table(name = "plan_category_sub_type")
+@Getter
+@Setter
+public class PlanCategorySubType {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ private String categorySubType;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "plan_id")
+ private Plan plan;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PlanResponses.java b/src/main/java/com/billpaymentservice/bbps/entites/PlanResponses.java
new file mode 100644
index 0000000..dcae113
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/PlanResponses.java
@@ -0,0 +1,50 @@
+package com.billpaymentservice.bbps.entites;
+
+import com.billpaymentservice.bbps.audit.Auditable;
+
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Entity
+@Table(name = "plan_response")
+@Getter
+@Setter
+public class PlanResponses extends Auditable {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ @JoinColumn(name = "plans_list_id")
+ private PlansList plansList;
+
+ @Column(name = "page_no")
+ private int pageNo;
+
+ @Column(name = "page_size")
+ private int pageSize;
+
+ @Column(name = "total_elements")
+ private long totalElements;
+
+ @Column(name = "total_pages")
+ private int totalPages;
+
+ @Column(name = "request_id")
+ private String requestId;
+
+ @Column(name = "txn_id")
+ private String txnId;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PlanTag.java b/src/main/java/com/billpaymentservice/bbps/entites/PlanTag.java
new file mode 100644
index 0000000..47b9504
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/PlanTag.java
@@ -0,0 +1,37 @@
+package com.billpaymentservice.bbps.entites;
+
+import java.util.UUID;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Entity
+@Table(name = "plan_tag")
+@Getter
+@Setter
+public class PlanTag {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ private UUID tagId;
+
+ @Column(name="name")
+ private String name;
+
+ @Column(name="value")
+ private String value;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "plan_id")
+ private Plan plan;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PlansList.java b/src/main/java/com/billpaymentservice/bbps/entites/PlansList.java
new file mode 100644
index 0000000..948f139
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/entites/PlansList.java
@@ -0,0 +1,29 @@
+package com.billpaymentservice.bbps.entites;
+
+import java.util.List;
+
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.Setter;
+
+@Entity
+@Table(name = "plans_list")
+@Getter
+@Setter
+public class PlansList {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "plansList")
+ private List plans;
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/repository/AmountOptionByBillerIdRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/AmountOptionByBillerIdRepository.java
new file mode 100644
index 0000000..22b74af
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/repository/AmountOptionByBillerIdRepository.java
@@ -0,0 +1,11 @@
+package com.billpaymentservice.bbps.repository;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import com.billpaymentservice.bbps.entites.AmountOptionByBillerId;
+
+@Repository
+public interface AmountOptionByBillerIdRepository extends JpaRepository {
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/repository/BillerCategoryIconRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/BillerCategoryIconRepository.java
new file mode 100644
index 0000000..fe754cc
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/repository/BillerCategoryIconRepository.java
@@ -0,0 +1,11 @@
+package com.billpaymentservice.bbps.repository;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import com.billpaymentservice.bbps.entites.BillerCategoryIcon;
+
+@Repository
+public interface BillerCategoryIconRepository extends JpaRepository {
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/repository/BillerCategoryWiseRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/BillerCategoryWiseRepository.java
new file mode 100644
index 0000000..0b8557c
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/repository/BillerCategoryWiseRepository.java
@@ -0,0 +1,11 @@
+package com.billpaymentservice.bbps.repository;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import com.billpaymentservice.bbps.entites.BillerCategoryWise;
+
+@Repository
+public interface BillerCategoryWiseRepository extends JpaRepository{
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/repository/CategoryResponseListRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/CategoryResponseListRepository.java
new file mode 100644
index 0000000..e22f0fd
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/repository/CategoryResponseListRepository.java
@@ -0,0 +1,11 @@
+package com.billpaymentservice.bbps.repository;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import com.billpaymentservice.bbps.entites.CategoryResponseList;
+
+@Repository
+public interface CategoryResponseListRepository extends JpaRepository {
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/repository/CustomerParamGroupByBillerIdRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/CustomerParamGroupByBillerIdRepository.java
new file mode 100644
index 0000000..835a4ec
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/repository/CustomerParamGroupByBillerIdRepository.java
@@ -0,0 +1,11 @@
+package com.billpaymentservice.bbps.repository;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import com.billpaymentservice.bbps.entites.CustomerParamGroupById;
+
+@Repository
+public interface CustomerParamGroupByBillerIdRepository extends JpaRepository {
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/repository/FetchBillValidateRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/FetchBillValidateRepository.java
new file mode 100644
index 0000000..506366a
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/repository/FetchBillValidateRepository.java
@@ -0,0 +1,11 @@
+package com.billpaymentservice.bbps.repository;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import com.billpaymentservice.bbps.entites.FetchBillValidate;
+
+@Repository
+public interface FetchBillValidateRepository extends JpaRepository {
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/repository/PlanResponseRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/PlanResponseRepository.java
new file mode 100644
index 0000000..df8a5eb
--- /dev/null
+++ b/src/main/java/com/billpaymentservice/bbps/repository/PlanResponseRepository.java
@@ -0,0 +1,12 @@
+package com.billpaymentservice.bbps.repository;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import com.billpaymentservice.bbps.entites.PlanResponses;
+
+
+@Repository
+public interface PlanResponseRepository extends JpaRepository {
+
+}
diff --git a/src/main/java/com/billpaymentservice/bbps/serviceImpl/AgentServiceImpl.java b/src/main/java/com/billpaymentservice/bbps/serviceImpl/AgentServiceImpl.java
index 98d5c5a..c8630dd 100644
--- a/src/main/java/com/billpaymentservice/bbps/serviceImpl/AgentServiceImpl.java
+++ b/src/main/java/com/billpaymentservice/bbps/serviceImpl/AgentServiceImpl.java
@@ -31,6 +31,7 @@ import com.billpaymentservice.bbps.repository.InboundTraceLogRepository;
import com.billpaymentservice.bbps.repository.OutboundTraceLogRepository;
import com.billpaymentservice.bbps.service.AgentService;
import com.billpaymentservice.bbps.util.BBPSConstant;
+import com.billpaymentservice.bbps.util.BillerMapperHelper;
import com.billpaymentservice.bbps.util.Helper;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -49,234 +50,230 @@ public class AgentServiceImpl implements AgentService {
private final HttpService httpService;
private final Helper helper;
private final BharatConnectMasterRepository beneficiaryDetailsRepository;
+ private final BillerMapperHelper mapperHelper;
private final BillMasterRepository billMasterRepository;
private final BillInitateRepository billIntiateRepository;
private static final Logger LOGGER = LoggerFactory.getLogger(AgentServiceImpl.class);
public AgentServiceImpl(RestClient restClient, HttpService httpService, Helper helper,
- BharatConnectMasterRepository beneficiaryDetailsRepository,InboundTraceLogRepository inboundTraceLogRepository,
- OutboundTraceLogRepository outboundTraceLogRepository, BillMasterRepository billMasterRepository,BillInitateRepository billIntiateRepository) {
+ BharatConnectMasterRepository beneficiaryDetailsRepository,
+ InboundTraceLogRepository inboundTraceLogRepository, OutboundTraceLogRepository outboundTraceLogRepository,
+ BillMasterRepository billMasterRepository, BillInitateRepository billIntiateRepository,
+ BillerMapperHelper mapperHelper) {
this.restClient = restClient;
this.httpService = httpService;
this.helper = helper;
this.beneficiaryDetailsRepository = beneficiaryDetailsRepository;
this.billMasterRepository = billMasterRepository;
- this. billIntiateRepository= billIntiateRepository;
+ this.billIntiateRepository = billIntiateRepository;
+ this.mapperHelper = mapperHelper;
}
-
-
+
@Override
public ResponseModel initiateBillFetch(FetchBillRequest fetchBillRequest) {
- LOGGER.info("Initiating bill fetch for request ID: {} and MID", fetchBillRequest.getReqId(), fetchBillRequest.getMid());
- String apiName = "InitiateBillFetch";
- String txnId = helper.generateTxnId(15);
- String requestId = fetchBillRequest.getReqId();
- String fullUrl = agentDtaUrl + BBPSConstant.BILL_FETCH_INTI;
+ LOGGER.info("Initiating bill fetch for request ID: {} and MID", fetchBillRequest.getReqId(),
+ fetchBillRequest.getMid());
+ String apiName = "InitiateBillFetch";
+ String txnId = helper.generateTxnId(15);
+ String requestId = fetchBillRequest.getReqId();
+ String fullUrl = agentDtaUrl + BBPSConstant.BILL_FETCH_INTI;
- helper.validateMerchant(fetchBillRequest.getMid());
+ helper.validateMerchant(fetchBillRequest.getMid());
- BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001");
- HttpHeaders headers = new HttpHeaders();
- headers.set("x-digiledge-key", headersData.getXDigiledgeKey());
- headers.set("agentId", headersData.getAgentId());
- headers.set("tenantId", headersData.getTenantId());
- headers.setContentType(MediaType.APPLICATION_JSON);
+ BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001");
+ HttpHeaders headers = new HttpHeaders();
+ headers.set("x-digiledge-key", headersData.getXDigiledgeKey());
+ headers.set("agentId", headersData.getAgentId());
+ headers.set("tenantId", headersData.getTenantId());
+ headers.setContentType(MediaType.APPLICATION_JSON);
- ObjectMapper objectMapper = new ObjectMapper();
- objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- String requestJson = helper.convertObjectToJson(fetchBillRequest);
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+ String requestJson = helper.convertObjectToJson(fetchBillRequest);
- // ✅ Create inbound & outbound logs
- InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnId, apiName, fetchBillRequest.getMid(), "POST", requestJson);
- OutboundTraceLog outboundLog = helper.createOutboundLog(txnId, requestId, apiName, fullUrl, "POST", requestJson);
- LOGGER.debug("Outbound log created successfully for txnId: {} and reqId: {}", txnId, requestId);
+ // ✅ Create inbound & outbound logs
+ InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnId, apiName, fetchBillRequest.getMid(),
+ "POST", requestJson);
+ OutboundTraceLog outboundLog = helper.createOutboundLog(txnId, requestId, apiName, fullUrl, "POST",
+ requestJson);
+ LOGGER.debug("Outbound log created successfully for txnId: {} and reqId: {}", txnId, requestId);
- try {
- LOGGER.info("Calling external API: {}", fullUrl);
- Map responseMap = httpService.postRequest(fullUrl, requestJson, headers);
- String responseData = responseMap.get("data");
+ try {
+ LOGGER.info("Calling external API: {}", fullUrl);
+ Map responseMap = httpService.postRequest(fullUrl, requestJson, headers);
+ String responseData = responseMap.get("data");
- helper.updateOutboundLogResponse(outboundLog, responseData);
- LOGGER.debug("Response received from BBPS: {}", responseData);
+ helper.updateOutboundLogResponse(outboundLog, responseData);
+ LOGGER.debug("Response received from BBPS: {}", responseData);
- Map dataMap = objectMapper.readValue(responseData, new TypeReference