Files
bbps-backend/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java
T

164 lines
5.7 KiB
Java

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;
}