added database for bill intitate and bill payment and removed the polling logic
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
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 = "additional_info_bill")
|
||||
@Getter
|
||||
@Setter
|
||||
public class AdditionalInfoBill {
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
private String value;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "bill_master_id")
|
||||
private BillMaster billMaster;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Entity
|
||||
@Table(name = "bill_initiate")
|
||||
public class BillInitiate {
|
||||
@Id
|
||||
@Column(name = "req_id")
|
||||
private String reqId;
|
||||
|
||||
@Column(name = "bill_id", nullable = false)
|
||||
private String billId;
|
||||
|
||||
@Column(name = "txn_id")
|
||||
private String txnId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.billpaymentservice.bbps.dto.BillerResponseBill;
|
||||
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.OneToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
@Table(name = "bill_master")
|
||||
@Builder
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BillMaster {
|
||||
|
||||
@Id
|
||||
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 actionType;
|
||||
private String userId;
|
||||
@OneToOne(cascade = CascadeType.ALL)
|
||||
@JoinColumn(name = "biller_response_id")
|
||||
private BillerResponse billerResponse;
|
||||
@OneToMany(mappedBy = "billMaster", cascade = CascadeType.ALL)
|
||||
private List<AdditionalInfoBill> additionalInfo;
|
||||
@OneToMany(mappedBy = "billMaster", cascade = CascadeType.ALL)
|
||||
private List<CustomerParamBill> customerParams;
|
||||
private String creationDate;
|
||||
private String modifiedDate;
|
||||
private Long createdEpochDate;
|
||||
private Long modifiedEpochDate;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
@@ -17,7 +17,6 @@ import java.util.List;
|
||||
@ToString
|
||||
@Table(name = "biller_plan_response_params")
|
||||
public class BillerPlanResponseParams {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id; // Primary Key
|
||||
@@ -25,7 +24,6 @@ public class BillerPlanResponseParams {
|
||||
@Column(name = "biller_plan_response_id", nullable = false, unique = true)
|
||||
@NotBlank(message = "Biller Plan Response ID cannot be blank")
|
||||
private String billerPlanResponseId;
|
||||
|
||||
// ✅ params list — since it's not a separate table, we can store as JSON or text
|
||||
@Column(name = "params", columnDefinition = "TEXT")
|
||||
private String paramsJson;
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
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 = "biller_response")
|
||||
@Getter
|
||||
@Setter
|
||||
public class BillerResponse {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
@Column(name = "amount")
|
||||
private String amount;
|
||||
|
||||
@Column(name = "bill_date")
|
||||
private String billDate;
|
||||
|
||||
@Column(name = "bill_id")
|
||||
private String billId;
|
||||
|
||||
@Column(name = "bill_number")
|
||||
private String billNumber;
|
||||
|
||||
@Column(name = "bill_period")
|
||||
private String billPeriod;
|
||||
|
||||
@Column(name = "cust_conv_fee")
|
||||
private String custConvFee;
|
||||
|
||||
@Column(name = "cou_cust_conv_fee")
|
||||
private String couCustConvFee;
|
||||
|
||||
@Column(name = "due_date")
|
||||
private String dueDate;
|
||||
|
||||
@Column(name = "customer_name")
|
||||
private String customerName;
|
||||
|
||||
@Column(name = "amount_option")
|
||||
private Boolean amountOption;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "bill_master_id")
|
||||
private BillMaster billMaster;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public class BillerResponseParams {
|
||||
@Column(name = "biller_response_id", nullable = false, unique = true)
|
||||
@NotBlank(message = "Biller Response ID is required")
|
||||
private String billerResponseId;
|
||||
|
||||
|
||||
// 🔗 One-to-One Relationship with BillerDAO
|
||||
@OneToOne
|
||||
@JoinColumn(name = "biller_id", nullable = false)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@Table(name = "customer_param_bill")
|
||||
public class CustomerParamBill {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
private String value;
|
||||
private String type;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "bill_master_id")
|
||||
private BillMaster billMaster;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
Reference in New Issue
Block a user