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

40 lines
1.1 KiB
Java

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