55 lines
1.8 KiB
Java
55 lines
1.8 KiB
Java
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 lombok.Getter;
|
|
import lombok.NoArgsConstructor;
|
|
import lombok.Setter;
|
|
import lombok.ToString;
|
|
|
|
@Entity
|
|
@Getter @Setter @NoArgsConstructor @ToString
|
|
public class OutboundTraceLog {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
// 🔹 Linking fields
|
|
private String requestId; // same as inbound ka requestId
|
|
private String txnId; // same txnId for full trace
|
|
|
|
// 🔹 API / endpoint info
|
|
private String apiName; // e.g. fetchBillerData
|
|
private String endpointUrl; // full URL of external API
|
|
private String httpMethod; // GET / POST
|
|
|
|
// 🔹 Request/Response payloads
|
|
@Column(columnDefinition = "TEXT")
|
|
private String requestPayload; // jo tumne bheja external ko
|
|
@Column(columnDefinition = "TEXT")
|
|
private String responsePayload; // jo external ne bheja
|
|
|
|
// 🔹 Response/status
|
|
private String responseCode; // HTTP status code (200, 500, etc.)
|
|
private String status; // SUCCESS / FAILED
|
|
private LocalDateTime sendTime; // jab request gayi
|
|
private LocalDateTime responseReceiveTime; // jab response aaya
|
|
private LocalDateTime createdAt = LocalDateTime.now();
|
|
|
|
@Column(length = 255)
|
|
private String remark;
|
|
public OutboundTraceLog(String txnId, String apiName, String endpointUrl, String requestPayload) {
|
|
this.txnId = txnId;
|
|
this.apiName = apiName;
|
|
this.endpointUrl = endpointUrl;
|
|
this.requestPayload = requestPayload;
|
|
this.sendTime = LocalDateTime.now();
|
|
}
|
|
}
|