cretaed entities for BillerDetail
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user