Author SHA1 Message Date
Lincpay Tech 53641d97ea added rate limiter 2025-12-12 18:52:53 +05:30
Lincpay Tech b3c507338e handled connection timeout exception 2025-12-11 18:00:36 +05:30
Lincpay Tech 6079ce48a3 updated audit table accroding to merchant panel 2025-12-11 17:35:26 +05:30
Mohd_Arham 67404c2279 Merge pull request 'feature3-userId-added' (#32) from feature3-userId-added into develop
Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/32
2025-12-11 16:48:55 +05:30
Mohd-Arham 870c37e7f5 updated code 2025-12-11 16:48:00 +05:30
Mohd-Arham 66a7677917 added user entity enabled 2025-12-11 16:45:22 +05:30
himanshu 2da63b2f11 Merge pull request 'audit-update' (#31) from audit-update into develop
Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/31
2025-12-11 11:11:49 +05:30
Lincpay Tech 06cb102aed made spome miniorchanges and remove user details 2025-12-11 11:05:38 +05:30
Mohd-Arham 825e309785 added 2025-12-11 10:50:51 +05:30
Lincpay Tech abf89ce7f0 resolved intitate payment problem 2025-12-10 16:07:57 +05:30
Mohd-Arham eb28221b96 update code added 2025-12-10 12:58:20 +05:30
Lincpay Tech 29bce40c65 removed userdetails table 2025-12-10 11:08:03 +05:30
Lincpay Tech e21039090d entity update with audit 2025-12-10 10:03:15 +05:30
Lincpay Tech 699d8572a9 added retry for the send otp 2025-12-09 19:11:42 +05:30
Mohd_Arham bb0aee2b2b Merge pull request 'update swagger configure' (#30) from feature3-userId-added into develop
Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/30
2025-12-09 18:32:15 +05:30
Mohd-Arham 13bfd34bbd update swagger configure 2025-12-09 18:30:22 +05:30
Lincpay Tech fb3c5d2e96 make some changes 2025-12-09 15:12:26 +05:30
Lincpay Tech 2c4855d59a added seprate auditable in entity 2025-12-09 10:13:23 +05:30
Mohd_Arham 0e56b4de7b Merge pull request 'feature3-userId-added' (#29) from feature3-userId-added into develop
Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/29
2025-12-09 10:10:07 +05:30
Mohd-Arham 74e4f86d67 update entity name 2025-12-09 10:08:51 +05:30
Mohd-Arham 896ff1722a updated code entity name 2025-12-08 18:41:12 +05:30
Mohd-Arham 6ea6dc4775 entity add bbps 2025-12-08 17:02:51 +05:30
Lincpay Tech 1cfe331ff1 improved the customerparamrequest to customerparam 2025-12-08 17:00:25 +05:30
Lincpay Tech c25382bd5c added txnid responsein web 2025-12-08 10:43:13 +05:30
Mohd-Arham fe4f653065 add rest client 2025-12-08 10:08:52 +05:30
Mohd-Arham 597f6b10d4 add rest client 2025-12-08 10:07:21 +05:30
Mohd-Arham 7e7b8ae9cf update complaint 2025-12-08 10:05:29 +05:30
Lincpay Tech 1e38efe3c0 imroved webbased datasaved 2025-12-05 11:55:49 +05:30
Mohd_Arham 66fceb95a1 Merge pull request 'feature3-userId-added' (#28) from feature3-userId-added into develop
Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/28
2025-12-04 18:42:15 +05:30
Mohd-Arham a28f70d2a9 resolved conflict 2025-12-04 18:41:00 +05:30
Mohd-Arham f15e967e58 04-12-25 2025-12-04 18:37:44 +05:30
Lincpay Tech 693b0b7801 fix untrancked file 2025-12-04 12:18:32 +05:30
Mohd-Arham 812aa3c2ff add validation in request 2025-12-04 12:17:14 +05:30
Lincpay Tech 1ab2768226 Merge remote-tracking branch 'origin/develop' into feature/callbackpaymentintent 2025-12-04 12:03:06 +05:30
Lincpay Tech 08b0689209 shift some constant from bbpsconstant to application properties 2025-12-04 11:54:58 +05:30
Lincpay Tech aea3d0d3a8 imroved the logic of intentpaymentapi 2025-12-04 10:44:25 +05:30
himanshu c0dbf531bd Merge pull request 'open callback with authentication' (#27) from feature/callbackpaymentintent into develop
Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/27
2025-12-03 18:17:03 +05:30
Lincpay Tech d88c624d50 open callback with authentication 2025-12-03 18:14:12 +05:30
Mohd-Arham 28708d1d74 updated payment code 2025-12-03 18:13:01 +05:30
Mohd-Arham 003dd9325c user id addded in this code 2025-12-03 17:40:04 +05:30
himanshu 9a9a07875c Merge pull request 'feature/callbackpaymentintent' (#25) from feature/callbackpaymentintent into develop
Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/25
2025-12-03 17:36:13 +05:30
Lincpay Tech a210c86bcd Merge branch 'develop' into feature/callbackpaymentintent 2025-12-03 17:31:08 +05:30
Lincpay Tech 78c38e6d74 added pollbackpayment status 2025-12-03 17:29:10 +05:30
Mohd_Arham 58d450b22e Merge pull request 'feature3-shared' (#24) from feature3-shared into develop
Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/24
2025-12-03 11:49:40 +05:30
146 changed files with 3327 additions and 1918 deletions
View File
+21 -2
View File
@@ -159,6 +159,12 @@
<version>0.11.5</version> <version>0.11.5</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.17.1</version>
</dependency>
<!-- Test --> <!-- Test -->
<dependency> <dependency>
@@ -166,7 +172,7 @@
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- Configuration Processor --> <!-- Configuration Processor -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@@ -174,6 +180,19 @@
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<!-- Redis (Spring Data Redis + Lettuce) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- Bucket4j core for local token-bucket smoothing -->
<dependency>
<groupId>com.github.vladimir-bukhtoyarov</groupId>
<artifactId>bucket4j-core</artifactId>
<version>7.6.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
@@ -202,4 +221,4 @@
<finalName>BBPS</finalName> <finalName>BBPS</finalName>
</build> </build>
</project> </project>
@@ -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<U> 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;
}
@@ -11,9 +11,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.billpaymentservice.bbps.entites.UserEntity; import com.billpaymentservice.bbps.entites.UserEntity;
import com.billpaymentservice.bbps.entites.UsersDetails;
import com.billpaymentservice.bbps.repository.UserRepository; import com.billpaymentservice.bbps.repository.UserRepository;
import com.billpaymentservice.bbps.repository.UsersDetailsRepository;
@Service @Service
public class CustomUserDetailsService implements UserDetailsService { public class CustomUserDetailsService implements UserDetailsService {
@@ -0,0 +1,68 @@
package com.billpaymentservice.bbps.config;
import java.time.Duration;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.core.Ordered;
import com.billpaymentservice.bbps.filter.RateLimitingFilter;
import com.billpaymentservice.bbps.ratelimit.LocalBucketManager;
@Configuration
public class RateLimiterConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(RateLimiterConfig.class);
@Value("${spring.redis.host:localhost}")
private String redisHost;
@Value("${spring.redis.port:6379}")
private int redisPort;
// allow comma-separated patterns, default to /api/* and /masterData/* for backward compatibility
@Value("${rate.limiter.url-pattern:/api/*,/masterData/*}")
private String urlPattern;
@Bean
public LettuceConnectionFactory redisConnectionFactory() {
RedisStandaloneConfiguration cfg = new RedisStandaloneConfiguration(redisHost, redisPort);
LettuceConnectionFactory factory = new LettuceConnectionFactory(cfg);
// optional tuning
factory.setValidateConnection(true);
return factory;
}
@Bean
public StringRedisTemplate stringRedisTemplate(LettuceConnectionFactory connectionFactory) {
StringRedisTemplate tpl = new StringRedisTemplate(connectionFactory);
tpl.setEnableTransactionSupport(false);
return tpl;
}
@Bean
public FilterRegistrationBean<RateLimitingFilter> rateLimiterFilterRegistration(StringRedisTemplate stringRedisTemplate, LocalBucketManager localBucketManager) {
RateLimitingFilter filter = new RateLimitingFilter(stringRedisTemplate, localBucketManager);
FilterRegistrationBean<RateLimitingFilter> reg = new FilterRegistrationBean<>();
reg.setFilter(filter);
// support comma-separated patterns in property (e.g. "/api/*,/masterData/*")
String[] patterns = urlPattern.split("\\s*,\\s*");
reg.addUrlPatterns(patterns);
LOGGER.info("Registering RateLimitingFilter for patterns={}", Arrays.toString(patterns));
reg.setName("rateLimitingFilter");
// set the filter to highest precedence so it runs before other servlet filters (e.g., security chain)
reg.setOrder(Ordered.HIGHEST_PRECEDENCE);
return reg;
}
}
@@ -2,13 +2,14 @@ package com.billpaymentservice.bbps.config;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager; import javax.net.ssl.X509TrustManager;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestClient; import org.springframework.web.client.RestClient;
@Configuration @Configuration
@@ -16,24 +17,31 @@ public class RestClientConfig {
@Bean @Bean
public RestClient restClient() throws Exception { public RestClient restClient() throws Exception {
// ✅ Create trust all SSL context
SSLContext sslContext = SSLContext.getInstance("TLS"); // Create Trust-All SSL context
TrustManager[] trustAllCerts = new TrustManager[]{ TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() { new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() { public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0]; return new X509Certificate[0];
} }
public void checkClientTrusted(X509Certificate[] certs, String authType) { public void checkClientTrusted(X509Certificate[] certs, String authType) {}
} public void checkServerTrusted(X509Certificate[] certs, String authType) {}
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
} }
}; };
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, trustAllCerts, new java.security.SecureRandom()); sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
// ✅ Create RestClient with custom SSL context // Use JDK's Simple HTTP client with custom SSL context
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
requestFactory.setBufferRequestBody(false);
// Apply SSL context to HttpsURLConnection globally
HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
HttpsURLConnection.setDefaultHostnameVerifier((hostname, session) -> true);
return RestClient.builder() return RestClient.builder()
.requestFactory(new HttpComponentsClientHttpRequestFactory()) .requestFactory(requestFactory)
.build(); .build();
} }
} }
@@ -2,6 +2,7 @@ package com.billpaymentservice.bbps.config;
import java.util.Arrays; import java.util.Arrays;
import com.billpaymentservice.bbps.controller.AgentController;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
@@ -18,13 +19,16 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
@EnableWebSecurity @EnableWebSecurity
public class SecurityConfig { public class SecurityConfig {
private final AgentController agentController;
private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint; private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint;
private final JwtFilter jwtFilter; private final JwtFilter jwtFilter;
public SecurityConfig(JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint, JwtFilter jwtFilter) { public SecurityConfig(JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint, JwtFilter jwtFilter, AgentController agentController) {
this.jwtAuthenticationEntryPoint = jwtAuthenticationEntryPoint; this.jwtAuthenticationEntryPoint = jwtAuthenticationEntryPoint;
this.jwtFilter = jwtFilter; this.jwtFilter = jwtFilter;
this.agentController = agentController;
} }
@Bean @Bean
@@ -39,7 +43,9 @@ public class SecurityConfig {
"/swagger-resources/**", "/swagger-resources/**",
"/webjars/**", "/webjars/**",
"/error") "/error")
.permitAll().requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() .permitAll()
.requestMatchers("/payment/callback/startPayment")
.permitAll().requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.anyRequest().authenticated()) .anyRequest().authenticated())
.exceptionHandling(ex -> ex.authenticationEntryPoint(jwtAuthenticationEntryPoint)) .exceptionHandling(ex -> ex.authenticationEntryPoint(jwtAuthenticationEntryPoint))
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)); .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS));
@@ -9,7 +9,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.billpaymentservice.bbps.dto.GeneralResp;
import com.billpaymentservice.bbps.dto.ResponseModel; import com.billpaymentservice.bbps.dto.ResponseModel;
import com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest; import com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest;
import com.billpaymentservice.bbps.dto.request.BillFetchByClientIdRequest; import com.billpaymentservice.bbps.dto.request.BillFetchByClientIdRequest;
@@ -19,6 +18,14 @@ import com.billpaymentservice.bbps.dto.request.FetchBillValidatestRequest;
import com.billpaymentservice.bbps.dto.response.BillDataResponse; import com.billpaymentservice.bbps.dto.response.BillDataResponse;
import com.billpaymentservice.bbps.dto.response.FetchBillValidateResponse; import com.billpaymentservice.bbps.dto.response.FetchBillValidateResponse;
import com.billpaymentservice.bbps.service.AgentService; import com.billpaymentservice.bbps.service.AgentService;
import com.billpaymentservice.bbps.util.ApiDocCommonResponses;
import com.billpaymentservice.bbps.util.BBPSConstant;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
@RestController @RestController
@RequestMapping("/agent") @RequestMapping("/agent")
@@ -31,20 +38,22 @@ public class AgentController {
this.agentService = agentService; this.agentService = agentService;
} }
/** @PostMapping(value = "/requestBillFetch")
* Fetches bill details from external BBPS service @Operation(summary = "Initiate bill fetch request", description = "This API initiates a bill fetch request for the given customer/biller details.")
*/ @ApiResponses(value = {
@PostMapping(value = "/requestBillFetch", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Bill fetch request initiated successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> requestBillFetch(@Validated @RequestBody FetchBillRequest fetchBillRequest) { public ResponseEntity<ResponseModel> requestBillFetch(@Validated @RequestBody FetchBillRequest fetchBillRequest) {
ResponseModel response = agentService.initiateBillFetch(fetchBillRequest); ResponseModel response = agentService.initiateBillFetch(fetchBillRequest);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
/** @PostMapping(value = "/fetchBillById")
* Fetches bill details from external BBPS service @Operation(summary = "Fetch bill details by bill ID", description = "This API retrieves bill details from the BBPS system using the provided bill ID.")
*/ @ApiResponses(value = {
@PostMapping(value = "/fetchBillById", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Bill details fetched successfully by bill ID", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> fetchBillById( public ResponseEntity<ResponseModel> fetchBillById(
@Validated @RequestBody BillFetchByBillIdRequest billFetchByBillIdRequest) { @Validated @RequestBody BillFetchByBillIdRequest billFetchByBillIdRequest) {
@@ -52,10 +61,11 @@ public class AgentController {
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
/** @PostMapping(value = "/requestBillValidate")
* Fetches bill details validate from external BBPS service @Operation(summary = "Initiate bill validation request", description = "This API validates customer input and bill details .")
*/ @ApiResponses(value = {
@PostMapping(value = "/requestBillValidate", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Bill validation initiated successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> requestBillValidate( public ResponseEntity<ResponseModel> requestBillValidate(
@Validated @RequestBody FetchBillValidatestRequest fetchBillValidateRequest) { @Validated @RequestBody FetchBillValidatestRequest fetchBillValidateRequest) {
@@ -63,43 +73,61 @@ public class AgentController {
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
/** @PostMapping(value = "/requestBillValidateByBillId")
* Fetches bill details by bill Id from external BBPS service @Operation(summary = "Bill validate by details by bill ID", description = "This API retrieves bill details from BBPS using the provided bill ID.")
*/ @ApiResponses(value = {
@PostMapping(value = "/requestBillValidateByBillId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Bill details fetched successfully by bill ID", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> requestBillByBillId( public ResponseEntity<ResponseModel> requestBillByBillId(
@Validated @RequestBody BillFetchByBillIdRequest billRequest) { @Validated @RequestBody BillFetchByBillIdRequest billRequest) {
ResponseModel response = agentService.initiateBillValidateByBillId(billRequest); ResponseModel response = agentService.initiateBillValidateByBillId(billRequest);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
@PostMapping(value = "/fetchBillByClientReqId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/fetchBillByClientReqId")
@Operation(summary = "Fetch bill details by client request ID", description = "This API fetches bill details using the client-generated request ID (clientReqId).")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Bill details fetched successfully using client request ID", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> fetchBillByClientReqId( public ResponseEntity<ResponseModel> fetchBillByClientReqId(
@Validated @RequestBody BillFetchByClientIdRequest billFetchByClientIdRequest) { @Validated @RequestBody BillFetchByClientIdRequest billFetchByClientIdRequest) {
ResponseModel response = agentService.fetchBillByClientReqId(billFetchByClientIdRequest); ResponseModel response = agentService.fetchBillByClientReqId(billFetchByClientIdRequest);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
@PostMapping(value = "/fetchBillValidateByClientReqId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/fetchBillValidateByClientReqId")
@Operation(summary = "Fetch bill details by client request ID", description = "This API retrieves bill details using the client's request ID (clientReqId).")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Bill details fetched successfully using client request ID", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> fetchBillValidateByClientReqId( public ResponseEntity<ResponseModel> fetchBillValidateByClientReqId(
@Validated @RequestBody BillValidateByClientIdRequest billValidateByClientIdRequest) { @Validated @RequestBody BillValidateByClientIdRequest billValidateByClientIdRequest) {
ResponseModel response = agentService.fetchBillValidateByClientReqId(billValidateByClientIdRequest); ResponseModel response = agentService.fetchBillValidateByClientReqId(billValidateByClientIdRequest);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
@PostMapping(value="/callback/billFetch", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/callback/billFetch")
public ResponseEntity<ResponseModel> handleBillFetchCallback(@RequestBody BillDataResponse billDataResponse) { @Operation(summary = "Handle bill fetch callback", description = "This callback API is invoked by BBPS/Biller to send bill fetch response.")
ResponseModel genralResp=agentService.processBillFetchCallback(billDataResponse); @ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Callback received and processed successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> handleBillFetchCallback(@RequestBody BillDataResponse billDataResponse) {
ResponseModel genralResp = agentService.processBillFetchCallback(billDataResponse);
// Return a response indicating successful receipt // Return a response indicating successful receipt
return ResponseEntity.ok(genralResp); return ResponseEntity.ok(genralResp);
} }
@PostMapping(value="/callback/billValidate", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/callback/billValidate")
public ResponseEntity<ResponseModel> handleBillValidateCallback(@RequestBody FetchBillValidateResponse fetchBillValidateResponse) { @Operation(summary = "Handle bill validate callback", description = "This callback API is triggered by BBPS/Biller to send bill validation response.")
ResponseModel genralResp=agentService.processBillValidateCallback(fetchBillValidateResponse); @ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Callback received and processed successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> handleBillValidateCallback(
@RequestBody FetchBillValidateResponse fetchBillValidateResponse) {
ResponseModel genralResp = agentService.processBillValidateCallback(fetchBillValidateResponse);
// Return a response indicating successful receipt // Return a response indicating successful receipt
return ResponseEntity.ok(genralResp); return ResponseEntity.ok(genralResp);
} }
@@ -10,14 +10,18 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.billpaymentservice.bbps.dto.ResponseModel; import com.billpaymentservice.bbps.dto.ResponseModel;
import com.billpaymentservice.bbps.dto.auth.AuthResponse;
import com.billpaymentservice.bbps.dto.response.AuthResponses;
import com.billpaymentservice.bbps.dto.auth.LoginRequest; import com.billpaymentservice.bbps.dto.auth.LoginRequest;
import com.billpaymentservice.bbps.dto.auth.OtpSendResponse;
import com.billpaymentservice.bbps.dto.auth.RegisterRequest; import com.billpaymentservice.bbps.dto.auth.RegisterRequest;
import com.billpaymentservice.bbps.dto.auth.VerifyOtpRequest; import com.billpaymentservice.bbps.dto.auth.VerifyOtpRequest;
import com.billpaymentservice.bbps.service.AuthService; import com.billpaymentservice.bbps.service.AuthService;
import com.billpaymentservice.bbps.util.ApiDocCommonResponses;
import com.billpaymentservice.bbps.util.BBPSConstant;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@RestController @RestController
@@ -32,25 +36,42 @@ public class AuthController {
this.authService = authService; this.authService = authService;
} }
@PostMapping(value = "/sendOtp", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/sendOtp")
@Operation(summary = "Send OTP to user", description = "This API sends an OTP to the user's registered mobile number for authentication.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "OTP sent successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> sendOtp(@Validated @RequestBody LoginRequest request) { public ResponseEntity<ResponseModel> sendOtp(@Validated @RequestBody LoginRequest request) {
log.info("Received sendOtp request for mobile: {}", request.getMobile()); log.info("Received sendOtp request for mobile: {}", request.getMobile());
return ResponseEntity.ok(authService.sendOtp(request)); return ResponseEntity.ok(authService.sendOtp(request));
} }
@PostMapping(value = "/verifyOtp", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/verifyOtp")
@Operation(summary = "Verify OTP", description = "This API verifies the OTP entered by the user and validates the authentication flow.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "OTP verified successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> verifyOtp(@Validated @RequestBody VerifyOtpRequest request) { public ResponseEntity<ResponseModel> verifyOtp(@Validated @RequestBody VerifyOtpRequest request) {
return ResponseEntity.ok(authService.verifyOtp(request)); return ResponseEntity.ok(authService.verifyOtp(request));
} }
@PostMapping(value = "/register", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/register")
@Operation(summary = "Register a new user", description = "This API registers a new user into the system by validating the provided registration details.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "User registered successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> register(@Validated @RequestBody RegisterRequest request) { public ResponseEntity<ResponseModel> register(@Validated @RequestBody RegisterRequest request) {
return ResponseEntity.ok(authService.registerUser(request)); return ResponseEntity.ok(authService.registerUser(request));
} }
@PostMapping("/loginWithoutDecryption") @PostMapping("/loginWithoutDecryption")
@Operation(summary = "Login without decryption (Testing Only)", description = "This API is used only for testing purposes. It authenticates the user without decrypting the credentials, typically used when token generation fails or decryption flow is not enabled.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "User authenticated successfully (Testing Only)", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> login(@RequestBody LoginRequest loginRequest) { public ResponseEntity<ResponseModel> login(@RequestBody LoginRequest loginRequest) {
return ResponseEntity.ok(authService.authenticateUser(loginRequest)); return ResponseEntity.ok(authService.authenticateUser(loginRequest));
@@ -16,10 +16,16 @@ import com.billpaymentservice.bbps.dto.request.AllMasterOptionsRequest;
import com.billpaymentservice.bbps.dto.request.ComplainStatusRequest; import com.billpaymentservice.bbps.dto.request.ComplainStatusRequest;
import com.billpaymentservice.bbps.dto.request.ComplaintRequestDTO; import com.billpaymentservice.bbps.dto.request.ComplaintRequestDTO;
import com.billpaymentservice.bbps.dto.request.GetTicketLatestStausRequest; import com.billpaymentservice.bbps.dto.request.GetTicketLatestStausRequest;
import com.billpaymentservice.bbps.dto.request.ViewAllComplaintsRequest;
import com.billpaymentservice.bbps.dto.request.ViewAllComplaintsTicketsRequest; import com.billpaymentservice.bbps.dto.request.ViewAllComplaintsTicketsRequest;
import com.billpaymentservice.bbps.service.ComplainService; import com.billpaymentservice.bbps.service.ComplainService;
import com.billpaymentservice.bbps.util.ApiDocCommonResponses;
import com.billpaymentservice.bbps.util.BBPSConstant;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
@RestController @RestController
@RequestMapping("/complaints") @RequestMapping("/complaints")
@@ -31,19 +37,26 @@ public class ComplainController {
private final ComplainService complainService; private final ComplainService complainService;
// ✅ Constructor name fixed and variable consistent
public ComplainController(ComplainService complainService) { public ComplainController(ComplainService complainService) {
this.complainService = complainService; this.complainService = complainService;
} }
@PostMapping(value = "/addComplainTicket", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/addComplainTicket")
@Operation(summary = "Add complaint ticket", description = "This API creates a new complaint ticket based on the provided request details.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Complaint ticket created successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> addComplain(@Validated @RequestBody ComplaintRequestDTO complainRequestDTO) { public ResponseEntity<ResponseModel> addComplain(@Validated @RequestBody ComplaintRequestDTO complainRequestDTO) {
ResponseModel response = complainService.addComplain(complainRequestDTO); ResponseModel response = complainService.addComplain(complainRequestDTO);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
@PostMapping(value = "/checkTicketStatus", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/checkTicketStatus")
@Operation(summary = "Fetch latest complaint ticket status", description = "This API retrieves the latest status of a complaint ticket based on the provided ticket ID.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Complaint ticket status fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> getComplaintStatus( public ResponseEntity<ResponseModel> getComplaintStatus(
@Validated @RequestBody GetTicketLatestStausRequest request) { @Validated @RequestBody GetTicketLatestStausRequest request) {
log.info("Received complaint status request for complaintId: {}", request.getTicketId()); log.info("Received complaint status request for complaintId: {}", request.getTicketId());
@@ -51,7 +64,11 @@ public class ComplainController {
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
@PostMapping(value = "/viewComplainsTicketHistory", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/viewComplainsTicketHistory")
@Operation(summary = "View complaint ticket history", description = "This API retrieves the full complaint history for the provided ticket ID.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Complaint ticket history fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> viewComplaintHistory(@Validated @RequestBody ComplainStatusRequest request) { public ResponseEntity<ResponseModel> viewComplaintHistory(@Validated @RequestBody ComplainStatusRequest request) {
log.info("Received complaint View Complaint History request for ticketId: {}", request.getTicketId()); log.info("Received complaint View Complaint History request for ticketId: {}", request.getTicketId());
ResponseModel response = complainService.viewComplaintHistory(request); ResponseModel response = complainService.viewComplaintHistory(request);
@@ -59,6 +76,10 @@ public class ComplainController {
} }
@PostMapping("/viewTicketById") @PostMapping("/viewTicketById")
@Operation(summary = "View complaint details by ID", description = "This API retrieves the complaint details for the given complaint ticket ID.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Complaint details fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> viewComplaintById(@Validated @RequestBody ComplainStatusRequest request) { public ResponseEntity<ResponseModel> viewComplaintById(@Validated @RequestBody ComplainStatusRequest request) {
log.info("Received complaint View Complaint By ID request for complaintId: {}", request.getTicketId()); log.info("Received complaint View Complaint By ID request for complaintId: {}", request.getTicketId());
ResponseModel response = complainService.viewComplaintById(request); ResponseModel response = complainService.viewComplaintById(request);
@@ -66,19 +87,33 @@ public class ComplainController {
} }
@PostMapping("/allMasterOptions") @PostMapping("/allMasterOptions")
@Operation(summary = "Fetch all master options by ID", description = "This API retrieves all master option values based on the provided ID.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Master options fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> getAllStatuses(@Validated @RequestBody AllMasterOptionsRequest request) { public ResponseEntity<ResponseModel> getAllStatuses(@Validated @RequestBody AllMasterOptionsRequest request) {
return ResponseEntity.ok(complainService.getAllActiveStatuses(request)); return ResponseEntity.ok(complainService.getAllActiveStatuses(request));
} }
@PostMapping("/viewAllComplaints") @PostMapping("/viewAllComplaints")
public ResponseEntity<ResponseModel> viewAllComplaints(@RequestBody ViewAllComplaintsTicketsRequest request) { @Operation(summary = "View all complaints by status type", description = "This API retrieves all complaints filtered by the provided status type.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "All complaints fetched successfully based on status type", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> viewAllComplaints(
@Validated @RequestBody ViewAllComplaintsTicketsRequest request) {
log.info("Received request complaint View All Complaints for Status Type={}", request.getStatusType()); log.info("Received request complaint View All Complaints for Status Type={}", request.getStatusType());
ResponseModel response = complainService.ViewAllComplaints(request); ResponseModel response = complainService.ViewAllComplaints(request);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
@PostMapping(value = "/viewAllComplaintsByUserId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/viewAllComplaintsByUserId")
public ResponseEntity<ResponseModel> viewAllComplaintsByUserId(@Validated @RequestBody AllMasterOptionsRequest request) { @Operation(summary = "View all complaints by user ID", description = "This API retrieves all complaint tickets associated with the provided user ID.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "All complaints fetched successfully by user ID", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> viewAllComplaintsByUserId(
@Validated @RequestBody AllMasterOptionsRequest request) {
ResponseModel response = complainService.viewAllComplaintsByUserId(request); ResponseModel response = complainService.viewAllComplaintsByUserId(request);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
@@ -16,13 +16,18 @@ import com.billpaymentservice.bbps.dto.request.BillerDetailRequest;
import com.billpaymentservice.bbps.dto.request.ContactMasterRequest; import com.billpaymentservice.bbps.dto.request.ContactMasterRequest;
import com.billpaymentservice.bbps.dto.request.CustomParamRequest; import com.billpaymentservice.bbps.dto.request.CustomParamRequest;
import com.billpaymentservice.bbps.dto.request.DispositionRequest; import com.billpaymentservice.bbps.dto.request.DispositionRequest;
import com.billpaymentservice.bbps.dto.request.LoginRequest;
import com.billpaymentservice.bbps.dto.request.MasterCategoryRequest; import com.billpaymentservice.bbps.dto.request.MasterCategoryRequest;
import com.billpaymentservice.bbps.dto.request.MasterRequest; import com.billpaymentservice.bbps.dto.request.MasterRequest;
import com.billpaymentservice.bbps.dto.request.PlanRequest; import com.billpaymentservice.bbps.dto.request.PlanRequest;
import com.billpaymentservice.bbps.dto.response.AuthResponses;
import com.billpaymentservice.bbps.service.MasterDataService; import com.billpaymentservice.bbps.service.MasterDataService;
import com.billpaymentservice.bbps.util.ApiDocCommonResponses;
import com.billpaymentservice.bbps.util.BBPSConstant;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@RequestMapping("/masterData") @RequestMapping("/masterData")
@@ -39,8 +44,12 @@ public class MasterDataController {
this.masterDataService = masterDataService; this.masterDataService = masterDataService;
} }
/** Get Details of the biller by billId **/ @PostMapping(value = "/getBillerDetails")
@PostMapping(value = "/getBillerDetails", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Fetch biller details", description = "Get biller details by biller id and returns the result")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Biller details fetch successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> getBillerDetails(@Valid @RequestBody BillerDetailRequest billerDetailRequest) { public ResponseEntity<ResponseModel> getBillerDetails(@Valid @RequestBody BillerDetailRequest billerDetailRequest) {
log.info("Received biller details request for billerId: {}", billerDetailRequest.getBillerId()); log.info("Received biller details request for billerId: {}", billerDetailRequest.getBillerId());
@@ -48,32 +57,41 @@ public class MasterDataController {
return ResponseEntity.ok(masterDataService.getBillerByBillerId(billerDetailRequest)); return ResponseEntity.ok(masterDataService.getBillerByBillerId(billerDetailRequest));
} }
/** Get Master Contact **/ @PostMapping(value = "/getContactMasterResponse")
@PostMapping(value = "/getContactMasterResponse", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Fetch contact master data", description = "Fetch contact master and returns the response")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Fetch contact master response fetch successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> getContactMaster( public ResponseEntity<ResponseModel> getContactMaster(
@Validated @RequestBody ContactMasterRequest contactMasterRequest) { @Validated @RequestBody ContactMasterRequest contactMasterRequest) {
return ResponseEntity.ok(masterDataService.getContactMaster(contactMasterRequest)); return ResponseEntity.ok(masterDataService.getContactMaster(contactMasterRequest));
} }
@PostMapping(value = "/getDispostionDetail", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/getDispostionDetail")
@Operation(summary = "Fetch disposition details", description = "Fetch disposition details for a given ticket and return the response")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Disposition details fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
public ResponseEntity<ResponseModel> getDispostionDetail( public ResponseEntity<ResponseModel> getDispostionDetail(
@Validated @RequestBody DispositionRequest dispositionDetailRequest) { @Validated @RequestBody DispositionRequest dispositionDetailRequest) {
return ResponseEntity.ok(masterDataService.getDispositionDetails(dispositionDetailRequest)); return ResponseEntity.ok(masterDataService.getDispositionDetails(dispositionDetailRequest));
} }
@PostMapping(value = "/getTicketDispositions", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/getTicketDispositions")
@Operation(summary = "Fetch ticket disposition details", description = "Fetch ticket disposition details for a given ticket and return the response")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Ticket disposition details fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
public ResponseEntity<ResponseModel> getTicketDispositions( public ResponseEntity<ResponseModel> getTicketDispositions(
@Validated @RequestBody DispositionRequest dispositionDetailRequest) { @Validated @RequestBody DispositionRequest dispositionDetailRequest) {
return ResponseEntity.ok(masterDataService.getTicketDispositions(dispositionDetailRequest)); return ResponseEntity.ok(masterDataService.getTicketDispositions(dispositionDetailRequest));
} }
/** @PostMapping(value = "/getCustomerParamDetails")
* Get CustomerParam by billerId.The parameter is different from the data we are @Operation(summary = "Fetch customer parameter details by biller ID", description = "API fetches the customer parameter configuration based on the provided biller ID.")
* getting in the billerDetail @ApiResponses(value = {
**/ @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Customer parameter details fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
@PostMapping(value = "/getCustomerParamDetails", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<ResponseModel> getCustomerParamDetails( public ResponseEntity<ResponseModel> getCustomerParamDetails(
@Validated @RequestBody CustomParamRequest customerParamRequest) { @Validated @RequestBody CustomParamRequest customerParamRequest) {
@@ -82,68 +100,68 @@ public class MasterDataController {
return ResponseEntity.ok(masterDataService.getCustomerParamByBillerId(customerParamRequest)); return ResponseEntity.ok(masterDataService.getCustomerParamByBillerId(customerParamRequest));
} }
/**
* Get All Master Data .The parameter is different from the data we are getting
* Made By Arham in the MasterRequest
**/
@PostMapping("/getAllMastersData") @PostMapping("/getAllMastersData")
@Operation(summary = "Fetch all master data", description = "API retrieves all the master data based on the provided .")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Master data fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseModel fetchMasterData(@Validated @RequestBody MasterRequest masterRequest) { public ResponseModel fetchMasterData(@Validated @RequestBody MasterRequest masterRequest) {
return masterDataService.getMasterData(masterRequest); return masterDataService.getMasterData(masterRequest);
} }
/** @PostMapping(value = "/getMasterCategoryWise")
* POST Master CategoryResponseList Wise API Fetch CategoryResponseList Wise @Operation(summary = "Fetch master data category-wise", description = "API retrieves master data based on the selected category.")
* from BBPS URL Made By Arham @ApiResponses(value = {
**/ @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Category-wise master data fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@PostMapping(value = "/getMasterCategoryWise", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiDocCommonResponses
public ResponseEntity<ResponseModel> getMasterDataCategoryWise( public ResponseEntity<ResponseModel> getMasterDataCategoryWise(
@Valid @RequestBody MasterCategoryRequest masterRequest) { @Valid @RequestBody MasterCategoryRequest masterRequest) {
return ResponseEntity.ok(masterDataService.fetchMasterDataCategoryWise(masterRequest)); return ResponseEntity.ok(masterDataService.fetchMasterDataCategoryWise(masterRequest));
} }
/** @PostMapping(value = "/customerParamGroupsByBillerId")
* POST Customer Param Groups API Fetch CategoryResponseList Wise from BBPS URL @Operation(summary = "Fetch customer parameter groups by biller ID", description = "API retrieves all customer parameter groups configured for the specified biller ID.")
* Made By Arham @ApiResponses(value = {
**/ @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Customer parameter groups fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@PostMapping(value = "/customerParamGroupsByBillerId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiDocCommonResponses
public ResponseEntity<ResponseModel> getCustomerParamGroup( public ResponseEntity<ResponseModel> getCustomerParamGroup(
@Validated @RequestBody BillerDetailRequest requestModel) { @Validated @RequestBody BillerDetailRequest requestModel) {
return ResponseEntity.ok(masterDataService.fetchCustomerParamGroup(requestModel)); return ResponseEntity.ok(masterDataService.fetchCustomerParamGroup(requestModel));
} }
/** @PostMapping(value = "/fetchAmountOptionsByBillerId")
* POST Fetch All AMount Options By Biller Id API Fetch CategoryResponseList @Operation(summary = "Fetch all master amount options by biller ID", description = "API retrieves all the master amount options configured for the given biller ID.")
* Wise from BBPS URL Made By Arham @ApiResponses(value = {
**/ @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Master amount options fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@PostMapping(value = "/fetchAmountOptionsByBillerId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiDocCommonResponses
public ResponseEntity<ResponseModel> fetchAllMasterAmountOptionsByBillerId( public ResponseEntity<ResponseModel> fetchAllMasterAmountOptionsByBillerId(
@Validated @RequestBody BillerDetailRequest requestModel) { @Validated @RequestBody BillerDetailRequest requestModel) {
return ResponseEntity.ok(masterDataService.fetchAllMasterAmountOption(requestModel)); return ResponseEntity.ok(masterDataService.fetchAllMasterAmountOption(requestModel));
} }
/** @PostMapping(value = "/fetchAllPlanCategoriesByBillerId")
* POST Fetch All AMount Options By Biller Id API Fetch CategoryResponseList @Operation(summary = "Fetch plan categories by biller ID", description = "API retrieves all plan categories available for the specified biller ID.")
* Wise from BBPS URL Made By Arham @ApiResponses(value = {
**/ @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Plan categories fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@PostMapping(value = "/fetchAllPlanCategoriesByBillerId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiDocCommonResponses
public ResponseEntity<ResponseModel> fetchPlanCategories(@Validated @RequestBody BillerDetailRequest requestModel) { public ResponseEntity<ResponseModel> fetchPlanCategories(@Validated @RequestBody BillerDetailRequest requestModel) {
return ResponseEntity.ok(masterDataService.fetchPlanCategorie(requestModel)); return ResponseEntity.ok(masterDataService.fetchPlanCategorie(requestModel));
} }
/** @PostMapping(value = "/initiatingChannel")
* POST Fetch Initiating Channel API Fetch CategoryResponseList Wise from BBPS @Operation(summary = "Fetch initiating channel details by biller ID", description = "API retrieves initiating channel information configured for the specified biller ID.")
* URL Made By Arham @ApiResponses(value = {
**/ @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Initiating channel details fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@PostMapping(value = "/initiatingChannel", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiDocCommonResponses
public ResponseEntity<ResponseModel> initiatingChannel(@Validated @RequestBody BillerDetailRequest requestModel) { public ResponseEntity<ResponseModel> initiatingChannel(@Validated @RequestBody BillerDetailRequest requestModel) {
return ResponseEntity.ok(masterDataService.fetchInitiatingChannel(requestModel)); return ResponseEntity.ok(masterDataService.fetchInitiatingChannel(requestModel));
} }
/** @PostMapping(value = "/fetchPlanByCategoryName")
* POST Fetch All AMount Options By Biller Id API Fetch CategoryResponseList @Operation(summary = "Fetch plans by category name", description = "API retrieves all available plans for the specified category name.")
* Wise from BBPS Made By Arham URL @ApiResponses(value = {
**/ @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Plans fetched successfully based on category name", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@PostMapping(value = "/fetchPlanByCategoryName", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiDocCommonResponses
public ResponseEntity<ResponseModel> fetchPlanByCategory(@Validated @RequestBody PlanRequest requestModel) { public ResponseEntity<ResponseModel> fetchPlanByCategory(@Validated @RequestBody PlanRequest requestModel) {
return ResponseEntity.ok(masterDataService.fetchPlanByCategories(requestModel)); return ResponseEntity.ok(masterDataService.fetchPlanByCategories(requestModel));
} }
@@ -12,10 +12,16 @@ import com.billpaymentservice.bbps.dto.ResponseModel;
import com.billpaymentservice.bbps.dto.request.BillPaymentRequest; import com.billpaymentservice.bbps.dto.request.BillPaymentRequest;
import com.billpaymentservice.bbps.dto.request.TransactionStatusRequest; import com.billpaymentservice.bbps.dto.request.TransactionStatusRequest;
import com.billpaymentservice.bbps.dto.request.TrasactionStatusByClientReqIdRequest; import com.billpaymentservice.bbps.dto.request.TrasactionStatusByClientReqIdRequest;
import com.billpaymentservice.bbps.dto.response.TransactionStatusResponse;
import com.billpaymentservice.bbps.service.PaymentService; import com.billpaymentservice.bbps.service.PaymentService;
import com.billpaymentservice.bbps.service.PaymentStartService; import com.billpaymentservice.bbps.service.PaymentStartService;
import com.billpaymentservice.bbps.dto.request.PaymentStartUserRequest; import com.billpaymentservice.bbps.util.ApiDocCommonResponses;
import com.billpaymentservice.bbps.util.BBPSConstant;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
@RestController @RestController
@RequestMapping("/agent/payment") @RequestMapping("/agent/payment")
@@ -28,21 +34,28 @@ public class PaymentController {
private final PaymentService paymentService; private final PaymentService paymentService;
private final PaymentStartService paymentStartService; private final PaymentStartService paymentStartService;
// New constructor used by Spring to inject both services
public PaymentController(PaymentService paymentService, PaymentStartService paymentStartService) { public PaymentController(PaymentService paymentService, PaymentStartService paymentStartService) {
this.paymentService = paymentService; this.paymentService = paymentService;
this.paymentStartService = paymentStartService; this.paymentStartService = paymentStartService;
} }
@PostMapping(value = "/intiatePayment", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/intiatePayment")
@Operation(summary = "Initiate payment request", description = "This API initiates the payment process for the provided bill payment request.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Payment initiated successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> requestBillFetch( public ResponseEntity<ResponseModel> requestBillFetch(
@Validated @RequestBody BillPaymentRequest billPaymentRequest) { @RequestBody BillPaymentRequest billPaymentRequest) {
ResponseModel response = paymentService.initiatePayment(billPaymentRequest); ResponseModel response = paymentService.initiatePayment(billPaymentRequest);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
@PostMapping(value = "/checkTransactionStatus", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/checkTransactionStatus")
@Operation(summary = "Check transaction status", description = "This API checks the current status of a bill payment transaction using transactionId or clientReqId.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Transaction status fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> checkTransactionStatus( public ResponseEntity<ResponseModel> checkTransactionStatus(
@Validated @RequestBody TransactionStatusRequest transactionStatusRequest) { @Validated @RequestBody TransactionStatusRequest transactionStatusRequest) {
@@ -50,16 +63,16 @@ public class PaymentController {
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
@PostMapping(value = "/checkTransactionStatusByClientReqId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/checkTransactionStatusByClientReqId")
@Operation(summary = "Check transaction status by client request ID", description = "This API checks the payment transaction status using the client-generated request ID (clientReqId).")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Transaction status fetched successfully using clientReqId", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> checkTransactionStatusByClientReqId( public ResponseEntity<ResponseModel> checkTransactionStatusByClientReqId(
@Validated @RequestBody TrasactionStatusByClientReqIdRequest transactionStatusRequest) { @Validated @RequestBody TrasactionStatusByClientReqIdRequest transactionStatusRequest) {
ResponseModel response = paymentService.checkTrasactionStatusByClientReqId(transactionStatusRequest); ResponseModel response = paymentService.checkTrasactionStatusByClientReqId(transactionStatusRequest);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
} }
@@ -0,0 +1,42 @@
package com.billpaymentservice.bbps.controller;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.billpaymentservice.bbps.dto.ResponseModel;
import com.billpaymentservice.bbps.dto.request.PollBackRequest;
import com.billpaymentservice.bbps.service.PollBackService;
import com.billpaymentservice.bbps.util.ApiDocCommonResponses;
import com.billpaymentservice.bbps.util.BBPSConstant;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
@RequestMapping("/payment")
@RestController
public class PaymentPollBackController {
private final PollBackService pollBackService;
public PaymentPollBackController(PollBackService pollBackService) {
this.pollBackService = pollBackService;
}
@PostMapping(value = "/pollback")
@Operation(summary = "Process poll-back request", description = "This API handles the poll-back request from biller.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Poll Back processed successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> startIntentPayment(@Validated @RequestBody PollBackRequest pollBackRequest) {
ResponseModel response = pollBackService.managePollBack(pollBackRequest);
return ResponseEntity.ok(response);
}
}
@@ -12,9 +12,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.billpaymentservice.bbps.dto.ResponseModel; import com.billpaymentservice.bbps.dto.ResponseModel;
import com.billpaymentservice.bbps.dto.request.PaymentStartUserRequest;
import com.billpaymentservice.bbps.dto.request.CallbackRequest; import com.billpaymentservice.bbps.dto.request.CallbackRequest;
import com.billpaymentservice.bbps.dto.request.PaymentStartUserRequest;
import com.billpaymentservice.bbps.service.PaymentStartService; import com.billpaymentservice.bbps.service.PaymentStartService;
import com.billpaymentservice.bbps.util.ApiDocCommonResponses;
import com.billpaymentservice.bbps.util.BBPSConstant;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
@RestController @RestController
@RequestMapping("/payment") @RequestMapping("/payment")
@@ -24,15 +32,24 @@ public class PaymentStartController {
public PaymentStartController(PaymentStartService paymentStartService) { public PaymentStartController(PaymentStartService paymentStartService) {
this.paymentStartService = paymentStartService; this.paymentStartService = paymentStartService;
} }
@PostMapping(value = "/startWebPayment", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<ResponseModel> startWebPayment(@Validated @RequestBody PaymentStartUserRequest paymentStartUserRequest) {
ResponseModel response = paymentStartService.startWebPayment(paymentStartUserRequest);
return ResponseEntity.ok(response);
}
@PostMapping(value = "/callback/startPayment", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/startWebPayment")
@Operation(summary = "Start web payment process", description = "This API initiates the payment process for a web-based transaction using user and bill details.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Payment process started successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> startWebPayment(
@Validated @RequestBody PaymentStartUserRequest paymentStartUserRequest) {
ResponseModel response = paymentStartService.startWebPayment(paymentStartUserRequest);
return ResponseEntity.ok(response);
}
@PostMapping(value = "/callback/startPayment")
@Operation(summary = "Handle start payment callback", description = "This callback API is invoked by the payment gateway/BBPS to confirm the payment initiation status.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Start Payment Callback handled successfully", content = @Content(mediaType = "application/json")) })
@ApiDocCommonResponses
public ResponseEntity<Map<String, String>> handleCallback(@RequestBody CallbackRequest callbackRequest) { public ResponseEntity<Map<String, String>> handleCallback(@RequestBody CallbackRequest callbackRequest) {
ResponseModel resp = paymentStartService.handleStartCallback(callbackRequest); ResponseModel resp = paymentStartService.handleStartCallback(callbackRequest);
Map<String, String> result = new HashMap<>(); Map<String, String> result = new HashMap<>();
@@ -40,14 +57,17 @@ public class PaymentStartController {
result.put("status", resp.getStatus()); result.put("status", resp.getStatus());
return ResponseEntity.ok(result); return ResponseEntity.ok(result);
} }
@PostMapping(value = "/startIntentPayment", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/startIntentPayment")
public ResponseEntity<ResponseModel> startIntentPayment(@Validated @RequestBody PaymentStartUserRequest paymentStartUserRequest) { @Operation(summary = "Start intent payment process", description = "This API initiates the intent-based payment process for a user.")
if (this.paymentStartService == null) { @ApiResponses(value = {
// Defensive: if bean not injected, return failure @ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Intent payment started successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))), })
return ResponseEntity.badRequest().body(new ResponseModel("PaymentStartService not available", "FAILED", 400, null)); @ApiDocCommonResponses
} public ResponseEntity<ResponseModel> startIntentPayment(
ResponseModel response = paymentStartService.startIntentPayment(paymentStartUserRequest); @Validated @RequestBody PaymentStartUserRequest paymentStartUserRequest) {
return ResponseEntity.ok(response); ResponseEntity.badRequest().body(new ResponseModel("PaymentStartService not available", "FAILED", 400, null));
}
ResponseModel response = paymentStartService.startIntentPayment(paymentStartUserRequest);
return ResponseEntity.ok(response);
}
} }
@@ -13,7 +13,14 @@ import com.billpaymentservice.bbps.dto.ResponseModel;
import com.billpaymentservice.bbps.dto.request.PaymentHistoryByTxnRequest; import com.billpaymentservice.bbps.dto.request.PaymentHistoryByTxnRequest;
import com.billpaymentservice.bbps.dto.request.PaymentHistoryRequest; import com.billpaymentservice.bbps.dto.request.PaymentHistoryRequest;
import com.billpaymentservice.bbps.service.TxnHistoryService; import com.billpaymentservice.bbps.service.TxnHistoryService;
import com.billpaymentservice.bbps.util.ApiDocCommonResponses;
import com.billpaymentservice.bbps.util.BBPSConstant;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@RestController @RestController
@@ -29,15 +36,23 @@ public class TxnHistoryController {
} }
@PostMapping(value = "/paymentHistoryDetails", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/paymentHistoryDetails")
@Operation(summary = "Get payment history details", description = "This API retrieves the payment history for a user based.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Payment history fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> getPaymentHistory( public ResponseEntity<ResponseModel> getPaymentHistory(
@Validated @RequestBody PaymentHistoryRequest paymentHistoryRequest) { @Validated @RequestBody PaymentHistoryRequest paymentHistoryRequest) {
ResponseModel response = txnHistory.getPaymentHistoryDetails(paymentHistoryRequest); ResponseModel response = txnHistory.getPaymentHistoryDetails(paymentHistoryRequest);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
@PostMapping(value = "/paymentHistoryByTxnId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/paymentHistoryByTxnId")
@Operation(summary = "Get payment history by transaction ID", description = "This API retrieves the payment details for a specific transaction using the provided transaction ID.")
@ApiResponses(value = {
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Payment history fetched successfully by transaction ID", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
@ApiDocCommonResponses
public ResponseEntity<ResponseModel> getPaymentHistoryByTxnId( public ResponseEntity<ResponseModel> getPaymentHistoryByTxnId(
@Validated @RequestBody PaymentHistoryByTxnRequest request) { @Validated @RequestBody PaymentHistoryByTxnRequest request) {
@@ -0,0 +1,13 @@
package com.billpaymentservice.bbps.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class PaymentPollBackResponse {
private String txnId;
private String orderId;
private String txnStatus;
}
@@ -1,5 +1,6 @@
package com.billpaymentservice.bbps.dto; package com.billpaymentservice.bbps.dto;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -10,6 +11,7 @@ import lombok.Setter;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class Tag { public class Tag {
private String name;
private String value; private String name;
private String value;
} }
@@ -13,19 +13,20 @@ import lombok.Setter;
@AllArgsConstructor @AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class AuthResponse { public class AuthResponse {
private boolean success; private boolean success;
private String message; private String message;
private boolean userExists; private boolean userExists;
private UserDto user; private Object user;
private String token; private String token;
public AuthResponse(boolean success, String message, boolean userExists, UserDto user) { public AuthResponse(boolean success, String message, String token, Object user) {
this.success = success; this.success = success;
this.message = message; this.message = message;
this.userExists = userExists; this.token = token;
this.user = user; this.user = user;
} }
public AuthResponse(boolean success, String message, String token) {
public AuthResponse(boolean success, String message, String token) {
this.success = success; this.success = success;
this.message = message; this.message = message;
this.token = token; this.token = token;
@@ -1,19 +1,28 @@
package com.billpaymentservice.bbps.dto.auth; package com.billpaymentservice.bbps.dto.auth;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
public class LoginRequest { public class LoginRequest {
private String mobile;
public LoginRequest() {} @NotNull(message = "Mobile number cannot be null.")
@Size(min = 10, max = 10, message = "Mobile number must be exactly 10 digits.")
@Pattern(regexp = "^[0-9]{10}$", message = "Mobile number must contain only digits.")
private String mobile;
public LoginRequest(String mobile) { public LoginRequest() {
this.mobile = mobile; }
}
public String getMobile() { public LoginRequest(String mobile) {
return mobile; this.mobile = mobile;
} }
public void setMobile(String mobile) { public String getMobile() {
this.mobile = mobile; return mobile;
} }
public void setMobile(String mobile) {
this.mobile = mobile;
}
} }
@@ -2,15 +2,31 @@ package com.billpaymentservice.bbps.dto.auth;
import com.billpaymentservice.bbps.dto.request.BaseClass; import com.billpaymentservice.bbps.dto.request.BaseClass;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class RegisterRequest extends BaseClass { public class RegisterRequest extends BaseClass {
@NotNull(message = "Mobile number cannot be null.")
@Size(min = 10, max = 10, message = "Mobile number must be exactly 10 digits.")
@Pattern(regexp = "^[0-9]{10}$", message = "Mobile number must contain only 10 digits.")
private String mobile; private String mobile;
@NotNull(message = "Name cannot be null.")
@Size(min = 2, max = 100, message = "Name must be between 2 and 100 characters.")
private String name; private String name;
@NotNull(message = "Email cannot be null.")
@Email(message = "Email must be a valid email address.")
private String email; private String email;
@NotNull(message = "Registration token cannot be null.")
private String registrationToken; private String registrationToken;
} }
@@ -10,7 +10,7 @@ import lombok.Setter;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class UserDto { public class UserDto {
private Long id; private String userId;
private String mobile; private String mobile;
private String name; private String name;
private String email; private String email;
@@ -1,30 +1,42 @@
package com.billpaymentservice.bbps.dto.auth; package com.billpaymentservice.bbps.dto.auth;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
public class VerifyOtpRequest { public class VerifyOtpRequest {
private String mobile;
private String otp;
public VerifyOtpRequest() { @NotNull(message = "Mobile number cannot be null.")
} @Size(min = 10, max = 10, message = "Mobile number must be exactly 10 digits.")
@Pattern(regexp = "^[0-9]{10}$", message = "Mobile number must contain only digits.")
private String mobile;
public VerifyOtpRequest(String mobile, String otp) { @NotNull(message = "OTP cannot be null.")
this.mobile = mobile; @Size(min = 6, max = 6, message = "OTP must be exactly 6 digits.")
this.otp = otp; @Pattern(regexp = "^[0-9]{6}$", message = "OTP must contain only 6 digits.")
} private String otp;
public String getMobile() { public VerifyOtpRequest() {
return mobile; }
}
public void setMobile(String mobile) { public VerifyOtpRequest(String mobile, String otp) {
this.mobile = mobile; this.mobile = mobile;
} this.otp = otp;
}
public String getOtp() { public String getMobile() {
return otp; return mobile;
} }
public void setOtp(String otp) { public void setMobile(String mobile) {
this.otp = otp; this.mobile = mobile;
} }
public String getOtp() {
return otp;
}
public void setOtp(String otp) {
this.otp = otp;
}
} }
@@ -1,5 +1,7 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -7,4 +9,10 @@ import lombok.Setter;
@Setter @Setter
public class AllMasterOptionsRequest extends BaseClass { public class AllMasterOptionsRequest extends BaseClass {
private Integer pageNo = 0;
@NotNull(message = "pageEnd is required")
@Min(value = 1, message = "pageEnd must be greater than 0")
private Integer pageSize;
} }
@@ -1,6 +1,6 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -12,7 +12,7 @@ import lombok.Setter;
@NoArgsConstructor @NoArgsConstructor
public class BillFetchByBillIdRequest extends BaseClass { public class BillFetchByBillIdRequest extends BaseClass {
@NotNull @NotBlank(message = "bill id not be null")
private String billId; private String billId;
} }
@@ -1,6 +1,9 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import java.util.List; import java.util.List;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -8,25 +11,37 @@ import lombok.Setter;
@Setter @Setter
public class BillPaymentRequest extends BaseClass { public class BillPaymentRequest extends BaseClass {
private String tenantId; private String refId;
private String refId;
private String billId;
private boolean amountOptions;
private String paymentMode;
private String paymentInformation;
private String billerId;
private String billerName;
private String billerCategory;
private String macAdress;
private String customerMobNo;
private Integer txnAmount;
private String paymentRefId;
private String clientReqId;
private String paymentChannel;
private List<DeviceBlockTagRequest> deviceBlockTags; private String billId;
private List<CustomerParamTagRequest> customerParamsRequest;
private List<RemitterIdentityRequest> remitterIdentity; // Change the field to Boolean (wrapper) type to allow @NotNull validation
private List<AmountBreakRequest> amountBreakSet; private boolean amountOptions; // Changed to Boolean (wrapper type)
private String paymentMode;
private String paymentInformation;
private String billerId;
private String billerName;
private String billerCategory;
private String macAdress;
private String customerMobNo;
private Integer txnAmount; // Changed to @NotNull as it's an Integer (non-nullable)
private String paymentRefId;
private String clientReqId;
private String paymentChannel;
private List<DeviceBlockTagRequest> deviceBlockTags;
private List<CustomerParamTagRequest> customerParams;
private List<RemitterIdentityRequest> remitterIdentity;
private List<AmountBreakRequest> amountBreakSet;
} }
@@ -1,5 +1,6 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -10,7 +11,7 @@ import lombok.ToString;
@ToString(callSuper = true) @ToString(callSuper = true)
public class BillerDetailRequest extends BaseClass{ public class BillerDetailRequest extends BaseClass{
@NotNull @NotBlank(message = "biller id not be null")
private String billerId; private String billerId;
} }
@@ -1,8 +1,13 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.NotBlank;
public class CallbackRequest { public class CallbackRequest {
@NotBlank(message = "mid is mandatory")
private String mid; private String mid;
@NotBlank(message = "data is mandatory")
private String data; private String data;
@NotBlank(message = "signature is mandatory")
private String signature; private String signature;
public String getMid() { public String getMid() {
@@ -1,7 +1,6 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -1,5 +1,7 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -7,9 +9,16 @@ import lombok.Setter;
@Setter @Setter
public class ComplaintRequestDTO extends BaseClass { public class ComplaintRequestDTO extends BaseClass {
private String ticketDescription; // Complaint description that the user enters @NotBlank(message = "Ticket description cannot be null.")
private String ticketDisposition; // Complaint disposition private String ticketDescription;
private String ticketDispositionCode; // Type of complaint
private String txnId; // Transaction ID (optional) @NotBlank(message = "Ticket disposition cannot be null.")
private String ticketDisposition;
@NotBlank(message = "Ticket disposition code cannot be null.")
private String ticketDispositionCode;
@NotBlank(message = "Transaction ID cannot be null.")
private String txnId;
} }
@@ -1,6 +1,6 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -14,6 +14,6 @@ import lombok.ToString;
@ToString @ToString
public class CustomParamRequest extends BaseClass { public class CustomParamRequest extends BaseClass {
@NotNull @NotBlank(message = "biller id not be null")
private String billerId; private String billerId;
} }
@@ -6,11 +6,13 @@ import com.billpaymentservice.bbps.dto.CustomerParamsRequest;
import com.billpaymentservice.bbps.dto.RemitterIdentity; import com.billpaymentservice.bbps.dto.RemitterIdentity;
import com.billpaymentservice.bbps.dto.Tag; import com.billpaymentservice.bbps.dto.Tag;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import lombok.ToString; import lombok.ToString;
@Getter @Getter
@Setter @Setter
@AllArgsConstructor @AllArgsConstructor
@@ -18,19 +20,29 @@ import lombok.ToString;
@ToString @ToString
public class FetchBillRequest extends BaseClass { public class FetchBillRequest extends BaseClass {
// private String tenantId; // M @NotBlank(message = "biller id not be null")
private String billerId; // M private String billerId;
private String billerName; //M
// private String digiledgeKey; // M @NotBlank(message = "biller name not be null")
// private String agentId; // M private String billerName;
private String billerCategory; // M
private String clientReqId; // C @NotBlank(message = "biller category not be null")
private String macAdress; // C private String billerCategory;
private String customerMobNo; // M
private String remitterName; // O private String clientReqId;
private String paymentChannel; // M private String macAdress;
private List<Tag> deviceBlockTags; // M
private CustomerParamsRequest customerParamsRequest; // M @NotBlank(message = "customer mob no not be null")
private List<RemitterIdentity> remitterIdentity; // O private String customerMobNo;
private String remitterName;
@NotBlank(message = "payment channel not be null")
private String paymentChannel;
private List<Tag> deviceBlockTags;
private CustomerParamsRequest customerParamsRequest;
private List<RemitterIdentity> remitterIdentity;
} }
@@ -2,6 +2,7 @@ package com.billpaymentservice.bbps.dto.request;
import com.billpaymentservice.bbps.dto.CustomerParamsRequest; import com.billpaymentservice.bbps.dto.CustomerParamsRequest;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@@ -14,18 +15,18 @@ import lombok.Setter;
@NoArgsConstructor @NoArgsConstructor
public class FetchBillValidatestRequest extends BaseClass { public class FetchBillValidatestRequest extends BaseClass {
@NotNull @NotBlank(message = "biller id not be null")
private String billerId; // Alphanumeric, Unique ID assigned by NPCI private String billerId;
@NotNull @NotBlank(message = "biller name not be null")
private String billerName; // String, Name of the biller private String billerName;
@NotNull @NotBlank(message = "biller category not be null")
private String billerCategory; // String, CategoryResponseList of the biller private String billerCategory;
@NotNull @NotBlank(message = "biller mob no not be null")
private String customerMobNo; // String, Mobile of the Customer private String customerMobNo;
private String clientReqId; private String clientReqId;
// Optional Fields // Optional Fields
private String macAddress; // Alphanumeric MAC Address of the Agent Server private String macAddress;
//private String clientReqId; // String, Unique id provided by the client // private String clientReqId;
private CustomerParamsRequest customerParamsRequest; // Customer parameters for identifying the bill private CustomerParamsRequest customerParamsRequest; // Customer parameters for identifying the bill
} }
@@ -1,6 +1,7 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.Min; import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@@ -15,7 +16,7 @@ public class MasterCategoryRequest extends BaseClass {
private String billerName; private String billerName;
@NotNull @NotBlank(message = "category name not be null")
private String category; private String category;
private Integer pageNo = 0; private Integer pageNo = 0;
@@ -1,5 +1,7 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -7,4 +9,10 @@ import lombok.Setter;
@Setter @Setter
public class PaymentHistoryRequest extends BaseClass { public class PaymentHistoryRequest extends BaseClass {
private Integer pageNo = 0;
@NotNull(message = "pageEnd is required")
@Min(value = 1, message = "pageEnd must be greater than 0")
private Integer pageSize;
} }
@@ -2,6 +2,7 @@ package com.billpaymentservice.bbps.dto.request;
import java.io.Serializable; import java.io.Serializable;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -13,14 +14,21 @@ import lombok.Setter;
@AllArgsConstructor @AllArgsConstructor
// DTO representing the user request payload described by the user // DTO representing the user request payload described by the user
public class PaymentStartUserRequest extends BaseClass implements Serializable { public class PaymentStartUserRequest extends BaseClass implements Serializable {
@NotBlank(message = "amount can not be null")
private String amount; private String amount;
private String currency; @NotBlank(message = "currency can not be null")
private String emailId; String currency;
@NotBlank(message = "customerVpa can not be null")
private String customerVpa; private String customerVpa;
private String mobileNo; @NotBlank(message = "txnReqType can not be null")
private String respUrl;
private String txnReqType; private String txnReqType;
@NotBlank(message = "udf1(Latitude) can not be null")
private String udf1;
@NotBlank(message = "udf2(Longitude) can not be null")
private String udf2;
private String emailId;
private String mobileNo;
private String name; private String name;
} }
@@ -1,6 +1,8 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -26,8 +28,9 @@ public class PlanRequest extends BaseClass {
private String circle; private String circle;
// ✅ Optional pagination parameters private Integer page = 0;
private Integer page;
@NotNull(message = "pageEnd is required")
@Min(value = 1, message = "pageEnd must be greater than 0")
private Integer pagesize; private Integer pagesize;
} }
@@ -0,0 +1,13 @@
package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class PollBackRequest extends BaseClass {
@NotBlank(message = "order Id not be null")
private String orderId;
}
@@ -1,15 +1,18 @@
package com.billpaymentservice.bbps.dto.request; package com.billpaymentservice.bbps.dto.request;
import jakarta.validation.constraints.Min;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class ViewAllComplaintsTicketsRequest extends BaseClass{ public class ViewAllComplaintsTicketsRequest extends BaseClass {
private String statusType; // e.g. COMPLAINT_OPEN_SUCCESS private String statusType; // e.g. COMPLAINT_OPEN_SUCCESS
private Integer pageNo; // default 0 @Min(value = 0, message = "Page number must be a non-negative integer.")
private Integer pageSize; // default 10 private Integer pageNo;
@Min(value = 1, message = "Page size must be at least 1.")
private Integer pageSize;
private String ticketType; // default 10 private String ticketType; // default 10
} }
@@ -1,6 +1,7 @@
package com.billpaymentservice.bbps.dto.response; package com.billpaymentservice.bbps.dto.response;
import com.billpaymentservice.bbps.dto.TicketDetailsDTO; import com.billpaymentservice.bbps.dto.TicketDetailsDTO;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
@@ -9,9 +10,13 @@ public class TicketCheckStatusResponse {
private String refId; private String refId;
private TicketDetailsDTO ticketDetails; private TicketDetailsDTO ticketDetails;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private String message; private String message;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private String remarks; private String remarks;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private String status; private String status;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private String statusCode; private String statusCode;
} }
@@ -18,7 +18,7 @@ import lombok.ToString;
@Setter @Setter
@Entity @Entity
@ToString @ToString
@Table(name = "additional_info") @Table(name = "bbps_additional_info")
public class AdditionalInfo { public class AdditionalInfo {
@Id @Id
@@ -26,11 +26,9 @@ public class AdditionalInfo {
private Long id; // primary key for the table private Long id; // primary key for the table
@Column(name = "param_config_id", nullable = false) @Column(name = "param_config_id", nullable = false)
@NotBlank(message = "Param Config ID cannot be blank")
private String paramConfigId; private String paramConfigId;
@Column(name = "param_name", nullable = false) @Column(name = "param_name", nullable = false)
@NotBlank(message = "Param name cannot be blank")
private String paramName; private String paramName;
@Column(name = "data_type_dao") @Column(name = "data_type_dao")
@@ -12,10 +12,10 @@ import lombok.Setter;
@Entity @Entity
@Table(name = "additional_info_bill") @Table(name = "bbps_additional_info_bill")
@Getter @Getter
@Setter @Setter
public class AdditionalInfoBill { public class AdditionalInfoBill extends Auditable {
@Id @Id
@GeneratedValue @GeneratedValue
private Long id; private Long id;
@@ -27,4 +27,4 @@ public class AdditionalInfoBill {
@JoinColumn(name = "bill_master_id") @JoinColumn(name = "bill_master_id")
private BillMaster billMaster; private BillMaster billMaster;
} }
@@ -11,10 +11,10 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "additional_info_bill_validate") @Table(name = "bbps_additional_info_bill_validate")
@Getter @Getter
@Setter @Setter
public class AdditionalInfoBillValidate { public class AdditionalInfoBillValidate extends Auditable {
@Id @Id
@GeneratedValue @GeneratedValue
private Long id; private Long id;
@@ -26,4 +26,4 @@ public class AdditionalInfoBillValidate {
@JoinColumn(name = "bill_id_fk") @JoinColumn(name = "bill_id_fk")
private BillValidation bill; private BillValidation bill;
} }
@@ -16,10 +16,10 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "plan_additional_info") @Table(name = "bbps_plan_additional_info")
@Getter @Getter
@Setter @Setter
public class AdditionalInfoPlans { public class AdditionalInfoPlans extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -30,4 +30,4 @@ public class AdditionalInfoPlans {
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "additionalInfo") @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "additionalInfo")
private List<PlanTag> tags; private List<PlanTag> tags;
} }
@@ -10,12 +10,12 @@ import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "agent_fund_transfer_Txn_Status") @Table(name = "bbps_agent_fund_transfer_Txn_Status")
@NoArgsConstructor @NoArgsConstructor
@Getter @Getter
@Setter @Setter
@AllArgsConstructor @AllArgsConstructor
public class AgentFundTransfer { public class AgentFundTransfer extends Auditable {
@Id @Id
@@ -53,4 +53,4 @@ public class AgentFundTransfer {
@Column(name = "fund_status") @Column(name = "fund_status")
private String fundStatus; private String fundStatus;
} }
@@ -13,8 +13,8 @@ import lombok.Setter;
@Entity @Entity
@Getter @Getter
@Setter @Setter
@Table(name = "agent_fund_transfer") @Table(name = "bbps_agent_fund_transfer")
public class AgentFundTransferEntity { public class AgentFundTransferEntity extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -33,5 +33,4 @@ public class AgentFundTransferEntity {
private String agentNpciId; private String agentNpciId;
private String txnRefId; private String txnRefId;
private String fundStatus; private String fundStatus;
} }
@@ -16,10 +16,10 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "amount_option") @Table(name = "bbps_amount_option")
@Getter @Getter
@Setter @Setter
public class AmountOption { public class AmountOption extends Auditable {
@Id @Id
@Column(name = "amount_option_id") @Column(name = "amount_option_id")
@@ -2,8 +2,6 @@ package com.billpaymentservice.bbps.entites;
import java.util.List; import java.util.List;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.CascadeType; import jakarta.persistence.CascadeType;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@@ -19,8 +17,9 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "amount_option_biller_id")
public class AmountOptionByBillerId extends Auditable<String> { @Table(name = "bbps_amount_option_biller_id")
public class AmountOptionByBillerId extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -33,4 +32,4 @@ public class AmountOptionByBillerId extends Auditable<String> {
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true) @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name = "amount_option_id_long") // Foreign key field that links to the 'Long' column @JoinColumn(name = "amount_option_id_long") // Foreign key field that links to the 'Long' column
private List<AmountOptionDetails> amountOptionDetails; // List of AmountOptionDetails private List<AmountOptionDetails> amountOptionDetails; // List of AmountOptionDetails
} }
@@ -12,8 +12,9 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "amount_option_details") @Table(name = "bbps_amount_option_details")
public class AmountOptionDetails {
public class AmountOptionDetails extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -35,4 +36,7 @@ public class AmountOptionDetails {
@Column(name = "txn_id") @Column(name = "txn_id")
private String txnId; private String txnId;
} @Column(name = "user_id")
private String userId;
}
@@ -0,0 +1,74 @@
package com.billpaymentservice.bbps.entites;
import java.lang.reflect.Field;
import java.time.LocalDateTime;
import jakarta.persistence.PrePersist;
import jakarta.persistence.PreUpdate;
public class AuditListener {
@PrePersist
public void prePersist(Object entity) {
LocalDateTime now = LocalDateTime.now();
// Creation fields
setIfNull(entity, "createDateTime", now);
setIfNull(entity, "createdBy", null); // handle manually in service if needed
setIfNull(entity, "createdEpochDate", System.currentTimeMillis());
// Set isDeleted = false on creation
setAlways(entity, "isDeleted", Boolean.FALSE);
}
/*
* @PreUpdate public void preUpdate(Object entity) { LocalDateTime now =
* LocalDateTime.now();
*
* // Update fields setAlways(entity, "updatedDateTime", now); setIfNull(entity,
* "updatedBy", null); // you can override manually in service setAlways(entity,
* "modifiedEpochDate", System.currentTimeMillis()); }
*/
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 currentValue = f.get(entity);
if (currentValue == null) {
f.set(entity, value);
}
f.setAccessible(accessible);
} catch (Exception ignored) {}
}
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 ignored) {}
}
private Field findField(Class<?> cls, String name) {
Class<?> current = cls;
while (current != null && current != Object.class) {
try {
return current.getDeclaredField(name);
} catch (NoSuchFieldException e) {
current = current.getSuperclass();
}
}
return null;
}
}
@@ -0,0 +1,41 @@
package com.billpaymentservice.bbps.entites;
import java.time.LocalDateTime;
import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import lombok.Setter;
/**
* Base mapped superclass for audit fields. All JPA entities should extend this to
* get automatic population of createdAt/updatedAt/isDeleted via AuditListener.
*/
@MappedSuperclass
@EntityListeners(AuditListener.class)
@Getter
@Setter
public abstract class Auditable {
@Column(name = "create_date_time")
private LocalDateTime createDateTime;
@Column(name = "updated_date_time")
private LocalDateTime updatedDateTime;
@Column(name = "create_by")
private LocalDateTime createdBy;
@Column(name = "updated_by")
private LocalDateTime updatedBy;
@Column(name = "created_epoch_date")
private Long createdEpochDate;
@Column(name = "modified_epoch_date")
private Long modifiedEpochDate;
@Column(name = "is_deleted")
private Boolean isDeleted = Boolean.FALSE;
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
@@ -21,7 +19,7 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Table(name = "bbps_master_data") @Table(name = "bbps_master_data")
public class BBPSMastersData extends Auditable<String> { public class BBPSMastersData extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -43,4 +41,4 @@ public class BBPSMastersData extends Auditable<String> {
@Column(name = "user_name") @Column(name = "user_name")
private String userName; private String userName;
} }
@@ -17,7 +17,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor @NoArgsConstructor
@Builder @Builder
@Table(name = "bbps_merchant_validation") @Table(name = "bbps_merchant_validation")
public class BBPSMerchantValidation { public class BBPSMerchantValidation extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -42,5 +42,5 @@ public class BBPSMerchantValidation {
private String txtId; private String txtId;
private boolean is_deleted; // Removed local is_deleted field, now handled by Auditable
} }
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@@ -17,8 +15,8 @@ import lombok.Setter;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Entity @Entity
@Table(name = "Bharat_connect_master") @Table(name = "bbps_bharat_connect_master")
public class BharatConnectMaster extends Auditable<String> { public class BharatConnectMaster extends Auditable {
@Id @Id
@Column(name = "org_id", nullable = false, unique = true, length = 50) @Column(name = "org_id", nullable = false, unique = true, length = 50)
@@ -46,4 +44,4 @@ public class BharatConnectMaster extends Auditable<String> {
@Column(name = "is_active") @Column(name = "is_active")
private boolean isActive=false; private boolean isActive=false;
} }
@@ -13,8 +13,9 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "bill_additional_info") @Table(name = "bbps_bill_additional_info")
public class BillAdditionalInfo {
public class BillAdditionalInfo extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -28,4 +29,4 @@ public class BillAdditionalInfo {
@JoinColumn(name = "biller_response_id") @JoinColumn(name = "biller_response_id")
private CheckClientBillerData billerResponse; private CheckClientBillerData billerResponse;
} }
@@ -1,5 +1,6 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
@@ -13,8 +14,8 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "bill_customer_params") @Table(name = "bbps_bill_customer_params")
public class BillCustomerParams { public class BillCustomerParams extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -1,4 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@@ -11,16 +12,20 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Entity @Entity
@Table(name = "bill_initiate") @Table(name = "bbps_bill_initiate")
public class BillInitiate {
@Id public class BillInitiate extends Auditable {
@Column(name = "req_id") @Id
private String reqId; @Column(name = "req_id")
private String reqId;
@Column(name = "bill_id", nullable = false)
private String billId; @Column(name = "bill_id", nullable = false)
private String billId;
@Column(name = "txn_id")
private String txnId; @Column(name = "txn_id")
private String txnId;
}
@Column(name = "client_user_id")
private String clientUserId;
}
@@ -1,7 +1,9 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import java.util.List; import java.util.List;
import jakarta.persistence.CascadeType; import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinColumn;
@@ -15,35 +17,32 @@ import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "bill_master") @Table(name = "bbps_bill_master")
@Builder @Builder
@Getter @Getter
@Setter @Setter
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class BillMaster { public class BillMaster extends Auditable {
@Id @Id
private String billId; // primary key private String billId; // primary key
private String reqId; // client se aaya hua private String reqId; // client se aaya hua
private String txnId; // system-generated private String txnId; // system-generated
private String refId; private String refId;
private String billerId; private String billerId;
private String status; private String status;
private String actionType; private String actionType;
private String userId; private String clientUserId;
@OneToOne(cascade = CascadeType.ALL) private String userId;
@JoinColumn(name = "biller_response_id") @OneToOne(cascade = CascadeType.ALL)
private BillerResponse billerResponse; @JoinColumn(name = "biller_response_id")
@OneToMany(mappedBy = "billMaster", cascade = CascadeType.ALL) private BillerResponse billerResponse;
private List<AdditionalInfoBill> additionalInfo; @OneToMany(mappedBy = "billMaster", cascade = CascadeType.ALL)
@OneToMany(mappedBy = "billMaster", cascade = CascadeType.ALL) private List<AdditionalInfoBill> additionalInfo;
private List<CustomerParamBill> customerParams; @OneToMany(mappedBy = "billMaster", cascade = CascadeType.ALL)
private String creationDate; private List<CustomerParamBill> customerParams;
private String modifiedDate;
private Long createdEpochDate;
private Long modifiedEpochDate;
// getters and setters // getters and setters
} }
@@ -1,6 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import jakarta.persistence.CascadeType; import jakarta.persistence.CascadeType;
@@ -16,8 +15,9 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "bill_payment") @Table(name = "bbps_bill_payment")
public class BillPayment {
public class BillPayment extends Auditable {
@Id @Id
@Column(name = "txn_id") @Column(name = "txn_id")
@@ -53,10 +53,7 @@ public class BillPayment {
@Column(name = "customer_mobile") @Column(name = "customer_mobile")
private String customerMobNo; private String customerMobNo;
@Column(name = "created_at")
private LocalDateTime createdAt = LocalDateTime.now();
// 🔗 One bill payment has many remitter identities // 🔗 One bill payment has many remitter identities
@OneToMany(mappedBy = "billPayment", cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true) @OneToMany(mappedBy = "billPayment", cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
private List<RemitterIdentity> remitterIdentities; private List<RemitterIdentity> remitterIdentities;
} }
@@ -13,8 +13,9 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "bill_tag_list") @Table(name = "bbps_bill_tag_list")
public class BillTag {
public class BillTag extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -27,4 +28,4 @@ public class BillTag {
@JoinColumn(name = "biller_response_id") @JoinColumn(name = "biller_response_id")
private CheckClientBillerData billerResponse; private CheckClientBillerData billerResponse;
} }
@@ -1,6 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import java.util.List; import java.util.List;
import jakarta.persistence.*; import jakarta.persistence.*;
@@ -9,53 +8,53 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@Entity @Entity
@Table(name = "bill_validation") @Table(name = "bbps_bill_validation")
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class BillValidation { public class BillValidation extends Auditable {
@Id @Id
@Column(name = "bill_id", nullable = false, length = 100) @Column(name = "bill_id", nullable = false, length = 100)
private String billId; private String billId;
@Column(name = "ref_id", length = 100) @Column(name = "ref_id", length = 100)
private String refId; private String refId;
@Column(name = "biller_id", length = 100) @Column(name = "biller_id", length = 100)
private String billerId; private String billerId;
@Column(name = "status", length = 100) @Column(name = "status", length = 100)
private String status; private String status;
@Column(name = "action_type", length = 100) @Column(name = "action_type", length = 100)
private String actionType; private String actionType;
@Column(name = "user_id", length = 100) @Column(name = "user_id", length = 100)
private String userId; private String userId;
@Column(name = "biller_response", columnDefinition = "TEXT") @Column(name = "biller_response", columnDefinition = "TEXT")
private String billerResponse; private String billerResponse;
@OneToMany(mappedBy = "bill", cascade = CascadeType.ALL, fetch = FetchType.LAZY) @OneToMany(mappedBy = "bill", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<AdditionalInfoBillValidate> additionalInfo; private List<AdditionalInfoBillValidate> additionalInfo;
// 👇 Proper nested customer params (OneToMany) // 👇 Proper nested customer params (OneToMany)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bill") @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bill")
private List<CustomerParamBillValidation> customerParams; private List<CustomerParamBillValidation> customerParams;
@Column(name = "plan_info_daos", columnDefinition = "TEXT") @Column(name = "plan_info_daos", columnDefinition = "TEXT")
private String planInfoDaos; private String planInfoDaos;
@Column(name = "creation_date", length = 50) @Column(name = "txn_id")
private String creationDate; private String txnId;
@Column(name = "modified_date", length = 50) @Column(name = "req_id")
private String modifiedDate; private String reqId;
@Column(name = "created_epoch_date", length = 50) @Column(name = "client_user_id")
private String createdEpochDate; private String clientUserId;
@Column(name = "modified_epoch_date", length = 50) // Removed local audit fields: creationDate, modifiedDate, createdEpochDate, modifiedEpochDate
private String modifiedEpochDate; // They are now handled by Auditable base class
} }
@@ -13,19 +13,17 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Table(name = "biller_additional_info_payment") @Table(name = "bbps_biller_additional_info_payment")
@Entity @Entity
public class BillerAdditionalInfoPayment { public class BillerAdditionalInfoPayment extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; // primary key for the table private Long id; // primary key for the table
@Column(name = "param_config_id", nullable = false) @Column(name = "param_config_id", nullable = false)
@NotBlank(message = "Param Config ID cannot be blank")
private String paramConfigId; private String paramConfigId;
@Column(name = "param_name", nullable = false) @Column(name = "param_name", nullable = false)
@NotBlank(message = "Param name cannot be blank")
private String paramName; private String paramName;
@Column(name = "data_type_dao") @Column(name = "data_type_dao")
@@ -44,4 +42,4 @@ public class BillerAdditionalInfoPayment {
@ManyToOne @ManyToOne
@JoinColumn(name = "biller_id", nullable = false) @JoinColumn(name = "biller_id", nullable = false)
private BillerDetails biller; private BillerDetails biller;
} }
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType; import jakarta.persistence.FetchType;
@@ -18,12 +16,12 @@ import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "biller_category_icon") @Table(name = "bbps_biller_category_icon")
@Getter @Getter
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class BillerCategoryIcon extends Auditable<String>{ public class BillerCategoryIcon extends Auditable{
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -42,4 +40,4 @@ public class BillerCategoryIcon extends Auditable<String>{
foreignKey = @ForeignKey(name = "fk_icon_biller")) foreignKey = @ForeignKey(name = "fk_icon_biller"))
private BillerCategoryWise biller; private BillerCategoryWise biller;
} }
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.CascadeType; import jakarta.persistence.CascadeType;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@@ -15,12 +13,12 @@ import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "biller_category_wise") @Table(name = "bbps_biller_category_wise")
@Getter @Getter
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class BillerCategoryWise extends Auditable<String> { public class BillerCategoryWise extends Auditable {
@Id @Id
@Column(name = "biller_id") @Column(name = "biller_id")
@@ -59,8 +57,11 @@ public class BillerCategoryWise extends Auditable<String> {
@Column(name = "txn_id") @Column(name = "txn_id")
private String txnId; private String txnId;
@Column(name = "user_id")
private String userId;
// One-to-One mapping with icon // One-to-One mapping with icon
@OneToOne(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) @OneToOne(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
private BillerCategoryIcon icon; private BillerCategoryIcon icon;
} }
@@ -2,12 +2,12 @@ package com.billpaymentservice.bbps.entites;
import java.util.List; import java.util.List;
import com.billpaymentservice.bbps.audit.Auditable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.CascadeType; import jakarta.persistence.CascadeType;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.OneToMany; import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne; import jakarta.persistence.OneToOne;
@@ -21,6 +21,7 @@ import lombok.ToString;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@EntityListeners(AuditListener.class)
@ToString(exclude = { @ToString(exclude = {
"billerPaymentModes", "billerPaymentModes",
"billerPaymentChannels", "billerPaymentChannels",
@@ -34,9 +35,9 @@ import lombok.ToString;
"billerAdditionalInfoPayments" "billerAdditionalInfoPayments"
}) })
@Table(name = "biller_details") @Table(name = "bbps_biller_details")
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class BillerDetails{ public class BillerDetails extends Auditable {
@Id @Id
@Column(name = "biller_id", length = 14, nullable = false, unique = true) @Column(name = "biller_id", length = 14, nullable = false, unique = true)
@@ -45,18 +46,15 @@ public class BillerDetails{
private String billerId; private String billerId;
@Column(name = "biller_name") @Column(name = "biller_name")
@NotBlank(message = "Biller name cannot be blank")
private String billerName; private String billerName;
@Column(name = "biller_alias_name") @Column(name = "biller_alias_name")
private String billerAliasName; private String billerAliasName;
@Column(name = "biller_category_name", nullable = false) @Column(name = "biller_category_name")
@NotBlank(message = "Biller category name cannot be blank")
private String billerCategoryName; private String billerCategoryName;
@Column(name = "biller_mode") @Column(name = "biller_mode")
@NotBlank(message = "Biller mode cannot be blank")
private String billerMode; private String billerMode;
@Column(name = "biller_accepts_adhoc") @Column(name = "biller_accepts_adhoc")
@@ -69,14 +67,12 @@ public class BillerDetails{
private String parentBillerId; private String parentBillerId;
@Column(name = "biller_ownership") @Column(name = "biller_ownership")
@NotBlank(message = "Biller ownership is required (PSU or Private)")
private String billerOwnerShp; private String billerOwnerShp;
@Column(name = "biller_coverage") @Column(name = "biller_coverage")
private String billerCoverage; private String billerCoverage;
@Column(name = "fetch_requirement") @Column(name = "fetch_requirement")
@NotBlank(message = "Fetch requirement is mandatory")
private String fetchRequirement; private String fetchRequirement;
@Column(name = "payment_amount_exactness") @Column(name = "payment_amount_exactness")
@@ -165,4 +161,4 @@ public class BillerDetails{
@OneToOne(mappedBy = "biller", cascade = CascadeType.ALL) @OneToOne(mappedBy = "biller", cascade = CascadeType.ALL)
private BillerPlanResponseParams billerPlanResponseParams; private BillerPlanResponseParams billerPlanResponseParams;
} }
@@ -17,14 +17,14 @@ import lombok.ToString;
@Setter @Setter
@Entity @Entity
@ToString @ToString
@Table(name = "biller_plan_response_params") @Table(name = "bbps_biller_plan_response_params")
public class BillerPlanResponseParams {
public class BillerPlanResponseParams extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; // Primary Key private Long id; // Primary Key
@Column(name = "biller_plan_response_id", nullable = false, unique = true) @Column(name = "biller_plan_response_id", nullable = false, unique = true)
@NotBlank(message = "Biller Plan Response ID cannot be blank")
private String billerPlanResponseId; private String billerPlanResponseId;
// ✅ params list — since it's not a separate table, we can store as JSON or text // ✅ params list — since it's not a separate table, we can store as JSON or text
@Column(name = "params", columnDefinition = "TEXT") @Column(name = "params", columnDefinition = "TEXT")
@@ -37,5 +37,4 @@ public class BillerPlanResponseParams {
@OneToOne @OneToOne
@JoinColumn(name = "biller_id", nullable = false) @JoinColumn(name = "biller_id", nullable = false)
private BillerDetails biller; private BillerDetails biller;
} }
@@ -11,10 +11,10 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "biller_response") @Table(name = "bbps_biller_response")
@Getter @Getter
@Setter @Setter
public class BillerResponse { public class BillerResponse extends Auditable {
@Id @Id
@GeneratedValue @GeneratedValue
@@ -55,4 +55,4 @@ public class BillerResponse {
private BillMaster billMaster; private BillMaster billMaster;
// getters and setters // getters and setters
} }
@@ -20,8 +20,9 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "biller_response_params") @Table(name = "bbps_biller_response_params")
public class BillerResponseParams {
public class BillerResponseParams extends Auditable {
@Id @Id
@Column(name = "biller_response_id", nullable = false, unique = true) @Column(name = "biller_response_id", nullable = false, unique = true)
@@ -46,4 +47,4 @@ public class BillerResponseParams {
@OneToMany(mappedBy = "billerResponseParams", cascade = CascadeType.ALL, orphanRemoval = true) @OneToMany(mappedBy = "billerResponseParams", cascade = CascadeType.ALL, orphanRemoval = true)
private List<AmountOption> amountOptions; private List<AmountOption> amountOptions;
} }
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
@@ -12,10 +10,10 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "category_response_list") @Table(name = "bbps_category_response_list")
@Getter @Getter
@Setter @Setter
public class CategoryResponseList extends Auditable<String> { public class CategoryResponseList extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -30,4 +28,7 @@ public class CategoryResponseList extends Auditable<String> {
@Column(name = "txn_id") @Column(name = "txn_id")
private String txnId; private String txnId;
} @Column(name = "user_id")
private String userId;
}
@@ -16,10 +16,10 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "check_client_biller_data") @Table(name = "bbps_check_client_biller_data")
@Getter @Getter
@Setter @Setter
public class CheckClientBillerData { public class CheckClientBillerData extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -65,4 +65,4 @@ public class CheckClientBillerData {
@OneToMany(mappedBy = "billerResponse", cascade = CascadeType.ALL) @OneToMany(mappedBy = "billerResponse", cascade = CascadeType.ALL)
private List<BillCustomerParams> customerParams; private List<BillCustomerParams> customerParams;
} }
@@ -10,10 +10,10 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "check_client_status_req_id") @Table(name = "bbps_check_client_status_req_id")
@Getter @Getter
@Setter @Setter
public class CheckClientStatusReqId { public class CheckClientStatusReqId extends Auditable {
@Id @Id
@Column(name = "bill_id", length = 200) @Column(name = "bill_id", length = 200)
@@ -34,18 +34,6 @@ public class CheckClientStatusReqId {
@Column(name = "user_id") @Column(name = "user_id")
private String userId; 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") @Column(name = "req_id")
private String reqId; private String reqId;
@@ -57,4 +45,4 @@ public class CheckClientStatusReqId {
private CheckClientBillerData billerResponse; private CheckClientBillerData billerResponse;
} }
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
@@ -13,11 +11,11 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@Entity @Entity
@Table(name = "complaints") @Table(name = "bbps_complaints")
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class CloseComplaint extends Auditable<String> { public class CloseComplaint extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -104,4 +102,4 @@ public class CloseComplaint extends Auditable<String> {
@Column(name = "system_txn_id") @Column(name = "system_txn_id")
private String systemTxnId; private String systemTxnId;
} }
@@ -1,21 +1,21 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "complaint_status") @Table(name = "bbps_complaint_status")
@Getter @Getter
@Setter @Setter
public class ComplainStatus extends Auditable<String> { public class ComplainStatus extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -68,4 +68,12 @@ public class ComplainStatus extends Auditable<String> {
@Column(name = "txn_id") @Column(name = "txn_id")
private String txnId; private String txnId;
@Column(name = "user_id")
private String userId;
@ManyToOne
@JoinColumn(name = "complaint_response_id")
private ComplaintResponseEntity complaintResponse;
} }
@@ -5,11 +5,11 @@ import lombok.Setter;
import lombok.ToString; import lombok.ToString;
@Entity @Entity
@Table(name = "complaint_details") @Table(name = "bbps_complaint_details")
@Getter @Getter
@Setter @Setter
@ToString @ToString
public class ComplaintDetails { public class ComplaintDetails extends Auditable {
@Id @Id
@Column(name = "complaint_id", nullable = false, unique = true) @Column(name = "complaint_id", nullable = false, unique = true)
@@ -68,4 +68,4 @@ public class ComplaintDetails {
@Column(name = "modified_epoch_date") @Column(name = "modified_epoch_date")
private Long modifiedEpochDate; private Long modifiedEpochDate;
} }
@@ -1,12 +1,12 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@@ -14,34 +14,40 @@ import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "complaints_history") @Table(name = "bbps_complaints_history")
@Getter @Getter
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class ComplaintHistory extends Auditable<String> { public class ComplaintHistory extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; private Long id;
@Column(name="history_id") @Column(name = "history_id")
private String historyId; private String historyId;
@Column(name="ticket_id") @Column(name = "ticket_id")
private String ticketId; private String ticketId;
@Column(name="time") @Column(name = "time")
private String time; private String time;
@Column(name="history_status") @Column(name = "history_status")
private String historyStatus; private String historyStatus;
@Column(name = "txn_id") @Column(name = "txn_id")
private String txnId; private String txnId;
@Column(name = "req_id") @Column(name = "req_id")
private String reqId; private String reqId;
@Column(name = "user_id")
private String userId;
@ManyToOne
@JoinColumn(name = "complaint_response_id")
private ComplaintResponseEntity complaintResponse;
} }
@@ -1,21 +1,27 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable; import java.util.List;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.ToString;
@Entity @Entity
@Getter @Getter
@Setter @Setter
@Table(name = "complaint_responses") @ToString
public class ComplaintResponseEntity extends Auditable<String> { @Table(name = "bbps_complaint_responses")
public class ComplaintResponseEntity extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
@@ -66,4 +72,17 @@ public class ComplaintResponseEntity extends Auditable<String> {
@Column(name = "user_id") @Column(name = "user_id")
private String userId; private String userId;
@OneToMany(mappedBy = "complaintResponse", cascade = CascadeType.ALL, orphanRemoval = false)
private List<ComplainStatus> complaintStatusList;
@OneToMany(mappedBy = "complaintResponse", cascade = CascadeType.ALL, orphanRemoval = false)
private List<ComplaintHistory> historyList;
@OneToMany(mappedBy = "complaintResponse", cascade = CascadeType.ALL, orphanRemoval = false)
private List<ComplaintStatusDetails> statusDetailsList;
@OneToMany(mappedBy = "complaintResponse", cascade = CascadeType.ALL, orphanRemoval = false)
private List<ViewAllComplaintTicketStatusDetails> viewAllList;
} }
@@ -1,12 +1,12 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -14,19 +14,23 @@ import lombok.Setter;
@Entity @Entity
@Getter @Getter
@Setter @Setter
@Table(name = "view_ticket_status") @Table(name = "bbps_view_ticket_status")
public class ComplaintStatusDetails extends Auditable<String>{
public class ComplaintStatusDetails extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; private Long id;
@Column(name = "req_id") @Column(name = "req_id")
private String reqId; private String reqId;
@Column(name = "txn_id") @Column(name = "txn_id")
private String systemTxnId; private String systemTxnId;
@Column(name = "user_id")
private String userId;
@Column(name = "total_elements") @Column(name = "total_elements")
private String totalElements; private String totalElements;
@@ -84,4 +88,8 @@ public class ComplaintStatusDetails extends Auditable<String>{
@Column(name = "biller_name") @Column(name = "biller_name")
private String billerName; private String billerName;
@ManyToOne
@JoinColumn(name = "complaint_response_id")
private ComplaintResponseEntity complaintResponse;
} }
@@ -11,11 +11,11 @@ import lombok.Setter;
import lombok.ToString; import lombok.ToString;
@Entity @Entity
@Table(name = "complaint_options_status_master") @Table(name = "bbps_complaint_options_status_master")
@Getter @Getter
@Setter @Setter
@ToString @ToString
public class ComplaintStatusOptionsMaster { public class ComplaintStatusOptionsMaster extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -24,7 +24,5 @@ public class ComplaintStatusOptionsMaster {
@Column(name = "status_label_name") @Column(name = "status_label_name")
private String statusLabelName; private String statusLabelName;
@Column(name = "is_deleted") // Removed local isDeleted field, now handled by Auditable
private Boolean isDeleted = false; }
}
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
@@ -14,12 +12,12 @@ import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "contact_master_data") @Table(name = "bbps_contact_master_data")
@Getter @Getter
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class ContactMasterData extends Auditable<String> { public class ContactMasterData extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -33,4 +31,7 @@ public class ContactMasterData extends Auditable<String> {
@Column(name = "txn_id") @Column(name = "txn_id")
private String txnId; private String txnId;
}
@Column(name = "user_id")
private String userId;
}
@@ -14,33 +14,43 @@ import lombok.ToString;
@Setter @Setter
@Entity @Entity
@ToString @ToString
@Table(name = "custom_param") @Table(name = "bbps_custom_param")
public class CustomParam {
@Id public class CustomParam extends Auditable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "custom_param_name")
private String customParamName;
@Column(name = "data_type") @Id
private String dataType; @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "optional") @Column(name = "custom_param_name")
private Boolean optional; private String customParamName;
@Column(name = "min_length") @Column(name = "data_type")
private Integer minLength; private String dataType;
@Column(name = "max_length") @Column(name = "optional")
private Integer maxLength; private Boolean optional;
@Column(name = "regex") @Column(name = "min_length")
private String regex; private Integer minLength;
@Column(name = "visibility") @Column(name = "max_length")
private Boolean visibility; private Integer maxLength;
@Column(name = "regex")
} private String regex;
@Column(name = "visibility")
private Boolean visibility;
@Column(name = "req_id")
private String reqId;
@Column(name = "txn_id")
private String txnId;
@Column(name = "user_id")
private String userId;
}
@@ -22,9 +22,9 @@ import lombok.ToString;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "customer_param") @Table(name = "bbps_customer_param")
@ToString @ToString
public class CustomerParam { public class CustomerParam extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -68,4 +68,4 @@ public class CustomerParam {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "biller_id") @JoinColumn(name = "biller_id")
private BillerDetails biller; private BillerDetails biller;
} }
@@ -12,8 +12,9 @@ import lombok.Setter;
@Entity @Entity
@Getter @Getter
@Setter @Setter
@Table(name = "customer_param_bill") @Table(name = "bbps_customer_param_bill")
public class CustomerParamBill {
public class CustomerParamBill extends Auditable {
@Id @Id
@GeneratedValue @GeneratedValue
@@ -28,4 +29,4 @@ public class CustomerParamBill {
private BillMaster billMaster; private BillMaster billMaster;
// getters and setters // getters and setters
} }
@@ -6,11 +6,11 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@Entity @Entity
@Table(name = "customer_params_bill_validate") @Table(name = "bbps_customer_params_bill_validate")
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class CustomerParamBillValidation { public class CustomerParamBillValidation extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -30,4 +30,4 @@ public class CustomerParamBillValidation {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "bill_id_fk") @JoinColumn(name = "bill_id_fk")
private BillValidation bill; private BillValidation bill;
} }
@@ -12,8 +12,9 @@ import lombok.Setter;
@Entity @Entity
@Getter @Getter
@Setter @Setter
@Table(name = "customer_params") @Table(name = "bbps_customer_params")
public class CustomerParamDAO {
public class CustomerParamDAO extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -2,8 +2,6 @@ package com.billpaymentservice.bbps.entites;
import java.util.List; import java.util.List;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.CascadeType; import jakarta.persistence.CascadeType;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@@ -20,8 +18,10 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "customer_param_group_by_biller_id") @Table(name = "bbps_customer_param_group_by_biller_id")
public class CustomerParamGroupById extends Auditable<String> {
public class CustomerParamGroupById extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -56,4 +56,6 @@ public class CustomerParamGroupById extends Auditable<String> {
@Column(name = "txn_id") @Column(name = "txn_id")
private String txnId; private String txnId;
} @Column(name = "user_id")
private String userId;
}
@@ -21,8 +21,9 @@ import lombok.ToString;
@Setter @Setter
@Entity @Entity
@ToString @ToString
@Table(name = "customer_param_groups") @Table(name = "bbps_customer_param_groups")
public class CustomerParamGroups {
public class CustomerParamGroups extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -37,5 +38,4 @@ public class CustomerParamGroups {
// 🔗 One CustomerParamGroups contains multiple Group objects // 🔗 One CustomerParamGroups contains multiple Group objects
@OneToMany(mappedBy = "customerParamGroups", cascade = CascadeType.ALL, orphanRemoval = true) @OneToMany(mappedBy = "customerParamGroups", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Group> groups; private List<Group> groups;
} }
@@ -14,8 +14,9 @@ import lombok.Setter;
@Entity @Entity
@Getter @Getter
@Setter @Setter
@Table(name = "customer_params_transaction") @Table(name = "bbps_customer_params_transaction")
public class CustomerParamTransaction {
public class CustomerParamTransaction extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -29,5 +30,4 @@ public class CustomerParamTransaction {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "txn_id", referencedColumnName = "bank_txn_id") @JoinColumn(name = "txn_id", referencedColumnName = "bank_txn_id")
private TransactionMaster transactionMaster; private TransactionMaster transactionMaster;
} }
@@ -15,8 +15,9 @@ import lombok.Setter;
@Entity @Entity
@Getter @Getter
@Setter @Setter
@Table(name = "device_block_tag") @Table(name = "bbps_device_block_tag")
public class DeviceBlockTag {
public class DeviceBlockTag extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -35,4 +36,4 @@ public class DeviceBlockTag {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "txn_id", referencedColumnName = "bank_txn_id") @JoinColumn(name = "txn_id", referencedColumnName = "bank_txn_id")
private TransactionMaster transactionMaster; private TransactionMaster transactionMaster;
} }
@@ -11,17 +11,26 @@ import lombok.ToString;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "disposition_details") @Table(name = "bbps_disposition_details")
@ToString @ToString
public class DispositionDetails { public class DispositionDetails extends Auditable {
@Id @Id
@Column(name = "disposition_id", nullable = false, unique = true) @Column(name = "disposition_id", nullable = false, unique = true)
private String dispositionId; // UUID type string private String dispositionId; // UUID type string
@Column(name = "disposition_descr", nullable = false) @Column(name = "disposition_descr", nullable = false)
private String dispositionDescr; private String dispositionDescr;
@Column(name = "tenant_id") @Column(name = "tenant_id")
private String tenantId; private String tenantId;
@Column(name = "req_id")
private String reqId;
@Column(name = "txn_id")
private String txnId;
@Column(name = "user_id")
private String userId;
} }
@@ -1,7 +1,5 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import com.billpaymentservice.bbps.audit.Auditable;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
@@ -18,8 +16,9 @@ import lombok.Setter;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Entity @Entity
@Table(name = "fetch_bill_validate_response") @Table(name = "bbps_fetch_bill_validate_response")
public class FetchBillValidate extends Auditable<String> {
public class FetchBillValidate extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -63,10 +62,10 @@ public class FetchBillValidate extends Auditable<String> {
private String modifiedDate; private String modifiedDate;
@Column(name = "created_epoch_date") @Column(name = "created_epoch_date")
private long createdEpochDate; private Long createdEpochDate;
@Column(name = "modified_epoch_date") @Column(name = "modified_epoch_date")
private long modifiedEpochDate; private Long modifiedEpochDate;
@Column(name = "request_id") @Column(name = "request_id")
private String requestId; private String requestId;
@@ -74,4 +73,4 @@ public class FetchBillValidate extends Auditable<String> {
@Column(name = "txn_id") @Column(name = "txn_id")
private String txnId; private String txnId;
} }
@@ -25,8 +25,9 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "biller_groups") @Table(name = "bbps_biller_groups")
public class Group {
public class Group extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -59,4 +60,4 @@ public class Group {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "group_container_id") @JoinColumn(name = "group_container_id")
private CustomerParamGroups customerParamGroups; private CustomerParamGroups customerParamGroups;
} }
@@ -14,8 +14,9 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "group_params") @Table(name = "bbps_group_params")
public class GroupParam {
public class GroupParam extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -28,4 +29,4 @@ public class GroupParam {
@JoinColumn(name = "group_id") @JoinColumn(name = "group_id")
private CustomerParamGroupById group; // Link to the group this parameter belongs to private CustomerParamGroupById group; // Link to the group this parameter belongs to
} }
@@ -7,57 +7,62 @@ import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; 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")
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();
} }
} }
@@ -21,19 +21,18 @@ import lombok.ToString;
@Setter @Setter
@Entity @Entity
@ToString @ToString
@Table(name = "interchange_fee") @Table(name = "bbps_interchange_fee")
public class InterchangeFee {
public class InterchangeFee extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; // Primary key private Long id; // Primary key
@Column(name = "interchange_fee_id", nullable = false, unique = true) @Column(name = "interchange_fee_id", nullable = false, unique = true)
@NotBlank(message = "Interchange Fee ID cannot be blank")
private String interchangeFeeId; private String interchangeFeeId;
@Column(name = "fee_code", nullable = false) @Column(name = "fee_code", nullable = false)
@NotBlank(message = "Fee code is mandatory")
private String feeCode; private String feeCode;
@Column(name = "fee_description") @Column(name = "fee_description")
@@ -50,4 +49,4 @@ public class InterchangeFee {
@ManyToOne @ManyToOne
@JoinColumn(name = "biller_id", nullable = false) @JoinColumn(name = "biller_id", nullable = false)
private BillerDetails biller; private BillerDetails biller;
} }
@@ -19,15 +19,15 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "interchange_fee_conf") @Table(name = "bbps_interchange_fee_conf")
public class InterchangeFeeConf {
public class InterchangeFeeConf extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; // Primary Key for DB table private Long id; // Primary Key for DB table
@Column(name = "interchange_fee_conf_id", nullable = false, unique = true) @Column(name = "interchange_fee_conf_id", nullable = false, unique = true)
@NotBlank(message = "Interchange Fee Config ID cannot be blank")
private String interChangeFeeConfId; private String interChangeFeeConfId;
@Column(name = "mti") @Column(name = "mti")
@@ -64,4 +64,4 @@ public class InterchangeFeeConf {
@ManyToOne @ManyToOne
@JoinColumn(name = "biller_id", nullable = false) @JoinColumn(name = "biller_id", nullable = false)
private BillerDetails biller; private BillerDetails biller;
} }
@@ -12,10 +12,10 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Entity @Entity
@Table(name = "interchange_fee_detail") @Table(name = "bbps_interchange_fee_detail")
@Getter @Getter
@Setter @Setter
public class InterchangeFeeDetail { public class InterchangeFeeDetail extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -43,4 +43,4 @@ public class InterchangeFeeDetail {
@ManyToOne @ManyToOne
@JoinColumn(name = "interchange_fee_id", nullable = false) @JoinColumn(name = "interchange_fee_id", nullable = false)
private InterchangeFee interchangeFee; private InterchangeFee interchangeFee;
} }
@@ -7,52 +7,58 @@ import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; 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")
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();
}
} }
@@ -8,7 +8,6 @@ import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne; import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import jakarta.validation.constraints.Min; import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.ToString; import lombok.ToString;
@@ -17,14 +16,13 @@ import lombok.ToString;
@Setter @Setter
@Entity @Entity
@ToString @ToString
@Table(name = "payment_channel") @Table(name = "bbps_payment_channel")
public class PaymentChannel { public class PaymentChannel extends Auditable {
@Id @Id
@Column(name = "payment_channel_limit_id") @Column(name = "payment_channel_limit_id")
private String paymentChannelLimitId; // Primary key (manual, not auto-generated) private String paymentChannelLimitId; // Primary key (manual, not auto-generated)
@NotBlank(message = "Payment channel is required")
@Column(name = "payment_channel", nullable = false) @Column(name = "payment_channel", nullable = false)
private String paymentChannel; private String paymentChannel;
@@ -8,30 +8,33 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Entity @Entity
@Table(name = "payment_initiate") @Table(name = "bbps_payment_initiate")
public class PaymentInitiate {
@Id public class PaymentInitiate extends Auditable {
@Column(name = "req_id")
private String reqId;
@Column(name = "bank_txn_Id", nullable = false) @Id
private String bankTxnId; @Column(name = "req_id")
private String reqId;
@Column(name = "client_user_id")
private String clientUserId;
@Column(name = "mid")
private String mid;
@Column(name = "txn_id") @Column(name = "bank_txn_Id", nullable = false)
private String txnId; private String bankTxnId;
@Column(name = "status") @Column(name = "client_user_id")
private String status; private String clientUserId;
}
@Column(name = "mid")
private String mid;
@Column(name = "txn_id")
private String txnId;
@Column(name = "status")
private String status;
@Column(name = "user_id")
private String userId;
}
@@ -19,18 +19,16 @@ import lombok.ToString;
@Getter @Getter
@Setter @Setter
@Entity @Entity
@Table(name = "biller_payment_modes") @Table(name = "bbps_biller_payment_modes")
@ToString @ToString
public class PaymentMode { public class PaymentMode extends Auditable {
@Id // @Id //
@Column(name = "payment_model_limit_id", unique = true, length = 50) @Column(name = "payment_model_limit_id", unique = true, length = 50)
@NotBlank(message = "Payment model limit ID cannot be blank")
private String paymentModelLimitId; private String paymentModelLimitId;
@Column(name = "payment_mode", nullable = false, length = 50) @Column(name = "payment_mode", nullable = false, length = 50)
@NotBlank(message = "Payment mode is mandatory")
private String paymentMode; private String paymentMode;
@Column(name = "max_limit") @Column(name = "max_limit")
@@ -42,12 +40,10 @@ public class PaymentMode {
private long minLimit; private long minLimit;
@Column(name = "support_pending_status", length = 10) @Column(name = "support_pending_status", length = 10)
@Pattern(regexp = "^(Yes|No)?$", message = "Support pending status must be either 'Yes' or 'No'")
private String supportPendingStatus; private String supportPendingStatus;
// 🔗 Many-to-One relationship with BillerDAO // 🔗 Many-to-One relationship with BillerDAO
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "biller_id", nullable = false) @JoinColumn(name = "biller_id", nullable = false)
private BillerDetails biller; private BillerDetails biller;
} }
@@ -1,24 +1,25 @@
package com.billpaymentservice.bbps.entites; package com.billpaymentservice.bbps.entites;
import java.time.LocalDateTime;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter;
@Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Entity @Entity
@Table(name = "payment_start_record") @Getter
public class PaymentStartRecord { @Setter
@Table(name = "bbps_payment_start_record")
public class PaymentStartRecord extends Auditable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -50,9 +51,10 @@ public class PaymentStartRecord {
@Column(name = "qr_string", columnDefinition = "TEXT") @Column(name = "qr_string", columnDefinition = "TEXT")
private String qrString; private String qrString;
@Column(name = "created_on", nullable = false) // `createdOn` is provided by the base `Auditable` class as a LocalDateTime field,
private String createdOn; // 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 // New callback-related fields
@Column(name = "callback_status") @Column(name = "callback_status")
private String callbackStatus; private String callbackStatus;

Some files were not shown because too many files have changed in this diff Show More