Merge pull request 'feature3-userId-added' (#32) from feature3-userId-added into develop

Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/32
This commit is contained in:
Mohd_Arham
2025-12-11 16:48:55 +05:30
5 changed files with 88 additions and 82 deletions
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
@@ -14,52 +14,55 @@ import lombok.Setter;
import lombok.ToString; import lombok.ToString;
@Entity @Entity
@Getter @Setter @NoArgsConstructor @ToString @Getter
@Setter
@NoArgsConstructor
@ToString
@Table(name = "bbps_inbound_trace_log") @Table(name = "bbps_inbound_trace_log")
public class InboundTraceLog { public class InboundTraceLog {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; private Long id;
// 🔹 Identifiers // 🔹 Identifiers
@Column(length = 50, unique = true) @Column(length = 50, unique = true)
private String requestId; // external requestId (from client) private String requestId; // external requestId (from client)
@Column(length = 35) @Column(length = 35)
private String txnId; // internally generated transaction id private String txnId; // internally generated transaction id
// 🔹 Source & API info // 🔹 Source & API info
private String orgId; // tumhara org code (like ORG001) private String orgId; // tumhara org code (like ORG001)
private String mid; // merchant id from request private String mid; // merchant id from request
private String apiName; // e.g. getBillerByBillerId private String apiName; // e.g. getBillerByBillerId
private String httpMethod; // GET / POST private String httpMethod; // GET / POST
// 🔹 Request/Response data // 🔹 Request/Response data
@Column(columnDefinition = "TEXT") @Column(columnDefinition = "TEXT")
private String requestPayload; // jo external ne bheja private String requestPayload; // jo external ne bheja
@Column(columnDefinition = "TEXT") @Column(columnDefinition = "TEXT")
private String responsePayload; // jo tumne wapas bheja private String responsePayload; // jo tumne wapas bheja
// 🔹 Status & timing // 🔹 Status & timing
private String status; // SUCCESS / FAILED private String status; // SUCCESS / FAILED
private String responseCode; // like 200, 400 etc. private String responseCode; // like 200, 400 etc.
private LocalDateTime requestTime; // jab request aayi private LocalDateTime requestTime; // jab request aayi
private LocalDateTime responseTime; // jab response gaya private LocalDateTime responseTime; // jab response gaya
private LocalDateTime createdAt = LocalDateTime.now(); private LocalDateTime createdAt = LocalDateTime.now();
@Column(length = 255) @Column(length = 255)
private String remark; // error ya note private String remark; // error ya note
public InboundTraceLog(String requestId, String txnId, String apiName, String mid, public InboundTraceLog(String requestId, String txnId, String apiName, String mid, String orgId, String httpMethod,
String orgId, String httpMethod, String requestPayload) { String requestPayload) {
this.requestId = requestId; this.requestId = requestId;
this.txnId = txnId; this.txnId = txnId;
this.apiName = apiName; this.apiName = apiName;
this.mid = mid; this.mid = mid;
this.orgId = orgId; this.orgId = orgId;
this.httpMethod = httpMethod; this.httpMethod = httpMethod;
this.requestPayload = requestPayload; this.requestPayload = requestPayload;
this.requestTime = LocalDateTime.now(); this.requestTime = LocalDateTime.now();
this.createdAt = LocalDateTime.now(); this.createdAt = LocalDateTime.now();
} }
} }
@@ -14,47 +14,51 @@ import lombok.Setter;
import lombok.ToString; import lombok.ToString;
@Entity @Entity
@Getter @Setter @NoArgsConstructor @ToString @ToString
@Getter
@Setter
@NoArgsConstructor
@Table(name = "bbps_outbound_trace_log") @Table(name = "bbps_outbound_trace_log")
public class OutboundTraceLog { public class OutboundTraceLog {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; private Long id;
// 🔹 Linking fields // 🔹 Linking fields
private String requestId; // same as inbound ka requestId private String requestId; // same as inbound ka requestId
private String txnId; // same txnId for full trace private String txnId; // same txnId for full trace
// 🔹 API / endpoint info // 🔹 API / endpoint info
private String apiName; // e.g. fetchBillerData private String apiName; // e.g. fetchBillerData
private String endpointUrl; // full URL of external API private String endpointUrl; // full URL of external API
private String httpMethod; // GET / POST private String httpMethod; // GET / POST
// 🔹 Request/Response payloads // 🔹 Request/Response payloads
@Column(columnDefinition = "TEXT") @Column(columnDefinition = "TEXT")
private String requestPayload; // jo tumne bheja external ko private String requestPayload; // jo tumne bheja external ko
@Column(columnDefinition = "TEXT") @Column(columnDefinition = "TEXT")
private String responsePayload; // jo external ne bheja private String responsePayload; // jo external ne bheja
// 🔹 Response/status // 🔹 Response/status
private String responseCode; // HTTP status code (200, 500, etc.) private String responseCode; // HTTP status code (200, 500, etc.)
private String status; // SUCCESS / FAILED private String status; // SUCCESS / FAILED
private LocalDateTime sendTime; // jab request gayi private LocalDateTime sendTime; // jab request gayi
private LocalDateTime responseReceiveTime; // jab response aaya private LocalDateTime responseReceiveTime; // jab response aaya
private LocalDateTime createdAt = LocalDateTime.now(); private LocalDateTime createdAt = LocalDateTime.now();
@Column(length = 255) @Column(length = 255)
private String remark; private String remark;
public OutboundTraceLog(String txnId, String requestId, String apiName,
String endpointUrl, String httpMethod, String requestPayload) { public OutboundTraceLog(String txnId, String requestId, String apiName, String endpointUrl, String httpMethod,
this.txnId = txnId; String requestPayload) {
this.requestId = requestId; this.txnId = txnId;
this.apiName = apiName; this.requestId = requestId;
this.endpointUrl = endpointUrl; this.apiName = apiName;
this.httpMethod = httpMethod; this.endpointUrl = endpointUrl;
this.requestPayload = requestPayload; this.httpMethod = httpMethod;
this.sendTime = LocalDateTime.now(); this.requestPayload = requestPayload;
this.createdAt = LocalDateTime.now(); this.sendTime = LocalDateTime.now();
} this.createdAt = LocalDateTime.now();
}
} }
@@ -38,4 +38,7 @@ public class UserEntity extends Auditable {
@Column(name = "mid") @Column(name = "mid")
private String mid; private String mid;
@Column(name = "is_enabled")
private boolean enabled = true;
} }
@@ -3,7 +3,6 @@ spring.application.name=bbps
# Server port # Server port
server.port=9090 server.port=9090
spring.jpa.open-in-view=false
# JPA & Hibernate # JPA & Hibernate
spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.ddl-auto=update
@@ -19,12 +18,11 @@ swagger.server.description=Local Development Server
# DataSource # 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.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.driver-class-name=org.postgresql.Driver
spring.datasource.type=com.zaxxer.hikari.HikariDataSource spring.datasource.type=com.zaxxer.hikari.HikariDataSource