Files
bbps-backend/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroupById.java
T
2025-11-10 10:11:26 +05:30

60 lines
1.8 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.billpaymentservice.bbps.entites;
import java.util.List;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@Table(name = "customer_param_group_by_biller_id")
public class CustomerParamGroupById extends Auditable<String> {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "group_id")
private String groupId; // Unique ID for each group, it’s a UUID
@Column(name = "name")
private String name; // Name of the group
@Column(name = "input")
private String input; // Input data for the group (can be a simple string)
// One-to-many relationship with parameters of this group
@OneToMany(mappedBy = "group", cascade = CascadeType.ALL, orphanRemoval = true)
private List<GroupParam> params; // List of parameters related to this group
// One-to-many relationship with child groups (recursively)
@OneToMany(mappedBy = "parentGroup", cascade = CascadeType.ALL, orphanRemoval = true)
private List<CustomerParamGroupById> childGroups; // Child groups of this group
// Many-to-one relationship with parent group (optional, for root groups, this
// will be null)
@ManyToOne
@JoinColumn(name = "parent_group_id")
private CustomerParamGroupById parentGroup; // Link to the parent group
@Column(name = "request_id")
private String requestId;
@Column(name = "txn_id")
private String txnId;
}