entity update with audit

This commit is contained in:
Lincpay Tech
2025-12-10 10:03:15 +05:30
83 changed files with 734 additions and 569 deletions
@@ -15,7 +15,7 @@ import lombok.Setter;
@Table(name = "bbps_additional_info_bill")
@Getter
@Setter
public class AdditionalInfoBill {
public class AdditionalInfoBill extends Auditable {
@Id
@GeneratedValue
private Long id;
@@ -27,4 +27,4 @@ public class AdditionalInfoBill {
@JoinColumn(name = "bill_master_id")
private BillMaster billMaster;
}
}
@@ -14,7 +14,7 @@ import lombok.Setter;
@Table(name = "bbps_additional_info_bill_validate")
@Getter
@Setter
public class AdditionalInfoBillValidate {
public class AdditionalInfoBillValidate extends Auditable {
@Id
@GeneratedValue
private Long id;
@@ -26,4 +26,4 @@ public class AdditionalInfoBillValidate {
@JoinColumn(name = "bill_id_fk")
private BillValidation bill;
}
}
@@ -19,7 +19,7 @@ import lombok.Setter;
@Table(name = "bbps_plan_additional_info")
@Getter
@Setter
public class AdditionalInfoPlans {
public class AdditionalInfoPlans extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -30,4 +30,4 @@ public class AdditionalInfoPlans {
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "additionalInfo")
private List<PlanTag> tags;
}
}
@@ -15,7 +15,7 @@ import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
public class AgentFundTransfer {
public class AgentFundTransfer extends Auditable {
@Id
@@ -53,4 +53,4 @@ public class AgentFundTransfer {
@Column(name = "fund_status")
private String fundStatus;
}
}
@@ -14,7 +14,7 @@ import lombok.Setter;
@Getter
@Setter
@Table(name = "bbps_agent_fund_transfer")
public class AgentFundTransferEntity {
public class AgentFundTransferEntity extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -33,5 +33,4 @@ public class AgentFundTransferEntity {
private String agentNpciId;
private String txnRefId;
private String fundStatus;
}
}
@@ -19,7 +19,7 @@ import lombok.Setter;
@Table(name = "bbps_amount_option")
@Getter
@Setter
public class AmountOption {
public class AmountOption extends Auditable {
@Id
@Column(name = "amount_option_id")
@@ -2,8 +2,6 @@ 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;
@@ -19,8 +17,9 @@ import lombok.Setter;
@Getter
@Setter
@Entity
@Table(name = "bbps_amount_option_biller_id")
public class AmountOptionByBillerId extends Auditable<String> {
public class AmountOptionByBillerId extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -33,4 +32,4 @@ public class AmountOptionByBillerId extends Auditable<String> {
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name = "amount_option_id_long") // Foreign key field that links to the 'Long' column
private List<AmountOptionDetails> amountOptionDetails; // List of AmountOptionDetails
}
}
@@ -13,7 +13,8 @@ import lombok.Setter;
@Setter
@Entity
@Table(name = "bbps_amount_option_details")
public class AmountOptionDetails {
public class AmountOptionDetails extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -38,4 +39,4 @@ public class AmountOptionDetails {
@Column(name = "user_id")
private String userId;
}
}
@@ -0,0 +1,82 @@
package com.billpaymentservice.bbps.entites;
import java.lang.reflect.Field;
import java.time.LocalDateTime;
import jakarta.persistence.PrePersist;
import jakarta.persistence.PreUpdate;
/**
* Generic JPA entity listener that populates common audit fields on entities.
*
* Behavior:
* - On PrePersist: sets createdAt/creationDate/createdEpochDate if present (only when null),
* and forces isDeleted/deleted to false if those fields exist.
* - On PreUpdate: sets modifiedDate/modifiedEpochDate/updatedAt/updatedOn if present.
*
* This uses reflection so entities don't need to extend a specific base class.
*/
public class AuditListener {
@PrePersist
public void prePersist(Object entity) {
LocalDateTime now = LocalDateTime.now();
setIfNull(entity, "createdAt", now);
setIfNull(entity, "createdOn", now);
setIfNull(entity, "creationDate", now == null ? null : now.toString());
setIfNull(entity, "createdEpochDate", System.currentTimeMillis());
// Ensure isDeleted / deleted exists and is set to false on create
setAlways(entity, "isDeleted", Boolean.FALSE);
}
/*@PreUpdate
public void preUpdate(Object entity) {
LocalDateTime now = LocalDateTime.now();
setIfNull(entity, "modifiedDate", now == null ? null : now.toString());
setIfNull(entity, "modifiedEpochDate", System.currentTimeMillis());
setIfNull(entity, "updatedAt", now);
setIfNull(entity, "updatedOn", now);
}
*/
private void setIfNull(Object entity, String fieldName, Object value) {
try {
Field f = findField(entity.getClass(), fieldName);
if (f == null) return;
boolean accessible = f.canAccess(entity);
f.setAccessible(true);
Object current = f.get(entity);
if (current == null && value != null) {
f.set(entity, value);
}
f.setAccessible(accessible);
} catch (Exception e) {
// ignore reflection failures
}
}
private void setAlways(Object entity, String fieldName, Object value) {
try {
Field f = findField(entity.getClass(), fieldName);
if (f == null) return;
boolean accessible = f.canAccess(entity);
f.setAccessible(true);
f.set(entity, value);
f.setAccessible(accessible);
} catch (Exception e) {
// ignore reflection failures
}
}
private Field findField(Class<?> cls, String name) {
Class<?> cur = cls;
while (cur != null && cur != Object.class) {
try {
return cur.getDeclaredField(name);
} catch (NoSuchFieldException e) {
cur = cur.getSuperclass();
}
}
return null;
}
}
@@ -0,0 +1,41 @@
package com.billpaymentservice.bbps.entites;
import java.time.LocalDateTime;
import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import lombok.Setter;
/**
* Base mapped superclass for audit fields. All JPA entities should extend this to
* get automatic population of createdAt/updatedAt/isDeleted via AuditListener.
*/
@MappedSuperclass
@EntityListeners(AuditListener.class)
@Getter
@Setter
public abstract class Auditable {
@Column(name = "created_at")
private LocalDateTime createdAt;
@Column(name = "updated_at")
private LocalDateTime updatedAt;
@Column(name = "created_on")
private LocalDateTime createdOn;
@Column(name = "updated_on")
private LocalDateTime updatedOn;
@Column(name = "created_epoch_date")
private Long createdEpochDate;
@Column(name = "modified_epoch_date")
private Long modifiedEpochDate;
@Column(name = "is_deleted")
private Boolean isDeleted = Boolean.FALSE;
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -21,7 +19,7 @@ import lombok.Setter;
@Getter
@Setter
@Table(name = "bbps_master_data")
public class BBPSMastersData extends Auditable<String> {
public class BBPSMastersData extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -43,4 +41,4 @@ public class BBPSMastersData extends Auditable<String> {
@Column(name = "user_name")
private String userName;
}
}
@@ -17,7 +17,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@Builder
@Table(name = "bbps_merchant_validation")
public class BBPSMerchantValidation {
public class BBPSMerchantValidation extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -42,5 +42,5 @@ public class BBPSMerchantValidation {
private String txtId;
private boolean is_deleted;
}
// Removed local is_deleted field, now handled by Auditable
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
@@ -18,7 +16,7 @@ import lombok.Setter;
@NoArgsConstructor
@Entity
@Table(name = "bbps_bharat_connect_master")
public class BharatConnectMaster extends Auditable<String> {
public class BharatConnectMaster extends Auditable {
@Id
@Column(name = "org_id", nullable = false, unique = true, length = 50)
@@ -46,4 +44,4 @@ public class BharatConnectMaster extends Auditable<String> {
@Column(name = "is_active")
private boolean isActive=false;
}
}
@@ -14,7 +14,8 @@ import lombok.Setter;
@Setter
@Entity
@Table(name = "bbps_bill_additional_info")
public class BillAdditionalInfo {
public class BillAdditionalInfo extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -28,4 +29,4 @@ public class BillAdditionalInfo {
@JoinColumn(name = "biller_response_id")
private CheckClientBillerData billerResponse;
}
}
@@ -13,7 +13,8 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@Entity
@Table(name = "bbps_bill_initiate")
public class BillInitiate {
public class BillInitiate extends Auditable {
@Id
@Column(name = "req_id")
private String reqId;
@@ -27,4 +28,4 @@ public class BillInitiate {
@Column(name = "client_user_id")
private String clientUserId;
}
}
@@ -23,7 +23,7 @@ import lombok.Setter;
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class BillMaster {
public class BillMaster extends Auditable {
@Id
private String billId; // primary key
@@ -43,10 +43,6 @@ public class BillMaster {
private List<AdditionalInfoBill> additionalInfo;
@OneToMany(mappedBy = "billMaster", cascade = CascadeType.ALL)
private List<CustomerParamBill> customerParams;
private String creationDate;
private String modifiedDate;
private Long createdEpochDate;
private Long modifiedEpochDate;
// getters and setters
}
}
@@ -1,6 +1,5 @@
package com.billpaymentservice.bbps.entites;
import java.time.LocalDateTime;
import java.util.List;
import jakarta.persistence.CascadeType;
@@ -17,7 +16,8 @@ import lombok.Setter;
@Setter
@Entity
@Table(name = "bbps_bill_payment")
public class BillPayment {
public class BillPayment extends Auditable {
@Id
@Column(name = "txn_id")
@@ -53,10 +53,7 @@ public class BillPayment {
@Column(name = "customer_mobile")
private String customerMobNo;
@Column(name = "created_at")
private LocalDateTime createdAt = LocalDateTime.now();
// 🔗 One bill payment has many remitter identities
@OneToMany(mappedBy = "billPayment", cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
private List<RemitterIdentity> remitterIdentities;
}
}
@@ -14,7 +14,8 @@ import lombok.Setter;
@Setter
@Entity
@Table(name = "bbps_bill_tag_list")
public class BillTag {
public class BillTag extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -27,4 +28,4 @@ public class BillTag {
@JoinColumn(name = "biller_response_id")
private CheckClientBillerData billerResponse;
}
}
@@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BillValidation {
public class BillValidation extends Auditable {
@Id
@Column(name = "bill_id", nullable = false, length = 100)
@@ -46,18 +46,6 @@ public class BillValidation {
@Column(name = "plan_info_daos", columnDefinition = "TEXT")
private String planInfoDaos;
@Column(name = "creation_date", length = 50)
private String creationDate;
@Column(name = "modified_date", length = 50)
private String modifiedDate;
@Column(name = "created_epoch_date", length = 50)
private String createdEpochDate;
@Column(name = "modified_epoch_date", length = 50)
private String modifiedEpochDate;
@Column(name = "txn_id")
private String txnId;
@@ -66,4 +54,7 @@ public class BillValidation {
@Column(name = "client_user_id")
private String clientUserId;
}
// Removed local audit fields: creationDate, modifiedDate, createdEpochDate, modifiedEpochDate
// They are now handled by Auditable base class
}
@@ -15,7 +15,7 @@ import lombok.Setter;
@Setter
@Table(name = "bbps_biller_additional_info_payment")
@Entity
public class BillerAdditionalInfoPayment {
public class BillerAdditionalInfoPayment extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; // primary key for the table
@@ -42,4 +42,4 @@ public class BillerAdditionalInfoPayment {
@ManyToOne
@JoinColumn(name = "biller_id", nullable = false)
private BillerDetails biller;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -23,7 +21,7 @@ import lombok.Setter;
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class BillerCategoryIcon extends Auditable<String>{
public class BillerCategoryIcon extends Auditable{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -42,4 +40,4 @@ public class BillerCategoryIcon extends Auditable<String>{
foreignKey = @ForeignKey(name = "fk_icon_biller"))
private BillerCategoryWise biller;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -20,7 +18,7 @@ import lombok.Setter;
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class BillerCategoryWise extends Auditable<String> {
public class BillerCategoryWise extends Auditable {
@Id
@Column(name = "biller_id")
@@ -66,4 +64,4 @@ public class BillerCategoryWise extends Auditable<String> {
@OneToOne(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
private BillerCategoryIcon icon;
}
}
@@ -2,12 +2,12 @@ package com.billpaymentservice.bbps.entites;
import java.util.List;
import com.billpaymentservice.bbps.audit.Auditable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
@@ -21,6 +21,7 @@ import lombok.ToString;
@Getter
@Setter
@Entity
@EntityListeners(AuditListener.class)
@ToString(exclude = {
"billerPaymentModes",
"billerPaymentChannels",
@@ -36,7 +37,7 @@ import lombok.ToString;
@Table(name = "bbps_biller_details")
@JsonIgnoreProperties(ignoreUnknown = true)
public class BillerDetails{
public class BillerDetails extends Auditable {
@Id
@Column(name = "biller_id", length = 14, nullable = false, unique = true)
@@ -160,4 +161,4 @@ public class BillerDetails{
@OneToOne(mappedBy = "biller", cascade = CascadeType.ALL)
private BillerPlanResponseParams billerPlanResponseParams;
}
}
@@ -18,7 +18,8 @@ import lombok.ToString;
@Entity
@ToString
@Table(name = "bbps_biller_plan_response_params")
public class BillerPlanResponseParams {
public class BillerPlanResponseParams extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; // Primary Key
@@ -36,5 +37,4 @@ public class BillerPlanResponseParams {
@OneToOne
@JoinColumn(name = "biller_id", nullable = false)
private BillerDetails biller;
}
}
@@ -14,7 +14,7 @@ import lombok.Setter;
@Table(name = "bbps_biller_response")
@Getter
@Setter
public class BillerResponse {
public class BillerResponse extends Auditable {
@Id
@GeneratedValue
@@ -55,4 +55,4 @@ public class BillerResponse {
private BillMaster billMaster;
// getters and setters
}
}
@@ -21,7 +21,8 @@ import lombok.Setter;
@Setter
@Entity
@Table(name = "bbps_biller_response_params")
public class BillerResponseParams {
public class BillerResponseParams extends Auditable {
@Id
@Column(name = "biller_response_id", nullable = false, unique = true)
@@ -46,4 +47,4 @@ public class BillerResponseParams {
@OneToMany(mappedBy = "billerResponseParams", cascade = CascadeType.ALL, orphanRemoval = true)
private List<AmountOption> amountOptions;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -15,7 +13,7 @@ import lombok.Setter;
@Table(name = "bbps_category_response_list")
@Getter
@Setter
public class CategoryResponseList extends Auditable<String> {
public class CategoryResponseList extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -33,4 +31,4 @@ public class CategoryResponseList extends Auditable<String> {
@Column(name = "user_id")
private String userId;
}
}
@@ -19,7 +19,7 @@ import lombok.Setter;
@Table(name = "bbps_check_client_biller_data")
@Getter
@Setter
public class CheckClientBillerData {
public class CheckClientBillerData extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -65,4 +65,4 @@ public class CheckClientBillerData {
@OneToMany(mappedBy = "billerResponse", cascade = CascadeType.ALL)
private List<BillCustomerParams> customerParams;
}
}
@@ -13,7 +13,7 @@ import lombok.Setter;
@Table(name = "bbps_check_client_status_req_id")
@Getter
@Setter
public class CheckClientStatusReqId {
public class CheckClientStatusReqId extends Auditable {
@Id
@Column(name = "bill_id", length = 200)
@@ -34,18 +34,6 @@ public class CheckClientStatusReqId {
@Column(name = "user_id")
private String userId;
@Column(name = "creation_date")
private String creationDate;
@Column(name = "modified_date")
private String modifiedDate;
@Column(name = "created_epoch_date")
private Long createdEpochDate;
@Column(name = "modified_epoch_date")
private Long modifiedEpochDate;
@Column(name = "req_id")
private String reqId;
@@ -57,4 +45,4 @@ public class CheckClientStatusReqId {
private CheckClientBillerData billerResponse;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -17,7 +15,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CloseComplaint extends Auditable<String> {
public class CloseComplaint extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -104,4 +102,4 @@ public class CloseComplaint extends Auditable<String> {
@Column(name = "system_txn_id")
private String systemTxnId;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -17,7 +15,7 @@ import lombok.Setter;
@Table(name = "bbps_complaint_status")
@Getter
@Setter
public class ComplainStatus extends Auditable<String> {
public class ComplainStatus extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -78,3 +76,4 @@ public class ComplainStatus extends Auditable<String> {
@JoinColumn(name = "complaint_response_id")
private ComplaintResponseEntity complaintResponse;
}
@@ -9,7 +9,7 @@ import lombok.ToString;
@Getter
@Setter
@ToString
public class ComplaintDetails {
public class ComplaintDetails extends Auditable {
@Id
@Column(name = "complaint_id", nullable = false, unique = true)
@@ -68,4 +68,4 @@ public class ComplaintDetails {
@Column(name = "modified_epoch_date")
private Long modifiedEpochDate;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -21,7 +19,7 @@ import lombok.Setter;
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ComplaintHistory extends Auditable<String> {
public class ComplaintHistory extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -2,7 +2,6 @@ package com.billpaymentservice.bbps.entites;
import java.util.List;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
@@ -21,7 +20,8 @@ import lombok.ToString;
@Setter
@ToString
@Table(name = "bbps_complaint_responses")
public class ComplaintResponseEntity extends Auditable<String> {
public class ComplaintResponseEntity extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@@ -85,3 +85,4 @@ public class ComplaintResponseEntity extends Auditable<String> {
private List<ViewAllComplaintTicketStatusDetails> viewAllList;
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -17,7 +15,8 @@ import lombok.Setter;
@Getter
@Setter
@Table(name = "bbps_view_ticket_status")
public class ComplaintStatusDetails extends Auditable<String> {
public class ComplaintStatusDetails extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -15,7 +15,7 @@ import lombok.ToString;
@Getter
@Setter
@ToString
public class ComplaintStatusOptionsMaster {
public class ComplaintStatusOptionsMaster extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -24,7 +24,5 @@ public class ComplaintStatusOptionsMaster {
@Column(name = "status_label_name")
private String statusLabelName;
@Column(name = "is_deleted")
private Boolean isDeleted = false;
}
// Removed local isDeleted field, now handled by Auditable
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -19,7 +17,7 @@ import lombok.Setter;
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ContactMasterData extends Auditable<String> {
public class ContactMasterData extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -36,4 +34,4 @@ public class ContactMasterData extends Auditable<String> {
@Column(name = "user_id")
private String userId;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -17,7 +15,9 @@ import lombok.ToString;
@Entity
@ToString
@Table(name = "bbps_custom_param")
public class CustomParam extends Auditable<String> {
public class CustomParam extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -53,4 +53,4 @@ public class CustomParam extends Auditable<String> {
@Column(name = "user_id")
private String userId;
}
}
@@ -24,7 +24,7 @@ import lombok.ToString;
@Entity
@Table(name = "bbps_customer_param")
@ToString
public class CustomerParam {
public class CustomerParam extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -68,4 +68,4 @@ public class CustomerParam {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "biller_id")
private BillerDetails biller;
}
}
@@ -13,7 +13,8 @@ import lombok.Setter;
@Getter
@Setter
@Table(name = "bbps_customer_param_bill")
public class CustomerParamBill {
public class CustomerParamBill extends Auditable {
@Id
@GeneratedValue
@@ -28,4 +29,4 @@ public class CustomerParamBill {
private BillMaster billMaster;
// getters and setters
}
}
@@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CustomerParamBillValidation {
public class CustomerParamBillValidation extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -30,4 +30,4 @@ public class CustomerParamBillValidation {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "bill_id_fk")
private BillValidation bill;
}
}
@@ -13,7 +13,8 @@ import lombok.Setter;
@Getter
@Setter
@Table(name = "bbps_customer_params")
public class CustomerParamDAO {
public class CustomerParamDAO extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -2,8 +2,6 @@ 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;
@@ -21,7 +19,9 @@ import lombok.Setter;
@Setter
@Entity
@Table(name = "bbps_customer_param_group_by_biller_id")
public class CustomerParamGroupById extends Auditable<String> {
public class CustomerParamGroupById extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -58,4 +58,4 @@ public class CustomerParamGroupById extends Auditable<String> {
@Column(name = "user_id")
private String userId;
}
}
@@ -22,7 +22,8 @@ import lombok.ToString;
@Entity
@ToString
@Table(name = "bbps_customer_param_groups")
public class CustomerParamGroups {
public class CustomerParamGroups extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -37,5 +38,4 @@ public class CustomerParamGroups {
// 🔗 One CustomerParamGroups contains multiple Group objects
@OneToMany(mappedBy = "customerParamGroups", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Group> groups;
}
}
@@ -15,7 +15,8 @@ import lombok.Setter;
@Getter
@Setter
@Table(name = "bbps_customer_params_transaction")
public class CustomerParamTransaction {
public class CustomerParamTransaction extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -29,5 +30,4 @@ public class CustomerParamTransaction {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "txn_id", referencedColumnName = "bank_txn_id")
private TransactionMaster transactionMaster;
}
}
@@ -16,7 +16,8 @@ import lombok.Setter;
@Getter
@Setter
@Table(name = "bbps_device_block_tag")
public class DeviceBlockTag {
public class DeviceBlockTag extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -35,4 +36,4 @@ public class DeviceBlockTag {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "txn_id", referencedColumnName = "bank_txn_id")
private TransactionMaster transactionMaster;
}
}
@@ -13,7 +13,7 @@ import lombok.ToString;
@Entity
@Table(name = "bbps_disposition_details")
@ToString
public class DispositionDetails {
public class DispositionDetails extends Auditable {
@Id
@Column(name = "disposition_id", nullable = false, unique = true)
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -19,7 +17,8 @@ import lombok.Setter;
@NoArgsConstructor
@Entity
@Table(name = "bbps_fetch_bill_validate_response")
public class FetchBillValidate extends Auditable<String> {
public class FetchBillValidate extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -63,10 +62,10 @@ public class FetchBillValidate extends Auditable<String> {
private String modifiedDate;
@Column(name = "created_epoch_date")
private long createdEpochDate;
private Long createdEpochDate;
@Column(name = "modified_epoch_date")
private long modifiedEpochDate;
private Long modifiedEpochDate;
@Column(name = "request_id")
private String requestId;
@@ -74,4 +73,4 @@ public class FetchBillValidate extends Auditable<String> {
@Column(name = "txn_id")
private String txnId;
}
}
@@ -26,7 +26,8 @@ import lombok.Setter;
@Setter
@Entity
@Table(name = "bbps_biller_groups")
public class Group {
public class Group extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -59,4 +60,4 @@ public class Group {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "group_container_id")
private CustomerParamGroups customerParamGroups;
}
}
@@ -15,7 +15,8 @@ import lombok.Setter;
@Setter
@Entity
@Table(name = "bbps_group_params")
public class GroupParam {
public class GroupParam extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -28,4 +29,4 @@ public class GroupParam {
@JoinColumn(name = "group_id")
private CustomerParamGroupById group; // Link to the group this parameter belongs to
}
}
@@ -22,7 +22,8 @@ import lombok.ToString;
@Entity
@ToString
@Table(name = "bbps_interchange_fee")
public class InterchangeFee {
public class InterchangeFee extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -48,4 +49,4 @@ public class InterchangeFee {
@ManyToOne
@JoinColumn(name = "biller_id", nullable = false)
private BillerDetails biller;
}
}
@@ -20,7 +20,8 @@ import lombok.Setter;
@Setter
@Entity
@Table(name = "bbps_interchange_fee_conf")
public class InterchangeFeeConf {
public class InterchangeFeeConf extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -63,4 +64,4 @@ public class InterchangeFeeConf {
@ManyToOne
@JoinColumn(name = "biller_id", nullable = false)
private BillerDetails biller;
}
}
@@ -15,7 +15,7 @@ import lombok.Setter;
@Table(name = "bbps_interchange_fee_detail")
@Getter
@Setter
public class InterchangeFeeDetail {
public class InterchangeFeeDetail extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -43,4 +43,4 @@ public class InterchangeFeeDetail {
@ManyToOne
@JoinColumn(name = "interchange_fee_id", nullable = false)
private InterchangeFee interchangeFee;
}
}
@@ -8,7 +8,6 @@ import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@@ -18,7 +17,7 @@ import lombok.ToString;
@Entity
@ToString
@Table(name = "bbps_payment_channel")
public class PaymentChannel {
public class PaymentChannel extends Auditable {
@Id
@Column(name = "payment_channel_limit_id")
@@ -13,7 +13,8 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@Entity
@Table(name = "bbps_payment_initiate")
public class PaymentInitiate {
public class PaymentInitiate extends Auditable {
@Id
@Column(name = "req_id")
@@ -36,4 +37,4 @@ public class PaymentInitiate {
@Column(name = "user_id")
private String userId;
}
}
@@ -21,7 +21,7 @@ import lombok.ToString;
@Entity
@Table(name = "bbps_biller_payment_modes")
@ToString
public class PaymentMode {
public class PaymentMode extends Auditable {
@Id //
@@ -46,5 +46,4 @@ public class PaymentMode {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "biller_id", nullable = false)
private BillerDetails biller;
}
}
@@ -1,24 +1,25 @@
package com.billpaymentservice.bbps.entites;
import java.time.LocalDateTime;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Getter
@Setter
@Table(name = "bbps_payment_start_record")
public class PaymentStartRecord {
public class PaymentStartRecord extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -50,9 +51,10 @@ public class PaymentStartRecord {
@Column(name = "qr_string", columnDefinition = "TEXT")
private String qrString;
@Column(name = "created_on", nullable = false)
private String createdOn;
// `createdOn` is provided by the base `Auditable` class as a LocalDateTime field,
// so we must not redeclare it here (it caused an incompatible return-type error).
// The Auditable base class already defines `createdOn` of type LocalDateTime.
// New callback-related fields
@Column(name = "callback_status")
private String callbackStatus;
@@ -21,7 +21,7 @@ import lombok.Setter;
@Table(name = "bbps_plan")
@Getter
@Setter
public class Plan {
public class Plan extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -62,4 +62,4 @@ public class Plan {
@JoinColumn(name = "additional_info_id", referencedColumnName = "id")
private AdditionalInfoPlans additionalInfo;
}
}
@@ -15,7 +15,7 @@ import lombok.Setter;
@Table(name = "bbps_plan_category_sub_type")
@Getter
@Setter
public class PlanCategorySubType {
public class PlanCategorySubType extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -27,4 +27,4 @@ public class PlanCategorySubType {
@JoinColumn(name = "plan_id")
private Plan plan;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -19,7 +17,7 @@ import lombok.Setter;
@Table(name = "bbps_plan_response")
@Getter
@Setter
public class PlanResponses extends Auditable<String> {
public class PlanResponses extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -50,4 +48,4 @@ public class PlanResponses extends Auditable<String> {
@Column(name = "user_id")
private String userId;
}
}
@@ -8,7 +8,7 @@ import lombok.Setter;
@Table(name = "bbps_plan_tag")
@Getter
@Setter
public class PlanTag {
public class PlanTag extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -30,4 +30,4 @@ public class PlanTag {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "additional_info_id", referencedColumnName = "id")
private AdditionalInfoPlans additionalInfo;
}
}
@@ -17,7 +17,7 @@ import lombok.Setter;
@Table(name = "bbps_plans_list")
@Getter
@Setter
public class PlansList {
public class PlansList extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -26,4 +26,4 @@ public class PlansList {
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "plansList")
private List<Plan> plans;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -15,7 +13,7 @@ import lombok.Setter;
@Table(name = "bbps_reopen_complaint")
@Getter
@Setter
public class ReOpenComplain extends Auditable<String> {
public class ReOpenComplain extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -92,10 +90,10 @@ public class ReOpenComplain extends Auditable<String> {
private String category;
@Column(name = "created_epoch_date")
private long createdEpochDate;
private Long createdEpochDate;
@Column(name = "modified_epoch_date")
private long modifiedEpochDate;
private Long modifiedEpochDate;
@Column(name = "req_id")
private String reqId;
@@ -103,4 +101,4 @@ public class ReOpenComplain extends Auditable<String> {
@Column(name = "system_txn_id")
private String systemTxnId;
}
}
@@ -16,7 +16,8 @@ import lombok.Setter;
@Setter
@Entity
@Table(name = "bbps_remitter_identity")
public class RemitterIdentity {
public class RemitterIdentity extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -33,4 +34,4 @@ public class RemitterIdentity {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "txn_id")
private BillPayment billPayment;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -17,7 +15,7 @@ import lombok.ToString;
@Entity
@Table(name = "bbps_ticket_disposition_details")
@ToString
public class TicketDispositionDetails extends Auditable<String> {
public class TicketDispositionDetails extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -43,4 +41,4 @@ public class TicketDispositionDetails extends Auditable<String> {
@Column(name = "user_id")
private String userId;
}
}
@@ -24,7 +24,7 @@ import lombok.ToString;
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class TransactionMaster {
public class TransactionMaster extends Auditable {
// 👇 JSON me "txn_id" aayega, ye DB me bank_txn_id column me save hoga
@Id
@@ -166,4 +166,4 @@ public class TransactionMaster {
@Column(name = "modified_epoch_date")
private Long modifiedEpochDate;
}
}
@@ -1,5 +1,5 @@
package com.billpaymentservice.bbps.entites;
public class TxnStatus {
public class TxnStatus extends Auditable {
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -19,7 +17,7 @@ import lombok.Setter;
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class UserEntity extends Auditable<String> {
public class UserEntity extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -1,6 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -16,7 +15,8 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@Entity
@Table(name = "bbps_user_details")
public class UsersDetails extends Auditable<String> {
public class UsersDetails extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -35,4 +35,4 @@ public class UsersDetails extends Auditable<String> {
@Column(name = "user_age")
private String userAge;
}
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -17,7 +15,8 @@ import lombok.Setter;
@Getter
@Setter
@Table(name = "bbps_view_all_complaint_ticket_status")
public class ViewAllComplaintTicketStatusDetails extends Auditable<String> {
public class ViewAllComplaintTicketStatusDetails extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)