cretaed entities for BillerDetail
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "additional_info")
|
||||
public class AdditionalInfo {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id; // primary key for the table
|
||||
|
||||
@Column(name = "param_config_id", nullable = false)
|
||||
@NotBlank(message = "Param Config ID cannot be blank")
|
||||
private String paramConfigId;
|
||||
|
||||
@Column(name = "param_name", nullable = false)
|
||||
@NotBlank(message = "Param name cannot be blank")
|
||||
private String paramName;
|
||||
|
||||
@Column(name = "data_type_dao")
|
||||
private String dataTypeDAO;
|
||||
|
||||
@Column(name = "data_type_model")
|
||||
private String dataTypeModel;
|
||||
|
||||
@Column(name = "optional", nullable = false)
|
||||
private boolean optional;
|
||||
|
||||
@Column(name = "visibility", nullable = false)
|
||||
private boolean visibility;
|
||||
|
||||
// 🔗 Many AdditionalInfos belong to one Biller
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "biller_id", nullable = false)
|
||||
private BillerDetails biller;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.List;
|
||||
|
||||
import com.billpaymentservice.bbps.entites.BillerResponseParams;
|
||||
|
||||
@Entity
|
||||
@Table(name = "amount_option")
|
||||
@Getter
|
||||
@Setter
|
||||
public class AmountOption {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "amount_option_id")
|
||||
private Long id;
|
||||
|
||||
@ElementCollection
|
||||
@CollectionTable(
|
||||
name = "amount_option_breakup_sets",
|
||||
joinColumns = @JoinColumn(name = "amount_option_id")
|
||||
)
|
||||
@Column(name = "amount_breakup_value")
|
||||
private List<String> amountBreakupSets;
|
||||
|
||||
// 🔗 Relationship with BillerResponseParams
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "biller_response_id", nullable = false)
|
||||
private BillerResponseParams billerResponseParams;
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@ToString
|
||||
@Table(name = "biller_details")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class BillerDetails {
|
||||
|
||||
@Id
|
||||
@Column(name = "biller_id", length = 14, nullable = false, unique = true)
|
||||
@NotBlank(message = "Biller ID is mandatory")
|
||||
@Size(min = 14, max = 14, message = "Biller ID must be 14 characters long")
|
||||
private String billerId;
|
||||
|
||||
@Column(name = "biller_name", nullable = false)
|
||||
@NotBlank(message = "Biller name cannot be blank")
|
||||
private String billerName;
|
||||
|
||||
@Column(name = "biller_alias_name", nullable = false)
|
||||
@NotBlank(message = "Biller alias name cannot be blank")
|
||||
private String billerAliasName;
|
||||
|
||||
@Column(name = "biller_category_name", nullable = false)
|
||||
@NotBlank(message = "Biller category name cannot be blank")
|
||||
private String billerCategoryName;
|
||||
|
||||
@Column(name = "biller_mode", nullable = false)
|
||||
@NotBlank(message = "Biller mode cannot be blank")
|
||||
private String billerMode;
|
||||
|
||||
@Column(name = "biller_accepts_adhoc", nullable = false)
|
||||
private boolean billerAcceptsAdhoc;
|
||||
|
||||
@Column(name = "parent_biller", nullable = false)
|
||||
private boolean parentBiller;
|
||||
|
||||
@Column(name = "parent_biller_id", nullable = false)
|
||||
@NotBlank(message = "Parent biller ID cannot be blank")
|
||||
private String parentBillerId;
|
||||
|
||||
@Column(name = "biller_ownership", nullable = false)
|
||||
@NotBlank(message = "Biller ownership is required (PSU or Private)")
|
||||
private String billerOwnerShp;
|
||||
|
||||
@Column(name = "biller_coverage", nullable = false)
|
||||
@NotBlank(message = "Biller coverage cannot be blank")
|
||||
private String billerCoverage;
|
||||
|
||||
@Column(name = "fetch_requirement", nullable = false)
|
||||
@NotBlank(message = "Fetch requirement is mandatory")
|
||||
private String fetchRequirement;
|
||||
|
||||
@Column(name = "payment_amount_exactness", nullable = false)
|
||||
@NotBlank(message = "Payment amount exactness is required")
|
||||
private String paymentAmountExactness;
|
||||
|
||||
@Column(name = "support_bill_validation", nullable = false)
|
||||
@NotBlank(message = "Support bill validation is required")
|
||||
private String supportBillValidation;
|
||||
|
||||
@Column(name = "biller_effctv_from", nullable = false)
|
||||
@NotBlank(message = "Effective from date is required")
|
||||
private String billerEffctvFrom;
|
||||
|
||||
@Column(name = "biller_effctv_to", nullable = false)
|
||||
@NotBlank(message = "Effective to date is required")
|
||||
private String billerEffctvTo;
|
||||
|
||||
@Column(name = "biller_temp_deactivation_start")
|
||||
private String billerTempDeactivationStart;
|
||||
|
||||
@Column(name = "biller_temp_deactivation_end")
|
||||
private String billerTempDeactivationEnd;
|
||||
|
||||
@Column(name = "biller_description", nullable = false, length = 500)
|
||||
@NotBlank(message = "Biller description cannot be blank")
|
||||
private String billerDescription;
|
||||
|
||||
@Column(name = "biller_response_type", nullable = false)
|
||||
@NotBlank(message = "Biller response type is required (SINGLE or SELECTIVE)")
|
||||
private String billerResponseType;
|
||||
|
||||
@Column(name = "plan_mdm_requirement", nullable = false)
|
||||
@NotBlank(message = "Plan MDM requirement cannot be blank")
|
||||
private String planMDMRequirement;
|
||||
|
||||
@Column(name = "status", nullable = false)
|
||||
@NotBlank(message = "Status must be ACTIVE or INACTIVE")
|
||||
private String status;
|
||||
|
||||
@Column(name = "support_deemed", nullable = false)
|
||||
@NotBlank(message = "Support deemed value is required (Yes/No)")
|
||||
private String supportDeemed;
|
||||
|
||||
@Column(name = "support_pending_status", nullable = false)
|
||||
@NotBlank(message = "Support pending status is required (Yes/No)")
|
||||
private String supportPendingStatus;
|
||||
|
||||
@Column(name = "biller_time_out", nullable = false)
|
||||
@NotBlank(message = "Biller timeout is required")
|
||||
private String billerTimeOut;
|
||||
|
||||
@Column(name = "route_url")
|
||||
private String routeUrl;
|
||||
|
||||
@Column(name = "upms_enabled")
|
||||
private String upmsEnabled;
|
||||
|
||||
@Column(name = "clickpay_enabled")
|
||||
private String clickpayEnabled;
|
||||
|
||||
@Column(name = "deemed_success_enabled")
|
||||
private String deemedSuccessEnabled;
|
||||
|
||||
@Column(name = "selection_type")
|
||||
private String selectionType;
|
||||
|
||||
// ✅ Relationships — Each maps to its sub-arrays or objects in API
|
||||
|
||||
@OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<PaymentMode> billerPaymentModes;
|
||||
|
||||
@OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<PaymentChannel> billerPaymentChannels;
|
||||
|
||||
@OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<CustomerParam> billerCustomerParams;
|
||||
|
||||
@OneToOne(mappedBy = "biller", cascade = CascadeType.ALL)
|
||||
private CustomerParamGroups customerParamGroups;
|
||||
|
||||
@OneToOne(mappedBy = "biller", cascade = CascadeType.ALL)
|
||||
private BillerResponseParams billerResponseParams;
|
||||
|
||||
@OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<AdditionalInfo> billerAdditionalInfos;
|
||||
|
||||
@OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<AdditionalInfo> billerAdditionalInfoPayments;
|
||||
|
||||
@OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<InterchangeFeeConf> interchangeFeeConves;
|
||||
|
||||
@OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<InterchangeFee> interchangeFees;
|
||||
|
||||
@OneToOne(mappedBy = "biller", cascade = CascadeType.ALL)
|
||||
private BillerPlanResponseParams billerPlanResponseParams;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "biller_plan_response_params")
|
||||
public class BillerPlanResponseParams {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id; // Primary Key
|
||||
|
||||
@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;
|
||||
|
||||
@Column(name = "amount_options", columnDefinition = "TEXT")
|
||||
private String amountOptionsJson;
|
||||
|
||||
// 🔗 Relationship with BillerDAO
|
||||
@OneToOne
|
||||
@JoinColumn(name = "biller_id", nullable = false)
|
||||
private BillerDetails biller;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "biller_response_params")
|
||||
public class BillerResponseParams {
|
||||
|
||||
@Id
|
||||
@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)
|
||||
private BillerDetails biller;
|
||||
|
||||
// ✅ Since params and amountOptions are lists of objects,
|
||||
// we can store them as JSON or in a separate table (simplified here using @ElementCollection)
|
||||
|
||||
@ElementCollection
|
||||
@CollectionTable(
|
||||
name = "biller_response_params_data",
|
||||
joinColumns = @JoinColumn(name = "biller_response_id")
|
||||
)
|
||||
@Column(name = "param_value")
|
||||
private List<String> params;
|
||||
|
||||
@OneToMany(mappedBy = "billerResponseParams", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<AmountOption> amountOptions;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "customer_param")
|
||||
public class CustomerParam {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "param_config_id")
|
||||
private Long id; // Primary key
|
||||
|
||||
@NotBlank(message = "Parameter name is required")
|
||||
@Column(name = "param_name", nullable = false)
|
||||
private String paramName;
|
||||
|
||||
@Column(name = "data_type_dao")
|
||||
private String dataTypeDAO;
|
||||
|
||||
@Column(name = "data_type_model")
|
||||
private String dataTypeModel;
|
||||
|
||||
@Column(name = "is_optional")
|
||||
private boolean optional;
|
||||
|
||||
@Min(0)
|
||||
@Column(name = "min_length")
|
||||
private int minLength;
|
||||
|
||||
@Min(0)
|
||||
@Column(name = "max_length")
|
||||
private int maxLength;
|
||||
|
||||
@Column(name = "regex")
|
||||
private String regex;
|
||||
|
||||
@Column(name = "is_visible")
|
||||
private boolean visibility;
|
||||
|
||||
// Store list of values as JSON or comma-separated string
|
||||
@ElementCollection
|
||||
@CollectionTable(name = "customer_param_values", joinColumns = @JoinColumn(name = "param_id"))
|
||||
@Column(name = "value")
|
||||
private List<String> values;
|
||||
|
||||
// 🔗 Many customer parameters belong to one biller
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "biller_id")
|
||||
private BillerDetails biller;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "customer_param_groups")
|
||||
public class CustomerParamGroups {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "group_container_id")
|
||||
private Long id;
|
||||
|
||||
// 🔗 One set of groups belongs to one biller
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "biller_id")
|
||||
private BillerDetails biller;
|
||||
|
||||
// 🔗 One CustomerParamGroups contains multiple Group objects
|
||||
@OneToMany(mappedBy = "customerParamGroups", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<Group> groups;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "biller_groups")
|
||||
public class Group {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "group_id")
|
||||
private Long id;
|
||||
|
||||
@Column(name = "group_name")
|
||||
private String name;
|
||||
|
||||
@Column(name = "input")
|
||||
private String input;
|
||||
|
||||
// Example: "Admission No/Application No/GR No" → stored as multiple params
|
||||
@ElementCollection
|
||||
@CollectionTable(name = "group_params", joinColumns = @JoinColumn(name = "group_id"))
|
||||
@Column(name = "param_name")
|
||||
private List<String> params;
|
||||
|
||||
// 🔗 Parent group relationship (for nested groups)
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "parent_group_id")
|
||||
private Group parentGroup;
|
||||
|
||||
// 🔁 Child groups (self-reference)
|
||||
@OneToMany(mappedBy = "parentGroup", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<Group> groups;
|
||||
|
||||
// 🔗 Back reference to CustomerParamGroups
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "group_container_id")
|
||||
private CustomerParamGroups customerParamGroups;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "interchange_fee")
|
||||
public class InterchangeFee {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id; // Primary key
|
||||
|
||||
@Column(name = "interchange_fee_id", nullable = false, unique = true)
|
||||
@NotBlank(message = "Interchange Fee ID cannot be blank")
|
||||
private String interchangeFeeId;
|
||||
|
||||
@Column(name = "fee_code", nullable = false)
|
||||
@NotBlank(message = "Fee code is mandatory")
|
||||
private String feeCode;
|
||||
|
||||
@Column(name = "fee_description")
|
||||
private String feeDesc;
|
||||
|
||||
@Column(name = "fee_direction")
|
||||
private String feeDirection;
|
||||
|
||||
// ✅ Relationship with InterchangeFeeDetail (One-to-Many)
|
||||
@OneToMany(mappedBy = "interchangeFee", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<InterchangeFeeDetail> interchangeFeeDetails;
|
||||
|
||||
// 🔗 Many InterchangeFee entries belong to one Biller
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "biller_id", nullable = false)
|
||||
private BillerDetails biller;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "interchange_fee_conf")
|
||||
public class InterchangeFeeConf {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id; // Primary Key for DB table
|
||||
|
||||
@Column(name = "interchange_fee_conf_id", nullable = false, unique = true)
|
||||
@NotBlank(message = "Interchange Fee Config ID cannot be blank")
|
||||
private String interChangeFeeConfId;
|
||||
|
||||
@Column(name = "mti")
|
||||
private String mti;
|
||||
|
||||
@Column(name = "payment_mode")
|
||||
private String paymentMode;
|
||||
|
||||
@Column(name = "payment_channel")
|
||||
private String paymentChannel;
|
||||
|
||||
@Column(name = "response_code")
|
||||
private String responseCode;
|
||||
|
||||
// ⚙️ Since 'fees' is a list of simple strings, we use ElementCollection
|
||||
@ElementCollection
|
||||
@CollectionTable(
|
||||
name = "interchange_fee_conf_fees",
|
||||
joinColumns = @JoinColumn(name = "interchange_fee_conf_id_fk")
|
||||
)
|
||||
@Column(name = "fee_value")
|
||||
private List<String> fees;
|
||||
|
||||
@Column(name = "default_fee")
|
||||
private boolean defaultFee;
|
||||
|
||||
@Column(name = "effective_from")
|
||||
private String effctvFrom;
|
||||
|
||||
@Column(name = "effective_to")
|
||||
private String effctvTo;
|
||||
|
||||
// 🔗 Many InterchangeFeeConf records belong to one Biller
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "biller_id", nullable = false)
|
||||
private BillerDetails biller;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
@Table(name = "interchange_fee_detail")
|
||||
@Getter
|
||||
@Setter
|
||||
public class InterchangeFeeDetail {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "interchange_fee_det_id", unique = true, nullable = false)
|
||||
private String interchangeFeeDetId;
|
||||
|
||||
@Column(name = "tran_amt_range_max")
|
||||
private long tranAmtRangeMax;
|
||||
|
||||
@Column(name = "tran_amt_range_min")
|
||||
private long tranAmtRangeMin;
|
||||
|
||||
@Column(name = "percent_fee")
|
||||
private double percentFee;
|
||||
|
||||
@Column(name = "flat_fee")
|
||||
private double flatFee;
|
||||
|
||||
@Column(name = "effctv_from")
|
||||
private String effctvFrom;
|
||||
|
||||
// 🔗 Many InterchangeFeeDetail belong to one InterchangeFee
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "interchange_fee_id", nullable = false)
|
||||
private InterchangeFee interchangeFee;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "payment_channel")
|
||||
public class PaymentChannel {
|
||||
|
||||
@Id
|
||||
@Column(name = "payment_channel_limit_id")
|
||||
@JsonProperty("paymentChannelLimitId") // 👈 Map JSON field to this property
|
||||
private String id; // Primary key (manual, not auto-generated)
|
||||
|
||||
@NotBlank(message = "Payment channel is required")
|
||||
@Column(name = "payment_channel", nullable = false)
|
||||
private String paymentChannel;
|
||||
|
||||
@Min(value = 0, message = "Max limit cannot be negative")
|
||||
@Column(name = "max_limit")
|
||||
private long maxLimit;
|
||||
|
||||
@Min(value = 0, message = "Min limit cannot be negative")
|
||||
@Column(name = "min_limit")
|
||||
private long minLimit;
|
||||
|
||||
@Column(name = "support_pending_status")
|
||||
private String supportPendingStatus;
|
||||
|
||||
// 🔗 Many PaymentChannels belong to one Biller
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "biller_id")
|
||||
private BillerDetails biller;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "biller_payment_modes")
|
||||
public class PaymentMode {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "payment_model_limit_id", unique = true, length = 50)
|
||||
@NotBlank(message = "Payment model limit ID cannot be blank")
|
||||
private String paymentModelLimitId;
|
||||
|
||||
@Column(name = "payment_mode", nullable = false, length = 50)
|
||||
@NotBlank(message = "Payment mode is mandatory")
|
||||
private String paymentMode;
|
||||
|
||||
@Column(name = "max_limit")
|
||||
@PositiveOrZero(message = "Max limit must be zero or positive")
|
||||
private long maxLimit;
|
||||
|
||||
@Column(name = "min_limit")
|
||||
@PositiveOrZero(message = "Min limit must be zero or positive")
|
||||
private long minLimit;
|
||||
|
||||
@Column(name = "support_pending_status", length = 10)
|
||||
@Pattern(regexp = "^(Yes|No)?$", message = "Support pending status must be either 'Yes' or 'No'")
|
||||
private String supportPendingStatus;
|
||||
|
||||
// 🔗 Many-to-One relationship with BillerDAO
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "biller_id", nullable = false)
|
||||
private BillerDetails biller;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user