diff --git a/src/main/java/com/billpaymentservice/bbps/audit/Auditable.java b/src/main/java/com/billpaymentservice/bbps/audit/Auditable.java deleted file mode 100644 index 2039a63..0000000 --- a/src/main/java/com/billpaymentservice/bbps/audit/Auditable.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.billpaymentservice.bbps.audit; - -import java.io.Serializable; -import java.util.Date; - -import org.springframework.data.annotation.CreatedBy; -import org.springframework.data.annotation.CreatedDate; -import org.springframework.data.annotation.LastModifiedBy; -import org.springframework.data.annotation.LastModifiedDate; - -import jakarta.persistence.Column; -import jakarta.persistence.MappedSuperclass; -import jakarta.persistence.Temporal; -import jakarta.persistence.TemporalType; -import lombok.Data; - -@Data -@MappedSuperclass -public abstract class Auditable implements Serializable { - private static final long serialVersionUID = 1L; - - @CreatedDate - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "create_date_time") - protected Date createDateTime; - - @LastModifiedDate - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "updated_date_time") - protected Date updatedDateTime; - - @LastModifiedBy - @Column(name = "updated_by") - protected U updatedBy; - - @CreatedBy - @Column(name = "create_by") - protected U createdBy; - - @Column(name = "is_deleted") - protected boolean isDeleted = false; -} diff --git a/src/main/java/com/billpaymentservice/bbps/controller/PaymentController.java b/src/main/java/com/billpaymentservice/bbps/controller/PaymentController.java index 6fbe01a..4bcbd62 100644 --- a/src/main/java/com/billpaymentservice/bbps/controller/PaymentController.java +++ b/src/main/java/com/billpaymentservice/bbps/controller/PaymentController.java @@ -45,7 +45,7 @@ public class PaymentController { @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Payment initiated successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) }) @ApiDocCommonResponses public ResponseEntity requestBillFetch( - @Validated @RequestBody BillPaymentRequest billPaymentRequest) { + @RequestBody BillPaymentRequest billPaymentRequest) { ResponseModel response = paymentService.initiatePayment(billPaymentRequest); return ResponseEntity.ok(response); diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/BillPaymentRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/request/BillPaymentRequest.java index d34d13a..bdb5a8d 100644 --- a/src/main/java/com/billpaymentservice/bbps/dto/request/BillPaymentRequest.java +++ b/src/main/java/com/billpaymentservice/bbps/dto/request/BillPaymentRequest.java @@ -11,43 +11,33 @@ import lombok.Setter; @Setter public class BillPaymentRequest extends BaseClass { - @NotBlank(message = "ref id cannot be null or empty") private String refId; - @NotBlank(message = "bill id cannot be null or empty") private String billId; // Change the field to Boolean (wrapper) type to allow @NotNull validation - @NotNull(message = "Amount options cannot be null.") private boolean amountOptions; // Changed to Boolean (wrapper type) - @NotBlank(message = "payment mode cannot be null or empty") private String paymentMode; - @NotBlank(message = "payment information cannot be null or empty") private String paymentInformation; - @NotBlank(message = "biller id cannot be null or empty") private String billerId; - @NotBlank(message = "biller name cannot be null or empty") private String billerName; - @NotBlank(message = "biller category cannot be null or empty") private String billerCategory; private String macAdress; private String customerMobNo; - @NotNull(message = "Transaction amount cannot be null.") private Integer txnAmount; // Changed to @NotNull as it's an Integer (non-nullable) private String paymentRefId; private String clientReqId; - @NotBlank(message = "payment channel cannot be null or empty") private String paymentChannel; private List deviceBlockTags; diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoBill.java b/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoBill.java index a8aa9c2..98408b2 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoBill.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoBill.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoBillValidate.java b/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoBillValidate.java index 6944c27..f23c35b 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoBillValidate.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoBillValidate.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoPlans.java b/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoPlans.java index 0abd649..61f647a 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoPlans.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/AdditionalInfoPlans.java @@ -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 tags; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AgentFundTransfer.java b/src/main/java/com/billpaymentservice/bbps/entites/AgentFundTransfer.java index b6e0bc6..f0210d1 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/AgentFundTransfer.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/AgentFundTransfer.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AgentFundTransferEntity.java b/src/main/java/com/billpaymentservice/bbps/entites/AgentFundTransferEntity.java index 6961f96..b21deed 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/AgentFundTransferEntity.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/AgentFundTransferEntity.java @@ -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; -} - +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AmountOption.java b/src/main/java/com/billpaymentservice/bbps/entites/AmountOption.java index a0f0874..d6b39b5 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/AmountOption.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/AmountOption.java @@ -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") diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionByBillerId.java b/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionByBillerId.java index b3aee72..5e9edce 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionByBillerId.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionByBillerId.java @@ -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 { +public class AmountOptionByBillerId extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -33,4 +32,4 @@ public class AmountOptionByBillerId extends Auditable { @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true) @JoinColumn(name = "amount_option_id_long") // Foreign key field that links to the 'Long' column private List amountOptionDetails; // List of AmountOptionDetails -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionDetails.java index 0da53ca..47fc04b 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionDetails.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/AmountOptionDetails.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/AuditListener.java b/src/main/java/com/billpaymentservice/bbps/entites/AuditListener.java new file mode 100644 index 0000000..707592d --- /dev/null +++ b/src/main/java/com/billpaymentservice/bbps/entites/AuditListener.java @@ -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; + } +} diff --git a/src/main/java/com/billpaymentservice/bbps/entites/Auditable.java b/src/main/java/com/billpaymentservice/bbps/entites/Auditable.java new file mode 100644 index 0000000..9cc1bf2 --- /dev/null +++ b/src/main/java/com/billpaymentservice/bbps/entites/Auditable.java @@ -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; +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BBPSMastersData.java b/src/main/java/com/billpaymentservice/bbps/entites/BBPSMastersData.java index 660c166..95d1be9 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BBPSMastersData.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BBPSMastersData.java @@ -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 { +public class BBPSMastersData extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -43,4 +41,4 @@ public class BBPSMastersData extends Auditable { @Column(name = "user_name") private String userName; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BBPSMerchantValidation.java b/src/main/java/com/billpaymentservice/bbps/entites/BBPSMerchantValidation.java index 103dc23..cae7c57 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BBPSMerchantValidation.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BBPSMerchantValidation.java @@ -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 +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BharatConnectMaster.java b/src/main/java/com/billpaymentservice/bbps/entites/BharatConnectMaster.java index 42c5d2a..d8eaa3c 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BharatConnectMaster.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BharatConnectMaster.java @@ -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 { +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 { @Column(name = "is_active") private boolean isActive=false; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillAdditionalInfo.java b/src/main/java/com/billpaymentservice/bbps/entites/BillAdditionalInfo.java index 6256d73..86aab7b 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillAdditionalInfo.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillAdditionalInfo.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillInitiate.java b/src/main/java/com/billpaymentservice/bbps/entites/BillInitiate.java index c2fd685..36d7e0a 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillInitiate.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillInitiate.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillMaster.java b/src/main/java/com/billpaymentservice/bbps/entites/BillMaster.java index eb2631c..91609e2 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillMaster.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillMaster.java @@ -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 additionalInfo; @OneToMany(mappedBy = "billMaster", cascade = CascadeType.ALL) private List customerParams; - private String creationDate; - private String modifiedDate; - private Long createdEpochDate; - private Long modifiedEpochDate; // getters and setters -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillPayment.java b/src/main/java/com/billpaymentservice/bbps/entites/BillPayment.java index 13015e4..c2417fd 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillPayment.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillPayment.java @@ -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 remitterIdentities; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillTag.java b/src/main/java/com/billpaymentservice/bbps/entites/BillTag.java index 0fa196d..53fd5a0 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillTag.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillTag.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillValidation.java b/src/main/java/com/billpaymentservice/bbps/entites/BillValidation.java index c61b987..fc507c7 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillValidation.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillValidation.java @@ -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 +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerAdditionalInfoPayment.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerAdditionalInfoPayment.java index 963deb7..fc00ad3 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillerAdditionalInfoPayment.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerAdditionalInfoPayment.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryIcon.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryIcon.java index 0209eed..190953a 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryIcon.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryIcon.java @@ -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{ +public class BillerCategoryIcon extends Auditable{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -42,4 +40,4 @@ public class BillerCategoryIcon extends Auditable{ foreignKey = @ForeignKey(name = "fk_icon_biller")) private BillerCategoryWise biller; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryWise.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryWise.java index 8b06027..591caf6 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryWise.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerCategoryWise.java @@ -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 { +public class BillerCategoryWise extends Auditable { @Id @Column(name = "biller_id") @@ -66,4 +64,4 @@ public class BillerCategoryWise extends Auditable { @OneToOne(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) private BillerCategoryIcon icon; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java index a5f00ec..dc06759 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerPlanResponseParams.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerPlanResponseParams.java index be607f9..d1d450b 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillerPlanResponseParams.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerPlanResponseParams.java @@ -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; -} - +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerResponse.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerResponse.java index 49f84e7..373d6c3 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillerResponse.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerResponse.java @@ -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 -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerResponseParams.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerResponseParams.java index cc2bcfd..b42d5f6 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillerResponseParams.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerResponseParams.java @@ -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 amountOptions; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CategoryResponseList.java b/src/main/java/com/billpaymentservice/bbps/entites/CategoryResponseList.java index 7fc1c6c..1dabeea 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CategoryResponseList.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CategoryResponseList.java @@ -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 { +public class CategoryResponseList extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -33,4 +31,4 @@ public class CategoryResponseList extends Auditable { @Column(name = "user_id") private String userId; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CheckClientBillerData.java b/src/main/java/com/billpaymentservice/bbps/entites/CheckClientBillerData.java index e193d33..de4b9ca 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CheckClientBillerData.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CheckClientBillerData.java @@ -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 customerParams; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CheckClientStatusReqId.java b/src/main/java/com/billpaymentservice/bbps/entites/CheckClientStatusReqId.java index f346b42..b1b1d2b 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CheckClientStatusReqId.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CheckClientStatusReqId.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CloseComplaint.java b/src/main/java/com/billpaymentservice/bbps/entites/CloseComplaint.java index 786f303..3782b52 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CloseComplaint.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CloseComplaint.java @@ -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 { +public class CloseComplaint extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -104,4 +102,4 @@ public class CloseComplaint extends Auditable { @Column(name = "system_txn_id") private String systemTxnId; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/ComplainStatus.java b/src/main/java/com/billpaymentservice/bbps/entites/ComplainStatus.java index a207d67..076cecc 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/ComplainStatus.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/ComplainStatus.java @@ -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 { +public class ComplainStatus extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -78,3 +76,4 @@ public class ComplainStatus extends Auditable { @JoinColumn(name = "complaint_response_id") private ComplaintResponseEntity complaintResponse; } + diff --git a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintDetails.java index d2bc669..0319dd8 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintDetails.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintDetails.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintHistory.java b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintHistory.java index 9face21..7d95581 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintHistory.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintHistory.java @@ -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 { +public class ComplaintHistory extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintResponseEntity.java b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintResponseEntity.java index 2d1cd1f..57f4f33 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintResponseEntity.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintResponseEntity.java @@ -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 { + +public class ComplaintResponseEntity extends Auditable { @Id @GeneratedValue(strategy = GenerationType.AUTO) @@ -85,3 +85,4 @@ public class ComplaintResponseEntity extends Auditable { private List viewAllList; } + diff --git a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusDetails.java index 8e61e4f..038e57f 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusDetails.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusDetails.java @@ -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 { + +public class ComplaintStatusDetails extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusOptionsMaster.java b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusOptionsMaster.java index bb878b7..7ab4fc8 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusOptionsMaster.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusOptionsMaster.java @@ -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 +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/ContactMasterData.java b/src/main/java/com/billpaymentservice/bbps/entites/ContactMasterData.java index 1b9cf6d..771d0f8 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/ContactMasterData.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/ContactMasterData.java @@ -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 { +public class ContactMasterData extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -36,4 +34,4 @@ public class ContactMasterData extends Auditable { @Column(name = "user_id") private String userId; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CustomParam.java b/src/main/java/com/billpaymentservice/bbps/entites/CustomParam.java index 94d7b94..0fcad64 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CustomParam.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CustomParam.java @@ -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 { + +public class CustomParam extends Auditable { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -53,4 +53,4 @@ public class CustomParam extends Auditable { @Column(name = "user_id") private String userId; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParam.java b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParam.java index 11af4e3..19a12fb 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParam.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParam.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamBill.java b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamBill.java index ef629f9..92b90ef 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamBill.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamBill.java @@ -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 -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamBillValidation.java b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamBillValidation.java index b88a1f7..3099134 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamBillValidation.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamBillValidation.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamDAO.java b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamDAO.java index 7b1fdb2..c784186 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamDAO.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamDAO.java @@ -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) diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroupById.java b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroupById.java index 78a067c..5abad12 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroupById.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroupById.java @@ -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 { + + +public class CustomerParamGroupById extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -58,4 +58,4 @@ public class CustomerParamGroupById extends Auditable { @Column(name = "user_id") private String userId; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroups.java b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroups.java index 80988e5..e54f569 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroups.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamGroups.java @@ -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 groups; -} - +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamTransaction.java b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamTransaction.java index 7adb44a..b97c11e 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamTransaction.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/CustomerParamTransaction.java @@ -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; -} - +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/DeviceBlockTag.java b/src/main/java/com/billpaymentservice/bbps/entites/DeviceBlockTag.java index ac82bec..c2a6465 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/DeviceBlockTag.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/DeviceBlockTag.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/DispositionDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/DispositionDetails.java index 03d2a6b..e963933 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/DispositionDetails.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/DispositionDetails.java @@ -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) diff --git a/src/main/java/com/billpaymentservice/bbps/entites/FetchBillValidate.java b/src/main/java/com/billpaymentservice/bbps/entites/FetchBillValidate.java index 09600c7..6b18761 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/FetchBillValidate.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/FetchBillValidate.java @@ -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 { + +public class FetchBillValidate extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -63,10 +62,10 @@ public class FetchBillValidate extends Auditable { 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 { @Column(name = "txn_id") private String txnId; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/Group.java b/src/main/java/com/billpaymentservice/bbps/entites/Group.java index 685de39..38847c5 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/Group.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/Group.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/GroupParam.java b/src/main/java/com/billpaymentservice/bbps/entites/GroupParam.java index 967dd45..73f6791 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/GroupParam.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/GroupParam.java @@ -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 -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/InboundTraceLog.java b/src/main/java/com/billpaymentservice/bbps/entites/InboundTraceLog.java index 15a1b3c..6f23804 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/InboundTraceLog.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/InboundTraceLog.java @@ -7,6 +7,7 @@ import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; +import jakarta.persistence.Table; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @@ -14,6 +15,7 @@ import lombok.ToString; @Entity @Getter @Setter @NoArgsConstructor @ToString +@Table(name = "bbps_inbound_trace_log") public class InboundTraceLog { @Id diff --git a/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFee.java b/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFee.java index 3792599..e300206 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFee.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFee.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFeeConf.java b/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFeeConf.java index 55ffab2..52f58f1 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFeeConf.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFeeConf.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFeeDetail.java b/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFeeDetail.java index b01b4cc..b9ad605 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFeeDetail.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/InterchangeFeeDetail.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/OutboundTraceLog.java b/src/main/java/com/billpaymentservice/bbps/entites/OutboundTraceLog.java index 06a2088..3a34043 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/OutboundTraceLog.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/OutboundTraceLog.java @@ -7,6 +7,7 @@ import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; +import jakarta.persistence.Table; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @@ -14,6 +15,7 @@ import lombok.ToString; @Entity @Getter @Setter @NoArgsConstructor @ToString +@Table(name = "bbps_outbound_trace_log") public class OutboundTraceLog { @Id diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PaymentChannel.java b/src/main/java/com/billpaymentservice/bbps/entites/PaymentChannel.java index 5177528..21d4e40 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/PaymentChannel.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/PaymentChannel.java @@ -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") diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PaymentInitiate.java b/src/main/java/com/billpaymentservice/bbps/entites/PaymentInitiate.java index bf9b48d..0c0135c 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/PaymentInitiate.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/PaymentInitiate.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PaymentMode.java b/src/main/java/com/billpaymentservice/bbps/entites/PaymentMode.java index 9542486..c8daa26 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/PaymentMode.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/PaymentMode.java @@ -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; -} - +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PaymentStartRecord.java b/src/main/java/com/billpaymentservice/bbps/entites/PaymentStartRecord.java index dee93d3..6649448 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/PaymentStartRecord.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/PaymentStartRecord.java @@ -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; diff --git a/src/main/java/com/billpaymentservice/bbps/entites/Plan.java b/src/main/java/com/billpaymentservice/bbps/entites/Plan.java index 9223b76..5633a8c 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/Plan.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/Plan.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PlanCategorySubType.java b/src/main/java/com/billpaymentservice/bbps/entites/PlanCategorySubType.java index 16c94a3..c2884ae 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/PlanCategorySubType.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/PlanCategorySubType.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PlanResponses.java b/src/main/java/com/billpaymentservice/bbps/entites/PlanResponses.java index b014df1..17fdf8c 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/PlanResponses.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/PlanResponses.java @@ -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 { +public class PlanResponses extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -50,4 +48,4 @@ public class PlanResponses extends Auditable { @Column(name = "user_id") private String userId; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PlanTag.java b/src/main/java/com/billpaymentservice/bbps/entites/PlanTag.java index bbf7f10..be88c31 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/PlanTag.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/PlanTag.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/PlansList.java b/src/main/java/com/billpaymentservice/bbps/entites/PlansList.java index a222f11..32bdc57 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/PlansList.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/PlansList.java @@ -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 plans; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/ReOpenComplain.java b/src/main/java/com/billpaymentservice/bbps/entites/ReOpenComplain.java index 369c337..968d126 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/ReOpenComplain.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/ReOpenComplain.java @@ -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 { +public class ReOpenComplain extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -92,10 +90,10 @@ public class ReOpenComplain extends Auditable { 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 { @Column(name = "system_txn_id") private String systemTxnId; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/RemitterIdentity.java b/src/main/java/com/billpaymentservice/bbps/entites/RemitterIdentity.java index b23bb93..66a6c94 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/RemitterIdentity.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/RemitterIdentity.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/TicketDispositionDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/TicketDispositionDetails.java index 46dcc61..541658b 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/TicketDispositionDetails.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/TicketDispositionDetails.java @@ -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 { +public class TicketDispositionDetails extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -43,4 +41,4 @@ public class TicketDispositionDetails extends Auditable { @Column(name = "user_id") private String userId; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/TransactionMaster.java b/src/main/java/com/billpaymentservice/bbps/entites/TransactionMaster.java index eb9a0c2..b4249d2 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/TransactionMaster.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/TransactionMaster.java @@ -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; -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/TxnStatus.java b/src/main/java/com/billpaymentservice/bbps/entites/TxnStatus.java index f085fe1..329c759 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/TxnStatus.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/TxnStatus.java @@ -1,5 +1,5 @@ package com.billpaymentservice.bbps.entites; -public class TxnStatus { +public class TxnStatus extends Auditable { -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/entites/UserEntity.java b/src/main/java/com/billpaymentservice/bbps/entites/UserEntity.java index 7d157ed..a6c6295 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/UserEntity.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/UserEntity.java @@ -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 { +public class UserEntity extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/src/main/java/com/billpaymentservice/bbps/entites/ViewAllComplaintTicketStatusDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/ViewAllComplaintTicketStatusDetails.java index cfb0248..efb0e59 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/ViewAllComplaintTicketStatusDetails.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/ViewAllComplaintTicketStatusDetails.java @@ -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 { + +public class ViewAllComplaintTicketStatusDetails extends Auditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/src/main/java/com/billpaymentservice/bbps/exception/GlobalExceptionHandler.java b/src/main/java/com/billpaymentservice/bbps/exception/GlobalExceptionHandler.java index 49330b4..6fac62d 100644 --- a/src/main/java/com/billpaymentservice/bbps/exception/GlobalExceptionHandler.java +++ b/src/main/java/com/billpaymentservice/bbps/exception/GlobalExceptionHandler.java @@ -6,79 +6,181 @@ import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.*; +import org.springframework.http.converter.HttpMessageNotReadableException; import org.springframework.validation.FieldError; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.*; +import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.NoHandlerFoundException; import com.billpaymentservice.bbps.dto.ResponseModel; +import jakarta.servlet.http.HttpServletRequest; + @ControllerAdvice public class GlobalExceptionHandler { private static final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class); - - - @ExceptionHandler(MethodArgumentNotValidException.class) - public ResponseEntity> handleValidation(MethodArgumentNotValidException ex) { - List> fieldErrors = ex.getBindingResult().getFieldErrors() - .stream() - .map(fe -> Map.of("field", fe.getField(), "message", fe.getDefaultMessage())) - .collect(Collectors.toList()); - logger.warn("Validation failed: {}", fieldErrors); - ResponseModel>> resp = new ResponseModel<>( - "Validation failed for request", - "FAILED", - HttpStatus.BAD_REQUEST.value(), - null + /** + * 🔥 Common logger formatter for all exceptions + */ + private String buildErrorContext(Exception ex, HttpServletRequest request, HandlerMethod handlerMethod) { + + // API endpoint + String endpoint = (request != null) + ? request.getMethod() + " " + request.getRequestURI() + : "unknown"; + + // Controller method + String controllerMethod = (handlerMethod != null) + ? handlerMethod.getBeanType().getSimpleName() + "." + handlerMethod.getMethod().getName() + : "NoControllerMethodMatched"; + + // Root cause (actual throw point) + StackTraceElement root = ex.getStackTrace()[0]; + String rootCause = root.getClassName() + "." + root.getMethodName() + "():" + root.getLineNumber(); + + return String.format( + "API: %s | Controller: %s | Thrown From: %s | Exception: %s", + endpoint, + controllerMethod, + rootCause, + ex.getClass().getSimpleName() ); - // put validation errors into data or duplicate field in ResponseModel as required - resp.setData(fieldErrors); + } + + // ------------------------- VALIDATION EXCEPTION ------------------------ + @ExceptionHandler(MethodArgumentNotValidException.class) + public ResponseEntity> handleValidation( + MethodArgumentNotValidException ex, + HttpServletRequest request, + HandlerMethod handlerMethod) { + + String context = buildErrorContext(ex, request, handlerMethod); + logger.warn("ValidationException → {}", context); + + List> fieldErrors = ex.getBindingResult() + .getFieldErrors() + .stream() + .map(fe -> Map.of("field", fe.getField(), "message", fe.getDefaultMessage())) + .collect(Collectors.toList()); + + ResponseModel>> resp = new ResponseModel<>( + "Validation failed", + "FAILED", + HttpStatus.BAD_REQUEST.value(), + fieldErrors + ); + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(resp); } - + + // ------------------------- MALFORMED/INVALID JSON ------------------------ + @ExceptionHandler(HttpMessageNotReadableException.class) + public ResponseEntity> handleInvalidJson( + HttpMessageNotReadableException ex, + HttpServletRequest request, + HandlerMethod handlerMethod) { + + String endpoint = (request != null) ? request.getMethod() + " " + request.getRequestURI() : "unknown"; + // prefer the root Jackson message if present + String rootMsg = ex.getMostSpecificCause() != null ? ex.getMostSpecificCause().getMessage() : ex.getMessage(); + String shortMsg = (rootMsg != null && rootMsg.length() > 200) ? rootMsg.substring(0, 200) + "..." : rootMsg; + + logger.warn("Invalid JSON received for endpoint {}: {}", endpoint, shortMsg); + + Map data = Map.of( + "exception", ex.getClass().getName(), + "message", shortMsg + ); + + ResponseModel resp = new ResponseModel<>( + "[" + endpoint + "] Invalid JSON received", + "FAILED", + HttpStatus.BAD_REQUEST.value(), + data + ); + + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(resp); + } + + // ------------------------- NO HANDLER (404 NOT FOUND) ------------------------ @ExceptionHandler(NoHandlerFoundException.class) public ResponseEntity> handleNotFound(NoHandlerFoundException ex) { - logger.warn("Endpoint not found: {}", ex.getRequestURL()); + + logger.warn("404 Not Found → {}", ex.getRequestURL()); + ResponseModel resp = new ResponseModel<>( - "Endpoint not found: " + ex.getRequestURL(), - "FAILED", - HttpStatus.NOT_FOUND.value(), - null + "Endpoint not found: " + ex.getRequestURL(), + "FAILED", + HttpStatus.NOT_FOUND.value(), + null ); + return ResponseEntity.status(HttpStatus.NOT_FOUND).body(resp); } + // ------------------------- CUSTOM APP EXCEPTION ------------------------ @ExceptionHandler(AppException.class) - public ResponseEntity> handleAppException(AppException ex) { - logger.warn("AppException: status={}, message={}", ex.getStatus(), ex.getMessage()); - ResponseModel resp = new ResponseModel<>(ex.getMessage(), ex.getStatus(), ex.getStatusCode(), ex.getData()); + public ResponseEntity> handleAppException( + AppException ex, + HttpServletRequest request, + HandlerMethod handlerMethod) { + + String context = buildErrorContext(ex, request, handlerMethod); + logger.warn("AppException → {}", context); + + ResponseModel resp = new ResponseModel<>( + ex.getMessage(), + ex.getStatus(), + ex.getStatusCode(), + ex.getData() + ); + return ResponseEntity.status(HttpStatus.valueOf(ex.getStatusCode())).body(resp); } - + + // ------------------------- CUSTOMException ------------------------ @ExceptionHandler(CustomException.class) - public ResponseEntity> handleCustomException(CustomException ex) { - logger.warn("CustomException: {}", ex.getMessage()); - ResponseModel resp = new ResponseModel<>( - ex.getMessage(), - "FAILED", - HttpStatus.BAD_REQUEST.value(), - null - ); - return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(resp); + public ResponseEntity> handleCustomException( + CustomException ex, + HttpServletRequest request, + HandlerMethod handlerMethod) { + + String context = buildErrorContext(ex, request, handlerMethod); + logger.warn("CustomException → {}", context); + + // Use the ResponseModel carried by CustomException so callers get the original status/code/data + ResponseModel resp = ex.getResponseModel(); + + HttpStatus httpStatus = HttpStatus.BAD_REQUEST; + try { + httpStatus = HttpStatus.valueOf(resp.getStatusCode()); + } catch (Exception e) { + // fallback + } + + return ResponseEntity.status(httpStatus).body(resp); } - + // ------------------------- GENERIC EXCEPTION ------------------------ @ExceptionHandler(Exception.class) - public ResponseEntity> handleAll(Exception ex) { - logger.error("Unhandled exception", ex); + public ResponseEntity> handleAll( + Exception ex, + HttpServletRequest request, + HandlerMethod handlerMethod) { + + String context = buildErrorContext(ex, request, handlerMethod); + logger.error("UnhandledException → {}", context, ex); + ResponseModel response = new ResponseModel<>( - "Service temporarily unavailable. Please try again later.", - "FAILED", - HttpStatus.INTERNAL_SERVER_ERROR.value(), - null + "Internal Server Error", + "FAILED", + HttpStatus.INTERNAL_SERVER_ERROR.value(), + null ); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response); } -} +} \ No newline at end of file diff --git a/src/main/java/com/billpaymentservice/bbps/repository/MerchantRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/MerchantRepository.java index 9e749f2..cd94d57 100644 --- a/src/main/java/com/billpaymentservice/bbps/repository/MerchantRepository.java +++ b/src/main/java/com/billpaymentservice/bbps/repository/MerchantRepository.java @@ -3,6 +3,7 @@ package com.billpaymentservice.bbps.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; + import org.springframework.stereotype.Repository; import com.billpaymentservice.bbps.entites.BBPSMerchantValidation; @@ -17,3 +18,5 @@ public interface MerchantRepository extends JpaRepository sendOtp(LoginRequest request) { - try { - OtpSendResponse resp = otpClient.sendOtp(request.getMobile()); - if (resp == null) { - return ResponseModel.builder().message("OTP send service returned null").status("Failure") - .statusCode(500).data(null).build(); - } - String status = resp.isSuccess() ? "Success" : "Failure"; - int code = resp.isSuccess() ? 200 : 400; - return ResponseModel.builder().message(resp.getMessage()).status(status).statusCode(code).data(resp) - .build(); - } catch (Exception ex) { - LOGGER.error("Error in sendOtp: {}", ex.getMessage(), ex); - return ResponseModel.builder().message("An unexpected error occurred while sending OTP").status("Failure") - .statusCode(500).data(null).build(); + // validate minimal inputs + if (request == null || request.getMobile() == null || request.getMobile().isBlank()) { + throw new CustomException("Mobile number is required", "FAILED", 400, "missing mobile"); } + + // Delegate attempts to helper — it will throw CustomException on unrecoverable issues + OtpSendResponse resp = attemptSendOtpWithRetry(request.getMobile(), 1); + + // If the downstream returned a response indicating failure, return that as a ResponseModel + String status = resp.isSuccess() ? "Success" : "Failure"; + int code = resp.isSuccess() ? 200 : 400; + return ResponseModel.builder().message(resp.getMessage()).status(status).statusCode(code).data(resp).build(); } @Override @@ -116,6 +113,40 @@ public class AuthServiceImpl implements AuthService { } } + /** + * Helper that attempts to send OTP and retries up to `retryCount` times on null/unsuccessful responses. + * Throws CustomException when the OTP service returns null after retries or when unexpected errors occur. + */ + private OtpSendResponse attemptSendOtpWithRetry(String mobile, int retryCount) { + int attempts = 0; + OtpSendResponse resp = null; + while (attempts <= retryCount) { + attempts++; + try { + LOGGER.info("Attempt #{} to send OTP to {}", attempts, mobile); + resp = otpClient.sendOtp(mobile); + if (resp != null && resp.isSuccess()) { + LOGGER.info("OTP send succeeded on attempt #{} for {}", attempts, mobile); + return resp; + } + // If response is non-null but indicates failure, we still may not want to retry for logical errors + if (resp != null && !resp.isSuccess()) { + LOGGER.warn("OTP service responded with failure on attempt #{} for {}: {}", attempts, mobile, resp.getMessage()); + // Do not retry for application-level failures (invalid number etc.) + return resp; + } + } catch (Exception ex) { + LOGGER.error("Exception while sending OTP on attempt #{} for {}: {}", attempts, mobile, ex.getMessage(), ex); + // continue to retry if attempts remain + } + // loop continues to retry if attempts <= retryCount + } + + // After retries, if resp is null (no response received), treat as unrecoverable and let global handler handle it via exception + LOGGER.error("OTP service returned null after {} attempts for {}", attempts - 1, mobile); + throw new CustomException("OTP send service returned null", "FAILED", 500, "OtpClient returned null after retries"); + } + @Override @Transactional public ResponseModel registerUser(RegisterRequest request) { @@ -167,23 +198,23 @@ public class AuthServiceImpl implements AuthService { @Override public ResponseModel authenticateUser(LoginRequest loginRequest) { // LOGGER.info("Processing login for Request: {}", loginRequest); -// +// // try { // String mobileNo = loginRequest.getMobile(); -// +// // Optional byMobileNo = userRepo.findByUserMobNo(mobileNo); -// +// // if (byMobileNo.isPresent()) { // UsersDetails user = (UsersDetails) byMobileNo.get(); // String token = jwtUtil.generateToken(user.getUserMobNo()); -// +// // LOGGER.info("Generated JWT token for mobileNo: " + mobileNo); -// +// // Object userDetailsDTO = null; -// +// // if (user != null) { // userDetailsDTO = UserDetailsDTO.builder().id(user.getId()).userEmailId(user.getUserEmailId()) -// .userMobNo(user.getUserMobNo()).userName(user.getUserName()).build(); +// .userMobNo(user.getUserMobNo()).userName(user.getUserName()).build(); // } // AuthResponses authResp = new AuthResponses(token, "Success", "Login Done", 200, userDetailsDTO); // return ResponseModel.builder().message("Login Done").status("Success").statusCode(200).data(authResp) @@ -194,7 +225,7 @@ public class AuthServiceImpl implements AuthService { // .data(authResp).build(); // } // -// +// // } catch (Exception ex) { // LOGGER.error("Error occurred during login for mobile no: {} Exception: {}", loginRequest.getMobile(), // ex.getMessage(), ex); @@ -208,4 +239,4 @@ public class AuthServiceImpl implements AuthService { public UserEntity findByMobile(String mobile) { return userRepository.findByMobile(mobile).orElse(null); } -} \ No newline at end of file +} diff --git a/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java b/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java index 21afef3..b32d7d7 100644 --- a/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java +++ b/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java @@ -111,7 +111,6 @@ public class MasterDataServiceImpl implements MasterDataService { @Override public ResponseModel getMasterData(MasterRequest masterRequest) { - String apiName = BBPSConstant.API_GET_MASTER_DATA; String requestId = masterRequest.getReqId(); String mid = masterRequest.getMid(); @@ -218,7 +217,7 @@ public class MasterDataServiceImpl implements MasterDataService { mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT); BillerDetails entity = mapper.map(responseWrapper.getBillerDAO(), BillerDetails.class); EntityRelationshipUtil.linkBillerRelationships(entity);// linking nesting entity foreign key - // mapperHelper.saveOrUpdateBillerData(entity); + mapperHelper.saveOrUpdateBillerData(entity); ResponseModel responseModel = new ResponseModel(generalResp.getMessage(), generalResp.getStatus(), Integer.parseInt(generalResp.getStatusCode()), responseWrapper); @@ -886,7 +885,7 @@ public class MasterDataServiceImpl implements MasterDataService { LOGGER.info("[{}] END | reqId={} | status={}", apiName, requestId, generalResp.getStatus()); return responseModel; } catch (JsonProcessingException e) { - LOGGER.error("Error parsing responseData JSON: {}", e.getMessage()); + LOGGER.error("Error parsing responseData JSON: {} :: class :: method ", e.getMessage()); helper.updateInboundLogFailure(inboundLog, e.getMessage(), BBPSConstant.JSON_ERROR); throw new CustomException("Invalid JSON received from API"); } diff --git a/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentServiceImpl.java b/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentServiceImpl.java index 6b016ab..d195103 100644 --- a/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentServiceImpl.java +++ b/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentServiceImpl.java @@ -90,11 +90,14 @@ public class PaymentServiceImpl implements PaymentService { @Override public ResponseModel initiatePayment(BillPaymentRequest billPaymentRequest) { String apiName = BBPSConstant.API_INITIATE_PAYMENT; + LOGGER.info("[{}] START | reqId={} | mid={}", apiName, billPaymentRequest.getReqId(), + billPaymentRequest.getMid()); String txnId = helper.generateTxnId(15); String requestId = billPaymentRequest.getReqId(); String userId = billPaymentRequest.getClientReqId(); String url = paymentUrl + BBPSConstant.PAYMENT_URL; billPaymentRequest.setClientReqId(txnId); + LOGGER.info("Initiating payment for reqId={} and txnId={} and userId={}", requestId, txnId, userId); BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId(BBPSConstant.ORG_ID); @@ -135,9 +138,15 @@ public class PaymentServiceImpl implements PaymentService { LOGGER.warn("Invalid response structure received for txnId={}", txnId); throw new CustomException(BBPSConstant.INVALID_STRUCTURE); } - BillPaymentResponse billPaymentResponse = objectMapper.convertValue(dataMap, BillPaymentResponse.class); + GeneralResp generalResponse = billPaymentResponse.getGenericResponse(); + LOGGER.info("genric Response" + generalResponse); + if(generalResponse.getStatus().equalsIgnoreCase("Failed")) { + throw new CustomException(generalResponse.getMessage(), generalResponse.getStatus(), + Integer.parseInt(generalResponse.getStatusCode()), generalResponse.getRemarks()); + } + BillPayment entity = modelMapper.map(billPaymentResponse, BillPayment.class); paymentRepository.save(entity); diff --git a/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentStartServiceImpl.java b/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentStartServiceImpl.java index 164d4e5..d36004d 100644 --- a/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentStartServiceImpl.java +++ b/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentStartServiceImpl.java @@ -303,7 +303,7 @@ public class PaymentStartServiceImpl implements PaymentStartService { rd.setAmount(parsedAmount != null && !parsedAmount.isEmpty() ? parsedAmount : "0.00"); rd.setMid(parsedMid); rd.setOrderNo(orderNo); - rd.setQrString("NO_QR"); + rd.setQrString("HTML_RESPONSE"); rd.setCreatedOn(LocalDateTime.now().toString()); apiResp.setResponseData(rd); diff --git a/src/main/java/com/billpaymentservice/bbps/util/BillerMapperHelper.java b/src/main/java/com/billpaymentservice/bbps/util/BillerMapperHelper.java index bd69a80..4016a9c 100644 --- a/src/main/java/com/billpaymentservice/bbps/util/BillerMapperHelper.java +++ b/src/main/java/com/billpaymentservice/bbps/util/BillerMapperHelper.java @@ -214,7 +214,6 @@ public class BillerMapperHelper { biller.setPlanMDMRequirement(dto.getPlanMDMRequirement()); biller.setAdhocBiller(dto.getAdhocBiller()); biller.setPaymentAmountExactness(dto.getPaymentAmountExactness()); - biller.setCreateDateTime(new Date()); biller.setRequestId(requestId); biller.setTxnId(txnId); biller.setUserId(userId); @@ -279,7 +278,6 @@ public class BillerMapperHelper { groupEntity.setRequestId(requestId); groupEntity.setTxnId(txnId); groupEntity.setUserId(userId); - groupEntity.setCreateDateTime(new Date()); // Save group parameters (if any) if (groupDTO.getParams() != null && !groupDTO.getParams().isEmpty()) { List groupParams = new ArrayList<>(); @@ -367,7 +365,6 @@ public class BillerMapperHelper { List amountOptionDetailsList = mapAmountOptionDTOToEntity( responseWrapper.getAmountOptionDAOS(), requestId, txnId, userId); entity.setAmountOptionDetails(amountOptionDetailsList); - entity.setCreateDateTime(new Date()); amountOptionByBillerIdRepository.save(entity); // Saves the entity and cascades to AmountOptionDetails @@ -416,7 +413,6 @@ public class BillerMapperHelper { response.setTotalPages(planResponse.getTotalPages()); response.setTxnId(txnId); response.setUserId(userId); - response.setCreateDateTime(new Date()); PlansList plansList = new PlansList(); List planEntities = new ArrayList<>(); @@ -489,7 +485,6 @@ public class BillerMapperHelper { category.setCategoryRespList(item); category.setRequestId(txnId); category.setRequestId(requestId); - category.setCreateDateTime(new Date()); category.setUserId(userId); categoryResponseListRepository.save(category); savedCount++; @@ -536,7 +531,6 @@ public class BillerMapperHelper { entity.setNpciTicketType(dto.getNpciTicketType()); entity.setNpciTicketStatus(dto.getNpciTicketStatus()); entity.setCreatedTime(dto.getCreatedTime()); - entity.setCreateDateTime(new Date()); entity.setUserId(userId); try { @@ -567,7 +561,6 @@ public class BillerMapperHelper { entity.setHistoryStatus(dto.getHistoryStatus()); entity.setReqId(reqId); entity.setTxnId(txnId); - entity.setCreateDateTime(new Date()); entity.setUserId(userId); complaintHistoryRepository.save(entity); @@ -683,7 +676,6 @@ public class BillerMapperHelper { entity.setTotalElements(String.valueOf(responseWrapper.getTotalElements())); entity.setPage(String.valueOf(responseWrapper.getPage())); entity.setPageSize(String.valueOf(responseWrapper.getPageSize())); - entity.setCreateDateTime(new Date()); entity.setUserId(userId); } @@ -726,8 +718,11 @@ public class BillerMapperHelper { parent.setStatus(responseWrapper.getStatus()); parent.setActionType(responseWrapper.getActionType()); parent.setUserId(responseWrapper.getUserId()); - parent.setCreationDate(responseWrapper.getCreationDate()); - parent.setModifiedDate(responseWrapper.getModifiedDate()); + // Map incoming DTO date strings into Auditable LocalDateTime fields + LocalDateTime parentCreatedOn = parseToLocalDateTime(responseWrapper.getCreationDate()); + if (parentCreatedOn != null) parent.setCreatedOn(parentCreatedOn); + LocalDateTime parentUpdatedOn = parseToLocalDateTime(responseWrapper.getModifiedDate()); + if (parentUpdatedOn != null) parent.setUpdatedOn(parentUpdatedOn); parent.setCreatedEpochDate(responseWrapper.getCreatedEpochDate()); parent.setModifiedEpochDate(responseWrapper.getModifiedEpochDate()); parent.setReqId(reqId); @@ -828,7 +823,6 @@ public class BillerMapperHelper { entity.setDispositionCode(dto.getDispositionCode()); // Set current datetime - entity.setCreateDateTime(new Date()); entity.setTxnId(txnId); entity.setReqId(requestId); entity.setUserId(userId); @@ -862,7 +856,6 @@ public class BillerMapperHelper { entity.setPageSize(String.valueOf(responseWrapper.getPageSize())); entity.setTotalPages(String.valueOf(responseWrapper.getTotalPages())); entity.setTotalElements(String.valueOf(responseWrapper.getTotalElements())); - entity.setCreateDateTime(new Date()); entity.setUserId(userId); } @@ -887,7 +880,6 @@ public class BillerMapperHelper { entity.setReqId(requestId); entity.setTxnId(txnID); entity.setUserId(userId); - entity.setCreateDateTime(new Date()); return entity; }).collect(Collectors.toList()); @@ -926,7 +918,7 @@ public class BillerMapperHelper { billMaster.setUserId(userId); billMaster.setClientUserId(billFetchByBillIdRequest.getClientUserId()); -// BILLER RESPONSE + // BILLER RESPONSE BillerResponse billerResponse = new BillerResponse(); if (responseWrapper.getBillerResponse() != null) { billerResponse.setBillId(responseWrapper.getBillerResponse().getBillId()); @@ -943,7 +935,7 @@ public class BillerMapperHelper { } billMaster.setBillerResponse(billerResponse); -// ADDITIONAL INFO + // ADDITIONAL INFO List additionalInfos = new ArrayList<>(); if (responseWrapper.getAdditionalInfo() != null) { for (AdditionalInfoBillDTO info : responseWrapper.getAdditionalInfo()) { @@ -956,7 +948,7 @@ public class BillerMapperHelper { } billMaster.setAdditionalInfo(additionalInfos); -// CUSTOMER PARAMS + // CUSTOMER PARAMS List customerParams = new ArrayList<>(); if (responseWrapper.getCustomerParams() != null) { for (CustomerParamDAO param : responseWrapper.getCustomerParams()) { @@ -970,170 +962,45 @@ public class BillerMapperHelper { } billMaster.setCustomerParams(customerParams); -// DATES - billMaster.setCreationDate(responseWrapper.getCreationDate()); - billMaster.setModifiedDate(responseWrapper.getModifiedDate()); + // DATES + // Map incoming DTO date strings into Auditable LocalDateTime fields + LocalDateTime bmCreatedOn = parseToLocalDateTime(responseWrapper.getCreationDate()); + if (bmCreatedOn != null) { + billMaster.setCreatedOn(bmCreatedOn); + } + LocalDateTime bmUpdatedOn = parseToLocalDateTime(responseWrapper.getModifiedDate()); + if (bmUpdatedOn != null) { + billMaster.setUpdatedOn(bmUpdatedOn); + } billMaster.setCreatedEpochDate(responseWrapper.getCreatedEpochDate()); billMaster.setModifiedEpochDate(responseWrapper.getModifiedEpochDate()); billMasterRepository.save(billMaster); } - public void saveBillValidation(FetchBillValidateResponse responseWrapper, BillFetchByBillIdRequest billRequest, - String txnId) { - System.out.println("responseWrapper"); - ModelMapper modelMapper = new ModelMapper(); - - try { - LOGGER.info("Saving bill validation data for billId={}", responseWrapper.getBillId()); - - // ✅ Map the main object - BillValidation billEntity = modelMapper.map(responseWrapper, BillValidation.class); - // ✅ Manually handle only the nested relationship part - if (responseWrapper.getCustomerParams() != null) { - List customerParams = responseWrapper.getCustomerParams().stream() - .map(param -> { - CustomerParamBillValidation cp = modelMapper.map(param, CustomerParamBillValidation.class); - cp.setBill(billEntity); // maintain relation - return cp; - }).collect(Collectors.toList()); - billEntity.setCustomerParams(customerParams); - } - if (responseWrapper.getAdditionalInfo() != null) { - List additionalInfos = responseWrapper.getAdditionalInfo().stream() - .map(info -> { - AdditionalInfoBillValidate ai = modelMapper.map(info, AdditionalInfoBillValidate.class); - ai.setBill(billEntity); // maintain relation - return ai; - }).collect(Collectors.toList()); - billEntity.setAdditionalInfo(additionalInfos); - billEntity.setClientUserId(billRequest.getClientUserId()); - billEntity.setTxnId(txnId); - billEntity.setRefId(billRequest.getReqId()); - - } - // ✅ Save everything (cascade handles child) - - billValidationRepository.save(billEntity); - - LOGGER.info("Bill validation saved successfully for billId={}", billEntity.getBillId()); - } catch (Exception ex) { - LOGGER.error("Error saving BillValidation data: {}", ex.getMessage(), ex); - throw new RuntimeException("Failed to save bill validation data", ex); - } - - } - - public FetchBillForwardRequest fetchBillForwardRequestMap(FetchBillRequest req) { - - FetchBillForwardRequest forward = new FetchBillForwardRequest(); - - forward.setBillerId(req.getBillerId()); - forward.setBillerName(req.getBillerName()); - forward.setBillerCategory(req.getBillerCategory()); - forward.setClientReqId(req.getClientReqId()); - forward.setMacAdress(req.getMacAdress()); - forward.setCustomerMobNo(req.getCustomerMobNo()); - forward.setRemitterName(req.getRemitterName()); - forward.setPaymentChannel(req.getPaymentChannel()); - forward.setDeviceBlockTags(req.getDeviceBlockTags()); - forward.setCustomerParamsRequest(req.getCustomerParamsRequest()); - forward.setRemitterIdentity(req.getRemitterIdentity()); - - return forward; - } - - public FetchBillValidatestForwardRequest fetchBillValidatestForwardRequest(FetchBillValidatestRequest req) { - - FetchBillValidatestForwardRequest forward = new FetchBillValidatestForwardRequest(); - - forward.setBillerId(req.getBillerId()); - forward.setBillerName(req.getBillerName()); - forward.setBillerCategory(req.getBillerCategory()); - forward.setCustomerMobNo(req.getCustomerMobNo()); - forward.setClientReqId(req.getClientReqId()); - forward.setMacAddress(req.getMacAddress()); - forward.setCustomerParamsRequest(req.getCustomerParamsRequest()); - - return forward; - } - - public BillPaymentForwardRequest billPaymentForwardRequest(BillPaymentRequest req) { - - BillPaymentForwardRequest forward = new BillPaymentForwardRequest(); - -// forward.setTenantId(req.getTenantId()); - forward.setRefId(req.getRefId()); - forward.setBillId(req.getBillId()); - forward.setAmountOptions(req.isAmountOptions()); - forward.setPaymentMode(req.getPaymentMode()); - forward.setPaymentInformation(req.getPaymentInformation()); - forward.setBillerId(req.getBillerId()); - forward.setBillerName(req.getBillerName()); - forward.setBillerCategory(req.getBillerCategory()); - forward.setMacAdress(req.getMacAdress()); - forward.setCustomerMobNo(req.getCustomerMobNo()); - forward.setTxnAmount(req.getTxnAmount()); - forward.setPaymentRefId(req.getPaymentRefId()); - forward.setClientReqId(req.getClientReqId()); - forward.setPaymentChannel(req.getPaymentChannel()); - - forward.setDeviceBlockTags(req.getDeviceBlockTags()); - forward.setCustomerParamsRequest(req.getCustomerParams()); - forward.setRemitterIdentity(req.getRemitterIdentity()); - forward.setAmountBreakSet(req.getAmountBreakSet()); - - return forward; - } - - public FetchComplaintForwardRequest fetchComplaintForwardRequestMap(ComplaintRequestDTO complainRequestDTO) { - FetchComplaintForwardRequest forward = new FetchComplaintForwardRequest(); - forward.setTicketDescription(complainRequestDTO.getTicketDescription()); - forward.setTicketDisposition(complainRequestDTO.getTicketDisposition()); - forward.setTicketDispositionCode(complainRequestDTO.getTicketDispositionCode()); - forward.setTxnId(complainRequestDTO.getTxnId()); - return forward; - } - - public FetchTicketLatestStatusRequest fetchTicketLatestStatusRequestMap(GetTicketLatestStausRequest request) { - FetchTicketLatestStatusRequest forward = new FetchTicketLatestStatusRequest(); - forward.setTicketId(request.getTicketId()); - forward.setTxnNpciId(request.getTxnNpciId()); - return forward; - } - - public void savePaymentStartRecord(PaymentStartUserRequest request, PaymentStartApiResponse apiResponse, - String txnId, String orderNo, String requestJson, String rawResponse, String responseType) { - PaymentStartRecord record = new PaymentStartRecord(); - record.setOrderNo(orderNo); - record.setRequestId(request.getReqId()); - record.setClientMid(request.getMid()); - record.setClientUserId(request.getClientUserId()); - record.setInternalTxnId(txnId); - - -record.setAmount(Optional.ofNullable(apiResponse.getResponseData().getAmount()).orElse("0.00")); -record.setMid(Optional.ofNullable(apiResponse.getResponseData().getMid()).orElse("DUMMY_MID")); -record.setTxnId(Optional.ofNullable(apiResponse.getResponseData().getTxnId()).orElse("DUMMY_TXN")); -record.setQrString(Optional.ofNullable(apiResponse.getResponseData().getQrString()).orElse("NO_QR")); -record.setCreatedOn(Optional.ofNullable(apiResponse.getResponseData().getCreatedOn()).orElse(LocalDateTime.now().toString())); -record.setTxnStatus("PENDING"); - - - // store the original request body and raw response - record.setRequestBody(requestJson); - record.setResponseBody(rawResponse); - record.setResponseType(responseType); - - paymentStartRecordRepository.save(record); - } - - public TransactionHistoryMasterDTO toDTO(TransactionMaster transactionMaster) { - if (transactionMaster == null) { + // Helper to parse incoming ISO date/time strings (with optional offset) into LocalDateTime + private LocalDateTime parseToLocalDateTime(String dateStr) { + if (dateStr == null || dateStr.isBlank()) { return null; } + try { + // Try parsing with offset first (e.g., 2023-04-19T17:28:05.508679Z or with +05:30) + OffsetDateTime odt = OffsetDateTime.parse(dateStr); + return odt.toLocalDateTime(); + } catch (Exception e) { + try { + // Fallback to LocalDateTime without offset + return LocalDateTime.parse(dateStr, DateTimeFormatter.ISO_LOCAL_DATE_TIME); + } catch (Exception ex) { + LOGGER.warn("Unable to parse date string to LocalDateTime: {}", dateStr); + return null; + } + } + } - // Create a new DTO and set the values from the entity + // Convert TransactionMaster to master DTO + public TransactionHistoryMasterDTO toDTO(TransactionMaster transactionMaster) { + if (transactionMaster == null) return null; TransactionHistoryMasterDTO dto = new TransactionHistoryMasterDTO(); dto.setBankTxnId(transactionMaster.getBankTxnId()); dto.setTxnId(transactionMaster.getTxnId()); @@ -1174,16 +1041,12 @@ record.setTxnStatus("PENDING"); dto.setModifiedDate(transactionMaster.getModifiedDate()); dto.setCreatedEpochDate(transactionMaster.getCreatedEpochDate()); dto.setModifiedEpochDate(transactionMaster.getModifiedEpochDate()); - return dto; } + // Convert TransactionMaster to particular details DTO (used with method references) public TransactionHistoryParticularDetailsDTO billerRemainingDetails(TransactionMaster transactionMaster) { - if (transactionMaster == null) { - return null; - } - - // Create a new DTO and set the values from the entity + if (transactionMaster == null) return null; TransactionHistoryParticularDetailsDTO dto = new TransactionHistoryParticularDetailsDTO(); dto.setBankTxnId(transactionMaster.getBankTxnId()); dto.setTxnId(transactionMaster.getTxnId()); @@ -1192,45 +1055,110 @@ record.setTxnStatus("PENDING"); dto.setBillerName(transactionMaster.getBillerName()); dto.setStatus(transactionMaster.getStatus()); dto.setTotalTxnAmount(transactionMaster.getTotalTxnAmount()); - return dto; } + // Map BillPaymentRequest to forward request used by external BBPS API + public BillPaymentForwardRequest billPaymentForwardRequest(BillPaymentRequest req) { + BillPaymentForwardRequest forward = new BillPaymentForwardRequest(); + forward.setRefId(req.getRefId()); + forward.setBillId(req.getBillId()); + forward.setAmountOptions(req.isAmountOptions()); + forward.setPaymentMode(req.getPaymentMode()); + forward.setPaymentInformation(req.getPaymentInformation()); + forward.setBillerId(req.getBillerId()); + forward.setBillerName(req.getBillerName()); + forward.setBillerCategory(req.getBillerCategory()); + forward.setMacAdress(req.getMacAdress()); + forward.setCustomerMobNo(req.getCustomerMobNo()); + forward.setTxnAmount(req.getTxnAmount()); + forward.setPaymentRefId(req.getPaymentRefId()); + forward.setClientReqId(req.getClientReqId()); + forward.setPaymentChannel(req.getPaymentChannel()); + forward.setDeviceBlockTags(req.getDeviceBlockTags()); + forward.setCustomerParamsRequest(req.getCustomerParams()); + forward.setRemitterIdentity(req.getRemitterIdentity()); + forward.setAmountBreakSet(req.getAmountBreakSet()); + return forward; + } + + // Map PaymentStartUserRequest + API response into PaymentStartRecord and persist + public void savePaymentStartRecord(PaymentStartUserRequest request, PaymentStartApiResponse apiResponse, + String txnId, String orderNo, String requestJson, String rawResponse, String responseType) { + PaymentStartRecord record = new PaymentStartRecord(); + record.setOrderNo(orderNo); + record.setRequestId(request.getReqId()); + record.setClientMid(request.getMid()); + record.setClientUserId(request.getClientUserId()); + record.setInternalTxnId(txnId); + + if (apiResponse != null && apiResponse.getResponseData() != null) { + record.setAmount(Optional.ofNullable(apiResponse.getResponseData().getAmount()).orElse("0.00")); + record.setMid(Optional.ofNullable(apiResponse.getResponseData().getMid()).orElse("DUMMY_MID")); + record.setTxnId(Optional.ofNullable(apiResponse.getResponseData().getTxnId()).orElse("DUMMY_TXN")); + record.setQrString(Optional.ofNullable(apiResponse.getResponseData().getQrString()).orElse("NO_QR")); + // parse createdOn string into LocalDateTime and set on Auditable + LocalDateTime createdOn = parseToLocalDateTime(apiResponse.getResponseData().getCreatedOn()); + if (createdOn == null) createdOn = LocalDateTime.now(); + record.setCreatedOn(createdOn); + // default status pending + record.setTxnStatus("PENDING"); + } else { + record.setAmount("0.00"); + record.setMid(request.getMid()); + record.setTxnStatus("PENDING"); + record.setCreatedOn(LocalDateTime.now()); + } + + // store the original request body and raw response + record.setRequestBody(requestJson); + record.setResponseBody(rawResponse); + record.setResponseType(responseType); + + paymentStartRecordRepository.save(record); + } + + // Map ComplaintRequestDTO to forward request for complaint API + public FetchComplaintForwardRequest fetchComplaintForwardRequestMap(ComplaintRequestDTO complainRequestDTO) { + FetchComplaintForwardRequest forward = new FetchComplaintForwardRequest(); + forward.setTicketDescription(complainRequestDTO.getTicketDescription()); + forward.setTicketDisposition(complainRequestDTO.getTicketDisposition()); + forward.setTicketDispositionCode(complainRequestDTO.getTicketDispositionCode()); + forward.setTxnId(complainRequestDTO.getTxnId()); + return forward; + } + + // Map GetTicketLatestStausRequest to forward request + public FetchTicketLatestStatusRequest fetchTicketLatestStatusRequestMap(GetTicketLatestStausRequest request) { + FetchTicketLatestStatusRequest forward = new FetchTicketLatestStatusRequest(); + forward.setTicketId(request.getTicketId()); + forward.setTxnNpciId(request.getTxnNpciId()); + return forward; + } + + // Check if complaint can be raised (true if within 24 hours of transactionCreatedDateString) public static boolean isComplaintAllowed(String transactionCreatedDateString) { - // Define the format of the transaction creation date including the time zone - // offset - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX"); - + if (transactionCreatedDateString == null || transactionCreatedDateString.isBlank()) return false; try { - // Parse the transaction creation date string to OffsetDateTime (handles time - // zone) - OffsetDateTime transactionCreatedDate = OffsetDateTime.parse(transactionCreatedDateString, formatter); - - // Get the current time (with offset) + OffsetDateTime transactionCreatedDate = OffsetDateTime.parse(transactionCreatedDateString); OffsetDateTime currentTime = OffsetDateTime.now(); - - // Calculate the difference in hours long hoursDifference = ChronoUnit.HOURS.between(transactionCreatedDate, currentTime); - - // Return true if complaint can be raised (i.e., within 24 hours) - return hoursDifference >= 24; - + // complaint allowed if within 24 hours + return hoursDifference <= 24; } catch (Exception e) { - // Handle invalid date format or other parsing issues - System.err.println("Invalid date format: " + e.getMessage()); + LOGGER.warn("isComplaintAllowed - invalid date string: {}", transactionCreatedDateString); return false; } } + // Persist complaint response entity public String saveComplaintResponseEntity(ComplaintResponse responseWrapper, String requestId, String txnId, String userId) { - - // 1. Convert ComplaintResponse DTO to ComplaintResponseEntity + if (responseWrapper == null || responseWrapper.getTicketDetails() == null) { + return "No data"; + } ComplaintResponseEntity complaintResponseEntity = new ComplaintResponseEntity(); - - // Map fields from DTO to entity - complaintResponseEntity.setRefId(responseWrapper.getTicketDetails().getRefId()); // For example, generate a - // unique ID + complaintResponseEntity.setRefId(responseWrapper.getTicketDetails().getRefId()); complaintResponseEntity.setTxnNpciId(responseWrapper.getTicketDetails().getTxnNpciId()); complaintResponseEntity.setTicketId(responseWrapper.getTicketDetails().getTicketId()); complaintResponseEntity.setTicketType(responseWrapper.getTicketDetails().getTicketType()); @@ -1238,36 +1166,107 @@ record.setTxnStatus("PENDING"); complaintResponseEntity.setTicketDesp(responseWrapper.getTicketDetails().getTicketDesp()); complaintResponseEntity.setTicketDesr(responseWrapper.getTicketDetails().getTicketDesr()); - // Additional fields from ComplaintResponse DTO complaintResponseEntity.setMessage(responseWrapper.getMessage()); complaintResponseEntity.setRemarks(responseWrapper.getRemarks()); complaintResponseEntity.setStatus(responseWrapper.getStatus()); complaintResponseEntity.setStatusCode(responseWrapper.getStatusCode()); - // Set requestId and txnId from parameters complaintResponseEntity.setReqId(requestId); complaintResponseEntity.setTxnId(txnId); complaintResponseEntity.setUserId(userId); - complaintResponseEntity.setCreateDateTime(new Date()); - // If you need a separate complaintTicketId, you can set it here - complaintResponseEntity.setComplaintTicketId(generateComplaintTicketId()); // Generate or set manually + complaintResponseEntity.setComplaintTicketId(generateComplaintTicketId()); - // Save the entity - complaintResponseRepository.save(complaintResponseEntity); - ComplaintResponseEntity savedEntity = complaintResponseRepository.save(complaintResponseEntity); - - // Check if the entity is saved successfully and return count (1 for success) - if (savedEntity != null) { - return "1 record saved with RefId: " + savedEntity.toString(); - } else { - return "Failed to save complaint response."; + ComplaintResponseEntity saved = complaintResponseRepository.save(complaintResponseEntity); + if (saved != null) { + return "1 record saved with id=" + saved.getId(); } - + return "Failed to save"; } - // Save Complain Response From DB private String generateComplaintTicketId() { - // Logic for generating complaint ticket ID return "CMP-" + UUID.randomUUID().toString(); } + + // Minimal mapping helpers used by AgentServiceImpl + public com.billpaymentservice.bbps.dto.sentRequest.FetchBillForwardRequest fetchBillForwardRequestMap( + com.billpaymentservice.bbps.dto.request.FetchBillRequest req) { + if (req == null) return null; + com.billpaymentservice.bbps.dto.sentRequest.FetchBillForwardRequest f = new com.billpaymentservice.bbps.dto.sentRequest.FetchBillForwardRequest(); + f.setBillerId(req.getBillerId()); + f.setBillerName(req.getBillerName()); + f.setBillerCategory(req.getBillerCategory()); + f.setClientReqId(req.getClientReqId()); + f.setMacAdress(req.getMacAdress()); + f.setCustomerMobNo(req.getCustomerMobNo()); + f.setRemitterName(req.getRemitterName()); + f.setPaymentChannel(req.getPaymentChannel()); + f.setDeviceBlockTags(req.getDeviceBlockTags()); + f.setCustomerParamsRequest(req.getCustomerParamsRequest()); + f.setRemitterIdentity(req.getRemitterIdentity()); + return f; + } + + public com.billpaymentservice.bbps.dto.sentRequest.FetchBillValidatestForwardRequest fetchBillValidatestForwardRequest( + com.billpaymentservice.bbps.dto.request.FetchBillValidatestRequest req) { + if (req == null) return null; + com.billpaymentservice.bbps.dto.sentRequest.FetchBillValidatestForwardRequest f = new com.billpaymentservice.bbps.dto.sentRequest.FetchBillValidatestForwardRequest(); + f.setBillerId(req.getBillerId()); + f.setBillerName(req.getBillerName()); + f.setBillerCategory(req.getBillerCategory()); + f.setCustomerMobNo(req.getCustomerMobNo()); + f.setClientReqId(req.getClientReqId()); + f.setMacAddress(req.getMacAddress()); + f.setCustomerParamsRequest(req.getCustomerParamsRequest()); + return f; + } + + public void saveBillValidation(com.billpaymentservice.bbps.dto.response.FetchBillValidateResponse responseWrapper, + com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest billRequest, String txnId) { + if (responseWrapper == null || billRequest == null) return; + BillValidation entity = new BillValidation(); + entity.setBillId(responseWrapper.getBillId()); + entity.setRefId(responseWrapper.getRefId()); + entity.setBillerId(responseWrapper.getBillerId()); + entity.setStatus(responseWrapper.getStatus()); + entity.setActionType(responseWrapper.getActionType()); + entity.setUserId(responseWrapper.getUserId()); + entity.setBillerResponse(responseWrapper.getBillerResponse()); + entity.setTxnId(txnId); + entity.setReqId(billRequest.getReqId()); + + // Map additionalInfo if present (minimal mapping) + if (responseWrapper.getAdditionalInfo() != null) { + List addList = new ArrayList<>(); + for (com.billpaymentservice.bbps.dto.AdditionalInfoBillValidateDTO ai : responseWrapper.getAdditionalInfo()) { + AdditionalInfoBillValidate info = new AdditionalInfoBillValidate(); + // DTO only has name & value + info.setName(ai.getName()); + info.setValue(ai.getValue()); + info.setBill(entity); + addList.add(info); + } + entity.setAdditionalInfo(addList); + } + + // Map customerParams if present (minimal mapping) + if (responseWrapper.getCustomerParams() != null) { + List cpList = new ArrayList<>(); + for (com.billpaymentservice.bbps.dto.CustomerParamDAO cp : responseWrapper.getCustomerParams()) { + CustomerParamBillValidation param = new CustomerParamBillValidation(); + param.setName(cp.getName()); + param.setValue(cp.getValue()); + param.setType(cp.getType()); + param.setBill(entity); + cpList.add(param); + } + entity.setCustomerParams(cpList); + } + + // Persist + try { + billValidationRepository.save(entity); + } catch (Exception e) { + LOGGER.error("Error saving BillValidation: {}", e.getMessage(), e); + } + } } diff --git a/src/main/java/com/billpaymentservice/bbps/util/Helper.java b/src/main/java/com/billpaymentservice/bbps/util/Helper.java index fd2ab54..78daae4 100644 --- a/src/main/java/com/billpaymentservice/bbps/util/Helper.java +++ b/src/main/java/com/billpaymentservice/bbps/util/Helper.java @@ -94,7 +94,6 @@ public class Helper { public static String generateTxnId(int n) { StringBuilder sb = new StringBuilder(n); - for (int i = 0; i < n; i++) { int index = secureRandom.nextInt(CHARACTERS.length()); sb.append(CHARACTERS.charAt(index)); @@ -185,7 +184,8 @@ public class Helper { user.setName(request.getName()); user.setEmail(request.getEmail()); user.setMid(request.getMid()); - user.setCreateDateTime(new Date()); + // set audit createdOn timestamp + user.setCreatedOn(LocalDateTime.now()); // Generate a unique userId (UUID) String uniqueUserId = generateUniqueUserId(); user.setUserId(uniqueUserId); diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 7574d34..a5a2da9 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -19,11 +19,12 @@ swagger.server.description=Local Development Server # DataSource -spring.datasource.url=jdbc:postgresql://localhost:5432/devdbuat +#spring.datasource.url=jdbc:postgresql://localhost:5432/devdbuat +spring.datasource.url=jdbc:postgresql://localhost:5432/bbps_enhanced spring.datasource.username=postgres -spring.datasource.password=UAT@DB_2025 +#spring.datasource.password=UAT@DB_2025 -#spring.datasource.password=himanshu@123 +spring.datasource.password=himanshu@123 spring.datasource.driver-class-name=org.postgresql.Driver spring.datasource.type=com.zaxxer.hikari.HikariDataSource diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a189cc7..73bb076 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -21,7 +21,7 @@ spring.profiles.active=local # DataSource -spring.datasource.url=jdbc:postgresql://localhost:5432/BBPS +spring.datasource.url=jdbc:postgresql://localhost:5432/BBPS_Enhanced spring.datasource.username=postgres #spring.datasource.password=UAT@DB_2025