Compare commits
No commits in common. 'Nabeel-DG-BS' and 'main' have entirely different histories.
Nabeel-DG-
...
main
@ -1,118 +1,114 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.2.2</version>
|
<version>3.2.2</version>
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>uco</artifactId>
|
<artifactId>uco</artifactId>
|
||||||
<version>0.0.1</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<name>UCO-BS</name>
|
<packaging>war</packaging>
|
||||||
<description>UCO-BS</description>
|
<name>UCO-BS</name>
|
||||||
<properties>
|
<description>UCO-BS </description>
|
||||||
<java.version>17</java.version>
|
<properties>
|
||||||
<spring-cloud.version>2023.0.0</spring-cloud.version>
|
<java.version>17</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<spring-cloud.version>2023.0.0</spring-cloud.version>
|
||||||
</properties>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<dependencies>
|
</properties>
|
||||||
<dependency>
|
<dependencies>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<dependency>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
</dependency>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<dependency>
|
||||||
<artifactId>spring-boot-starter-webflux</artifactId>
|
<groupId>com.itextpdf</groupId>
|
||||||
</dependency>
|
<artifactId>itext7-core</artifactId>
|
||||||
<dependency>
|
<version>7.1.9</version>
|
||||||
<groupId>com.itextpdf</groupId>
|
<type>pom</type>
|
||||||
<artifactId>itext7-core</artifactId>
|
</dependency>
|
||||||
<version>7.1.9</version>
|
<dependency>
|
||||||
<type>pom</type>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
</dependency>
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<dependency>
|
||||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
<groupId>com.mfsys</groupId>
|
||||||
</dependency>
|
<artifactId>common</artifactId>
|
||||||
<dependency>
|
<version>3.2.2</version>
|
||||||
<groupId>com.mfsys</groupId>
|
<scope>compile</scope>
|
||||||
<artifactId>common</artifactId>
|
</dependency>
|
||||||
<version>3.2.2</version>
|
<dependency>
|
||||||
<scope>compile</scope>
|
<groupId>javax.xml.bind</groupId>
|
||||||
</dependency>
|
<artifactId>jaxb-api</artifactId>
|
||||||
<dependency>
|
<version>2.4.0-b180830.0359</version>
|
||||||
<groupId>javax.xml.bind</groupId>
|
</dependency>
|
||||||
<artifactId>jaxb-api</artifactId>
|
<dependency>
|
||||||
<version>2.4.0-b180830.0359</version>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
</dependency>
|
<artifactId>jjwt-api</artifactId>
|
||||||
<dependency>
|
<version>0.11.5</version>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
</dependency>
|
||||||
<artifactId>jjwt-api</artifactId>
|
<dependency>
|
||||||
<version>0.11.5</version>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
</dependency>
|
<artifactId>jjwt-impl</artifactId>
|
||||||
<dependency>
|
<version>0.11.5</version>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<scope>runtime</scope>
|
||||||
<artifactId>jjwt-impl</artifactId>
|
</dependency>
|
||||||
<version>0.11.5</version>
|
<dependency>
|
||||||
<scope>runtime</scope>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
</dependency>
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
<dependency>
|
<version>0.11.5</version>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<scope>runtime</scope>
|
||||||
<artifactId>jjwt-jackson</artifactId>
|
</dependency>
|
||||||
<version>0.11.5</version>
|
<dependency>
|
||||||
<scope>runtime</scope>
|
<groupId>org.projectlombok</groupId>
|
||||||
</dependency>
|
<artifactId>lombok</artifactId>
|
||||||
<dependency>
|
<optional>true</optional>
|
||||||
<groupId>org.projectlombok</groupId>
|
</dependency>
|
||||||
<artifactId>lombok</artifactId>
|
<!-- <dependency>-->
|
||||||
<optional>true</optional>
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
</dependency>
|
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
|
||||||
<!-- <dependency>-->
|
<!-- </dependency>-->
|
||||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
<dependency>
|
||||||
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
|
<groupId>org.springframework.boot</groupId>
|
||||||
<!-- </dependency>-->
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.validation</groupId>
|
<groupId>jakarta.validation</groupId>
|
||||||
<artifactId>jakarta.validation-api</artifactId>
|
<artifactId>jakarta.validation-api</artifactId>
|
||||||
<version>2.0.1</version>
|
<version>2.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.persistence</groupId>
|
<groupId>jakarta.persistence</groupId>
|
||||||
<artifactId>jakarta.persistence-api</artifactId>
|
<artifactId>jakarta.persistence-api</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-dependencies</artifactId>
|
<artifactId>spring-cloud-dependencies</artifactId>
|
||||||
<version>${spring-cloud.version}</version>
|
<version>${spring-cloud.version}</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
<build>
|
<build>
|
||||||
<finalName>uco</finalName>
|
<plugins>
|
||||||
<plugins>
|
<plugin>
|
||||||
<plugin>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
</plugin>
|
||||||
</plugin>
|
</plugins>
|
||||||
</plugins>
|
</build>
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@ -1,35 +0,0 @@
|
|||||||
package com.mfsys.uco.config;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.web.reactive.function.client.WebClient;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
public class WebClientconfiguration {
|
|
||||||
|
|
||||||
@Value("${base.ciihive}")
|
|
||||||
private String ciihive;
|
|
||||||
|
|
||||||
@LoadBalanced
|
|
||||||
@Bean
|
|
||||||
public WebClient.Builder loadBalancedWebClientBuilder() {
|
|
||||||
return WebClient.builder();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public WebClient webClientDeposit() {
|
|
||||||
// return WebClient.create("http://localhost:9095");
|
|
||||||
return WebClient.create(ciihive);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public WebClient webClientCrm() {
|
|
||||||
return WebClient.create(ciihive);
|
|
||||||
// return WebClient.create("http://localhost:9096");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
package com.mfsys.uco.constants;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.CustomerAccountActivity;
|
|
||||||
import com.mfsys.uco.model.CustomerProfile;
|
|
||||||
import com.mfsys.uco.repository.CustomerProfileRepository;
|
|
||||||
import com.mfsys.uco.service.CustomerAccountActivityService;
|
|
||||||
import jakarta.servlet.FilterChain;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.filter.OncePerRequestFilter;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class LoggingActivityFilter extends OncePerRequestFilter {
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(LoggingActivityFilter.class);
|
|
||||||
private final CustomerProfileRepository customerProfileRepository;
|
|
||||||
private final CustomerAccountActivityService customerAccountActivityService;
|
|
||||||
|
|
||||||
public LoggingActivityFilter(CustomerProfileRepository customerProfileRepository, CustomerAccountActivityService customerAccountActivityService) {
|
|
||||||
this.customerProfileRepository = customerProfileRepository;
|
|
||||||
this.customerAccountActivityService = customerAccountActivityService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
|
|
||||||
setAccessControlHeaders(response);
|
|
||||||
if ("OPTIONS".equalsIgnoreCase(request.getMethod())) {
|
|
||||||
response.setStatus(HttpServletResponse.SC_OK);
|
|
||||||
} else {
|
|
||||||
filterChain.doFilter(request, response);
|
|
||||||
logRequestDetails(request, response);
|
|
||||||
handleUserActivityLogging(request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setAccessControlHeaders(HttpServletResponse response) {
|
|
||||||
response.setHeader("Access-Control-Allow-Credentials", "true");
|
|
||||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
||||||
response.setHeader("Access-Control-Allow-Headers", "*");
|
|
||||||
response.setHeader("Access-Control-Expose-Headers", "*");
|
|
||||||
response.setHeader("Access-Control-Allow-Methods", "GET, POST, PATCH, PUT, DELETE, OPTIONS");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void logRequestDetails(HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
LOGGER.info("FINISHED PROCESSING: METHOD={}; REQUESTURI={}; RESPONSE CODE={}; IP={};",
|
|
||||||
request.getMethod(), request.getRequestURI(), response.getStatus(), request.getRemoteAddr());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void handleUserActivityLogging(HttpServletRequest request) {
|
|
||||||
try {
|
|
||||||
String susUserCode = request.getHeader("cmpUserId") != null ? URLDecoder.decode(request.getHeader("cmpUserId"), "UTF-8") : "";
|
|
||||||
String porOrgacode = request.getHeader("porOrgacode");
|
|
||||||
String email = request.getHeader("email");
|
|
||||||
String channelCode = request.getHeader("channelCode");
|
|
||||||
String deviceName = request.getHeader("deviceName");
|
|
||||||
String userActivity = request.getHeader("userActivity");
|
|
||||||
|
|
||||||
CustomerProfile customer = customerProfileRepository.findbyEmail(porOrgacode, email);
|
|
||||||
if (customer != null && userActivity != null) {
|
|
||||||
CustomerAccountActivity activity = new CustomerAccountActivity(
|
|
||||||
null,
|
|
||||||
porOrgacode,
|
|
||||||
customer.getCmpCustcode(),
|
|
||||||
LocalDateTime.now(),
|
|
||||||
channelCode,
|
|
||||||
deviceName,
|
|
||||||
userActivity,
|
|
||||||
customer
|
|
||||||
);
|
|
||||||
customerAccountActivityService.postCustomerAccountActivity(activity);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOGGER.error("Error logging user activity", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
package com.mfsys.uco.constants;
|
|
||||||
|
|
||||||
public interface UCOConstants {
|
|
||||||
String CMP_PHONE = "01";
|
|
||||||
String CMP_EMAIL = "02";
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.mfsys.uco.constants;
|
|
||||||
|
|
||||||
public interface UCOURI {
|
|
||||||
String GET_UCOACC_BALANCE = "/deposit/getUcoAccountBalance";
|
|
||||||
String CUSTOMER_ONBOARDING = "/crm/onboarding/digital/customer";
|
|
||||||
String GET_CMP_UCOACCOUNTS = "/deposit/getUcoAccounts";
|
|
||||||
String FETCH_EXCHANGE_RATE = "/deposit/uco/fetchExchangeRate";
|
|
||||||
String FETCH_DEPOSIT_PRODUCTS = "/deposit/product/uco";
|
|
||||||
String UCO_CUSTOMER_ACCOUNT = "/deposit/onboarding/digital/UcoCustomerAccount";
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
package com.mfsys.uco.controller;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mfsys.uco.UCOURI;
|
|
||||||
import com.mfsys.uco.model.ChartOfAccount;
|
|
||||||
import com.mfsys.uco.model.Product;
|
|
||||||
import com.mfsys.uco.model.TransactionTrail;
|
|
||||||
import com.mfsys.uco.service.DepositUcoProductsService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DepositUcoProductController {
|
|
||||||
|
|
||||||
private final DepositUcoProductsService depositUcoProductsService;
|
|
||||||
|
|
||||||
@GetMapping(UCOURI.FETCH_UCO_DEPOSIT_PRODUCTS)
|
|
||||||
public List<Product> getUcoDepositProducts(
|
|
||||||
@RequestParam String porOrgacode) {
|
|
||||||
return depositUcoProductsService.fetchDepositUcoProducts(porOrgacode);
|
|
||||||
}
|
|
||||||
@GetMapping(UCOURI.FETCH_UCO_ONBOARDING_DEPOSIT_PRODUCTS)
|
|
||||||
public List<Product> getUcoOnBoardingDepositProducts(
|
|
||||||
@RequestParam String porOrgacode) {
|
|
||||||
return depositUcoProductsService.fetchDepositUcoProducts(porOrgacode);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping(UCOURI.FETCH_UCO_GLS)
|
|
||||||
public List<ChartOfAccount> getUcoGls(
|
|
||||||
@RequestParam String porOrgacode) {
|
|
||||||
return depositUcoProductsService.fetchUcoGls(porOrgacode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
package com.mfsys.uco.controller;
|
|
||||||
|
|
||||||
import com.mfsys.uco.UCOURI;
|
|
||||||
import com.mfsys.uco.dto.*;
|
|
||||||
import com.mfsys.uco.dto.Transaction.TransactionOtpRequestModel;
|
|
||||||
import com.mfsys.uco.model.TransactionTrail;
|
|
||||||
import com.mfsys.uco.service.TransactionService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class TransactionController {
|
|
||||||
|
|
||||||
private final TransactionService transactionService;
|
|
||||||
|
|
||||||
@PostMapping(UCOURI.GET_DR_TRANSACTION_PIN)
|
|
||||||
public TransactionPinResponseModel getDrTransactionOtp(@RequestBody TransactionOtpRequestModel transactionOtpRequestModel) {
|
|
||||||
return transactionService.sendOtpAndValidateTranPin(transactionOtpRequestModel,true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(UCOURI.RESEND_GET_DR_TRANSACTION_PIN)
|
|
||||||
public TransactionPinResponseModel resendDrTransactionOtp(@RequestBody TransactionOtpRequestModel transactionOtpRequestModel) {
|
|
||||||
return transactionService.sendOtpAndValidateTranPin(transactionOtpRequestModel,true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(UCOURI.SUBMIT_DR_TRANSACTION)
|
|
||||||
public Map<String, Object> cashInTransaction(@RequestBody CashInTransactionRequest transactionRequest) {
|
|
||||||
return transactionService.cashInTransaction(transactionRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(UCOURI.SUBMIT_ADD_MONEY_GL_ACC_DR_TRANSACTION)
|
|
||||||
public Map<String, Object> addMoneyGlAccTransaction(@RequestBody GLAccontTranasctionRequestModel glAccontTranasctionRequestModel) {
|
|
||||||
return transactionService.glAccountTransaction(glAccontTranasctionRequestModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(UCOURI.SUBMIT_CR_TRANSACTION)
|
|
||||||
public Map<String, Object> cashOutTransaction(@RequestBody CashOutTransactionRequest transactionRequest) {
|
|
||||||
return transactionService.cashOutTransaction(transactionRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping(UCOURI.PENDING_CR_TRANSACTION)
|
|
||||||
public List<TransactionTrail> getDepositAccounts(
|
|
||||||
@RequestParam String porOrgacode,
|
|
||||||
@RequestParam String mbmBkmsnumber) {
|
|
||||||
return transactionService.fetchPendingCrTransactions(porOrgacode, mbmBkmsnumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping(UCOURI.ACCOUNT_STATEMENT)
|
|
||||||
public List<TransactionTrail> getAccountStatement(
|
|
||||||
@RequestParam String porOrgacode,
|
|
||||||
@RequestParam String mbmBkmsnumber) {
|
|
||||||
return transactionService.fetchDepositAccountStatement(porOrgacode, mbmBkmsnumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping(UCOURI.CURRENCY_EVALUATION)
|
|
||||||
public EvaluatedCurrencyReponse getEvaluatedCurrency(
|
|
||||||
@RequestParam String porOrgacode,
|
|
||||||
@RequestParam String baseCurrency,
|
|
||||||
@RequestParam String targetCurrency,
|
|
||||||
@RequestParam double sgtGntramtfc) {
|
|
||||||
return transactionService.getEvaluatedCurrency(porOrgacode, baseCurrency,targetCurrency,sgtGntramtfc);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(UCOURI.REVERSE_TRANSACTION)
|
|
||||||
public Object reverseTransaction(
|
|
||||||
@RequestParam String porOrgacode,
|
|
||||||
@RequestParam String nodeId,
|
|
||||||
@RequestParam String sgtGntrnumber
|
|
||||||
){
|
|
||||||
return transactionService.reverseTransacion(porOrgacode,nodeId,sgtGntrnumber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class AddAccountRequestModel {
|
|
||||||
private String porOrgacode;
|
|
||||||
private String email;
|
|
||||||
private String title;
|
|
||||||
private String dmpProdcode;
|
|
||||||
private String channelCode;
|
|
||||||
}
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class CashInTransactionRequest {
|
|
||||||
private String porOrgacode;
|
|
||||||
private String pctCstycode;
|
|
||||||
private String channelCode;
|
|
||||||
private String cmpCustcode;
|
|
||||||
private String drMbmBkmsnumber;
|
|
||||||
private String drMbmBkmstitle;
|
|
||||||
private String drPcrCurrcode;
|
|
||||||
private String drPcrCurrdesc;
|
|
||||||
private String drPcrCurrshort;
|
|
||||||
private String crMbmBkmsnumber;
|
|
||||||
private String crMbmBkmstitle;
|
|
||||||
private String crPcrCurrcode;
|
|
||||||
private String crPcrCurrdesc;
|
|
||||||
private String crPcrCurrshort;
|
|
||||||
private String sgtGntrnarration;
|
|
||||||
private String dmpProdCode;
|
|
||||||
private String transType;
|
|
||||||
private String notificationId;
|
|
||||||
private String cmpRefcode;
|
|
||||||
private String transMode;
|
|
||||||
private double sgtGntramtfc;
|
|
||||||
private String otdTrancomment;
|
|
||||||
private String obpPincode;
|
|
||||||
private String pinType;
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class CashOutTransactionRequest {
|
|
||||||
private Long id;
|
|
||||||
private String cmpTranpin;
|
|
||||||
private boolean isAccepted;
|
|
||||||
private String cmpCustcode;
|
|
||||||
private String porOrgacode;
|
|
||||||
private String cmpRefcode;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class ChangeTransactionPinRequest {
|
|
||||||
private String oldTransPincode;
|
|
||||||
private String newTransPincode;
|
|
||||||
private String channelCode;
|
|
||||||
private String pctCstycode;
|
|
||||||
private String porOrgacode;
|
|
||||||
private String cmpCustcode;
|
|
||||||
@JsonProperty("isOtpRequired")
|
|
||||||
private boolean isOtpRequired;
|
|
||||||
private String pinType;
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class CoreCashInTransaction {
|
|
||||||
private String porOrgacode;
|
|
||||||
private String drMbmBkmsnumber;
|
|
||||||
private BigDecimal sgtGntramtfc;
|
|
||||||
private double accSgtGntramtfc;
|
|
||||||
private String drPcrCurrcode;
|
|
||||||
private String otdTrancomment;
|
|
||||||
private String pcaGlaccode;
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class CoreCashOutTransaction {
|
|
||||||
private String porOrgacode;
|
|
||||||
private String crMbmBkmsnumber;
|
|
||||||
private BigDecimal sgtGntramtfc;
|
|
||||||
private String crPcrCurrcode;
|
|
||||||
private String otdTrancomment;
|
|
||||||
private String pcaGlaccode;
|
|
||||||
private BigDecimal accSgtGntramtfc;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class CoreReverseTransaction {
|
|
||||||
private String porOrgacode;
|
|
||||||
private String sgtGntrcreateat;
|
|
||||||
private String nodeId;
|
|
||||||
private String sgtGntrtranlink;
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class CreateTransactionPinRequest {
|
|
||||||
private String newTransPincode;
|
|
||||||
private String channelCode;
|
|
||||||
private String pctCstycode;
|
|
||||||
private String porOrgacode;
|
|
||||||
private String cmpCustcode;
|
|
||||||
@JsonProperty("isOtpRequired")
|
|
||||||
private boolean isOtpRequired;
|
|
||||||
private String pinType;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class EvaluatedCurrencyReponse {
|
|
||||||
private String pcrCurrcode;
|
|
||||||
private BigDecimal sgtGntramtfc;
|
|
||||||
private double serviceCharges;
|
|
||||||
private double targetPerEratrateact;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class ExchangeRateModel {
|
|
||||||
private String pcrCurrshort;
|
|
||||||
private String pcrCurrcode;
|
|
||||||
private String perEratdate;
|
|
||||||
private String petExrtcode;
|
|
||||||
private String porOrgacode;
|
|
||||||
private double perEratrateact;
|
|
||||||
private String pcrCurrdesc;
|
|
||||||
private String petExrtdesc;
|
|
||||||
private boolean pcrCurrbase;
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class GLAccontTranasctionRequestModel {
|
|
||||||
private String porOrgacode;
|
|
||||||
private String pctCstycode;
|
|
||||||
private String channelCode;
|
|
||||||
private String cmpCustcode;
|
|
||||||
private String drPcaGlaccode;
|
|
||||||
private String drPcaGlacdesc;
|
|
||||||
private String crMbmBkmsnumber;
|
|
||||||
private String crMbmBkmstitle;
|
|
||||||
private String crPcrCurrcode;
|
|
||||||
private String crPcrCurrdesc;
|
|
||||||
private String crPcrCurrshort;
|
|
||||||
private String sgtGntrnarration;
|
|
||||||
private String dmpProdCode;
|
|
||||||
private String transType;
|
|
||||||
private String notificationId;
|
|
||||||
private String transMode;
|
|
||||||
private double sgtGntramtfc;
|
|
||||||
private String otdTrancomment;
|
|
||||||
private String obpPincode;
|
|
||||||
private String pinType;
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class OTPRequest {
|
|
||||||
@JsonProperty("isOtpRequired")
|
|
||||||
private boolean isOtpRequired;
|
|
||||||
private String email;
|
|
||||||
private String phone;
|
|
||||||
private String channelCode;
|
|
||||||
private String porOrgacode;
|
|
||||||
private String username;
|
|
||||||
private String pinType;
|
|
||||||
private String subject;
|
|
||||||
}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class SignupStep3RequestModel {
|
|
||||||
private String username;
|
|
||||||
private String email;
|
|
||||||
private String phone;
|
|
||||||
private String name;
|
|
||||||
private String address;
|
|
||||||
private String identificationType;
|
|
||||||
private String identificationNumber;
|
|
||||||
private boolean isKycAdded;
|
|
||||||
private String dmpProdcode;
|
|
||||||
private String kycType;
|
|
||||||
private String kycDocumentId1; // base64 encoded
|
|
||||||
private String kycDocumentId2; // base64 encoded
|
|
||||||
private String userRole;
|
|
||||||
private String channelCode;
|
|
||||||
private String porOrgacode;
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
package com.mfsys.uco.dto.Transaction;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class TransactionOtpRequestModel {
|
|
||||||
private String porOrgacode;
|
|
||||||
private String pctCstycode;
|
|
||||||
private String channelCode;
|
|
||||||
private String cmpCustcode;
|
|
||||||
private String email;
|
|
||||||
private String pinType;
|
|
||||||
private String transPincode;
|
|
||||||
@JsonProperty("isOtpRequired")
|
|
||||||
private boolean isOtpRequired;
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class UpdateProfileRequestPayload {
|
|
||||||
private String porOrgacode;
|
|
||||||
private String cmpCustcode;
|
|
||||||
private String cmpCustImage;
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package com.mfsys.uco.dto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class VerifyPinRequest {
|
|
||||||
String channelCode;
|
|
||||||
String pctCstycode;
|
|
||||||
String porOrgacode;
|
|
||||||
String cmpCustcode;
|
|
||||||
String email;
|
|
||||||
String obpPincode;
|
|
||||||
String pinType;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
package com.mfsys.uco.dto.webclientdto;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Builder
|
|
||||||
public class AccountDetail {
|
|
||||||
protected String porOrgacode;
|
|
||||||
protected String mbmBkmsnumber;
|
|
||||||
protected String mbmBkmstitle;
|
|
||||||
protected String dmpProddesc;
|
|
||||||
protected String plcLocadesc;
|
|
||||||
protected String pcrCurrcode;
|
|
||||||
protected String pcrCurrshort;
|
|
||||||
protected String mbmBkmsopendate;
|
|
||||||
protected String pcrCurrdesc;
|
|
||||||
protected String cmpCustcode;
|
|
||||||
protected boolean mbmBkmsclosed;
|
|
||||||
protected String pctCstycode;
|
|
||||||
protected BigDecimal mbmBkmsbalance;
|
|
||||||
protected Map<String, BigDecimal> charges = Map.of();
|
|
||||||
protected String dmpProdcode;
|
|
||||||
protected boolean cmpBlacklisted;
|
|
||||||
protected String plcLocacode;
|
|
||||||
protected boolean mbmNotificationService;
|
|
||||||
protected String dmpCredittype;
|
|
||||||
protected BigDecimal perEratrateact;
|
|
||||||
protected LocalDate kycRenewalDate;
|
|
||||||
protected String padAdrsmobphone;
|
|
||||||
protected boolean btaRolloverSpecialRate;
|
|
||||||
private String pasAcstcode;
|
|
||||||
private BigDecimal btaBookingamount;
|
|
||||||
private BigDecimal bdaDpacblockamt;
|
|
||||||
private boolean bdaDpacblocked;
|
|
||||||
private String pbdBankname;
|
|
||||||
private String pbbBranchname;
|
|
||||||
private String pbbBranchcountry;
|
|
||||||
private String pbbBranchcity;
|
|
||||||
private String pcaGlaccode;
|
|
||||||
private String accJointStatus;
|
|
||||||
private String accAttortype;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.mfsys.uco.exception;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ERRCode;
|
|
||||||
|
|
||||||
public class AccountDoesntExistsException extends ApplicationException {
|
|
||||||
public AccountDoesntExistsException() {
|
|
||||||
super(null, ERRCode.ACCOUNT_NOT_FOUND, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.mfsys.uco.exception;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ERRCode;
|
|
||||||
|
|
||||||
public class BenificiaryAlreadyExistsException extends ApplicationException {
|
|
||||||
public BenificiaryAlreadyExistsException() {
|
|
||||||
super(null, ERRCode.BENEFICIARY_ALREADY_EXISTS, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.mfsys.uco.exception;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ERRCode;
|
|
||||||
|
|
||||||
public class CustomerAccountOpeningNotAllowedException extends ApplicationException {
|
|
||||||
public CustomerAccountOpeningNotAllowedException() {
|
|
||||||
super(null, ERRCode.CUSTOMER_ACCOUNT_PRODUCT_ALREADY_EXISTS, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.mfsys.uco.exception;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ERRCode;
|
|
||||||
|
|
||||||
public class InvalidTransactionAmountException extends ApplicationException {
|
|
||||||
public InvalidTransactionAmountException() {
|
|
||||||
super(null, ERRCode.INVALID_TRAN_AMT, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.mfsys.uco.exception;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ERRCode;
|
|
||||||
|
|
||||||
public class OldPinIncorrectException extends ApplicationException {
|
|
||||||
public OldPinIncorrectException() {
|
|
||||||
super(null, ERRCode.OLD_PIN_INCORRECT, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.mfsys.uco.exception;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ERRCode;
|
|
||||||
|
|
||||||
public class ReferenceNumberNotValidException extends ApplicationException {
|
|
||||||
public ReferenceNumberNotValidException() {
|
|
||||||
super(null, ERRCode.TRAN_REF_NOT_VALID, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.mfsys.uco.exception;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ERRCode;
|
|
||||||
|
|
||||||
public class SameCrDrAccountExistsException extends ApplicationException {
|
|
||||||
public SameCrDrAccountExistsException() {
|
|
||||||
super(null, ERRCode.CR_DR_SAME_ACCOUNT, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.mfsys.uco.exception;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ERRCode;
|
|
||||||
|
|
||||||
public class SameOldNewPinException extends ApplicationException {
|
|
||||||
public SameOldNewPinException() {
|
|
||||||
super(null, ERRCode.SAME_TRAN_PIN, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.mfsys.uco.exception;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ERRCode;
|
|
||||||
|
|
||||||
public class UserAlreadyRegisteredException extends ApplicationException {
|
|
||||||
public UserAlreadyRegisteredException(String porOrgacode, Object... arguments) {
|
|
||||||
super(porOrgacode, ERRCode.USER_ALREADY_REGISTERED, arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import com.mfsys.comm.util.FieldNameLength;
|
|
||||||
import jakarta.persistence.Column;
|
|
||||||
import jakarta.persistence.Embeddable;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
@Embeddable
|
|
||||||
public class AccountId implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
|
||||||
protected String porOrgacode;
|
|
||||||
|
|
||||||
@Column(name = "MBM_BKMSNUMBER", nullable = false, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
|
|
||||||
protected String mbmBkmsnumber;
|
|
||||||
|
|
||||||
|
|
||||||
public AccountId(String porOrgacode, String mbmBkmsnumber) {
|
|
||||||
this.porOrgacode = porOrgacode;
|
|
||||||
this.mbmBkmsnumber = mbmBkmsnumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AccountId() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPorOrgacode() {
|
|
||||||
return porOrgacode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPorOrgacode(String porOrgacode) {
|
|
||||||
this.porOrgacode = porOrgacode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMbmBkmsnumber() {
|
|
||||||
return mbmBkmsnumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMbmBkmsnumber(String mbmBkmsnumber) {
|
|
||||||
this.mbmBkmsnumber = mbmBkmsnumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = prime * result + ((mbmBkmsnumber == null) ? 0 : mbmBkmsnumber.hashCode());
|
|
||||||
result = prime * result + ((porOrgacode == null) ? 0 : porOrgacode.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (this == obj)
|
|
||||||
return true;
|
|
||||||
if (obj == null)
|
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
AccountId other = (AccountId) obj;
|
|
||||||
if (mbmBkmsnumber == null) {
|
|
||||||
if (other.mbmBkmsnumber != null)
|
|
||||||
return false;
|
|
||||||
} else if (!mbmBkmsnumber.equals(other.mbmBkmsnumber))
|
|
||||||
return false;
|
|
||||||
if (porOrgacode == null) {
|
|
||||||
return other.porOrgacode == null;
|
|
||||||
} else return porOrgacode.equals(other.porOrgacode);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.mfsys.comm.util.FieldNameLength;
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
@Entity(name = "UCO_CS_OC_UCOBENEFICARY")
|
|
||||||
@Table(name = "UCO_CS_OC_UCOBENEFICARY")
|
|
||||||
@Data
|
|
||||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
|
||||||
public class Beneficiary {
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
@Column(name = "SERIAL", nullable = false, updatable = false, columnDefinition = FieldNameLength.BIGINT)
|
|
||||||
private Long serial;
|
|
||||||
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
|
||||||
private String porOrgacode;
|
|
||||||
@Column(name = "email", nullable = false, columnDefinition = FieldNameLength.CODE_50)
|
|
||||||
private String email;
|
|
||||||
@Column(name = "PCR_CURRDCODE", nullable = false, updatable = true, columnDefinition = FieldNameLength.DESCRIPTION_SHORT)
|
|
||||||
private String pcrCurrcode;
|
|
||||||
@Column(name = "PCR_CURRDESC", nullable = false, updatable = true, columnDefinition = FieldNameLength.DESCRIPTION_SHORT)
|
|
||||||
private String pcrCurrdesc;
|
|
||||||
@Column(name = "PCR_CURRSHORT", nullable = false, updatable = true, columnDefinition = FieldNameLength.DESCRIPTION_SHORT)
|
|
||||||
private String pcrCurrshort;
|
|
||||||
@Column(name = "MBM_BKMSTITLE_REF", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
|
|
||||||
private String mbmBkmstitleRef;
|
|
||||||
@Column(name = "MBM_BKMSNUMBER_REF", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
|
|
||||||
private String mbmBkmsnumberRef;
|
|
||||||
// @Column(name = "OCB_BENEFICIARYVERIFIED", nullable = false, updatable = true, columnDefinition = FieldNameLength.BOOLEAN_BIT)
|
|
||||||
// private boolean ocbBeneficiaryverified;
|
|
||||||
// @Column(name = "OCB_BENEFICIARYVERIFYDATE", nullable = true, updatable = true, columnDefinition = FieldNameLength.DATETIME)
|
|
||||||
// private LocalDateTime ocbBeneficiaryverifydate;
|
|
||||||
@Column(name = "REF_PHONE_NUMBER", nullable = true, columnDefinition = FieldNameLength.CODE_50)
|
|
||||||
private String refPhoneNumber;
|
|
||||||
@Column(name = "REF_EMAIL", nullable = true, columnDefinition = FieldNameLength.CODE_50)
|
|
||||||
private String refEmail;
|
|
||||||
@Column(name = "REF_NICK_NAME", nullable = true, columnDefinition = FieldNameLength.CODE_50)
|
|
||||||
private String refNickName;
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import com.mfsys.comm.util.FieldNameLength;
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Entity(name = "PR_GL_CA_ACCOUNT")
|
|
||||||
@Table(name = "PR_GL_CA_ACCOUNT")
|
|
||||||
@IdClass(ChartOfAccountId.class)
|
|
||||||
public class ChartOfAccount {
|
|
||||||
@Id
|
|
||||||
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
|
||||||
private String porOrgacode;
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@Column(name = "PCA_GLACCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.PCA_GLACCODE)
|
|
||||||
private String pcaGlaccode;
|
|
||||||
|
|
||||||
@Column(name = "PCA_GLACDESC", nullable = false, columnDefinition = FieldNameLength.PCA_GLACDESC)
|
|
||||||
private String pcaGlacdesc;
|
|
||||||
|
|
||||||
@Column(name = "PCA_GLACSHORT", nullable = false, columnDefinition = FieldNameLength.PCA_GLACDESC)
|
|
||||||
private String pcaGlacshort;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
public class ChartOfAccountId implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private String porOrgacode;
|
|
||||||
private String pcaGlaccode;
|
|
||||||
|
|
||||||
public ChartOfAccountId(String porOrgacode, String pcaGlaccode) {
|
|
||||||
super();
|
|
||||||
this.porOrgacode = porOrgacode;
|
|
||||||
this.pcaGlaccode = pcaGlaccode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChartOfAccountId() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPorOrgacode() {
|
|
||||||
return porOrgacode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPorOrgacode(String porOrgacode) {
|
|
||||||
this.porOrgacode = porOrgacode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPcaGlaccode() {
|
|
||||||
return pcaGlaccode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPcaGlaccode(String pcaGlaccode) {
|
|
||||||
this.pcaGlaccode = pcaGlaccode;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = prime * result + ((pcaGlaccode == null) ? 0 : pcaGlaccode.hashCode());
|
|
||||||
result = prime * result + ((porOrgacode == null) ? 0 : porOrgacode.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (this == obj)
|
|
||||||
return true;
|
|
||||||
if (obj == null)
|
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
ChartOfAccountId other = (ChartOfAccountId) obj;
|
|
||||||
if (pcaGlaccode == null) {
|
|
||||||
if (other.pcaGlaccode != null)
|
|
||||||
return false;
|
|
||||||
} else if (!pcaGlaccode.equals(other.pcaGlaccode))
|
|
||||||
return false;
|
|
||||||
if (porOrgacode == null) {
|
|
||||||
if (other.porOrgacode != null)
|
|
||||||
return false;
|
|
||||||
} else if (!porOrgacode.equals(other.porOrgacode))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.mfsys.comm.util.FieldNameLength;
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Entity
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class CustomerAccountActivity {
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
|
||||||
private String porOrgacode;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "CMP_CUSTCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.CUSTOMER_CODE)
|
|
||||||
private String cmpCustcode;
|
|
||||||
private LocalDateTime date;
|
|
||||||
private String channal;
|
|
||||||
private String deviceName;
|
|
||||||
private String activity;
|
|
||||||
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
|
||||||
@JoinColumns({
|
|
||||||
@JoinColumn(name = "POR_ORGACODE", referencedColumnName = "POR_ORGACODE", insertable = false, updatable = false),
|
|
||||||
@JoinColumn(name = "CMP_CUSTCODE", referencedColumnName = "CMP_CUSTCODE", insertable = false, updatable = false)})
|
|
||||||
private CustomerProfile customer;
|
|
||||||
|
|
||||||
|
|
||||||
public CustomerAccountActivity() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import com.mfsys.comm.util.FieldNameLength;
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
@Entity(name = "BN_CS_MP_CUSTOMERPROFILE")
|
|
||||||
@Table(name = "BN_CS_MP_CUSTOMERPROFILE")
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@IdClass(CustomerProfileId.class)
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class CustomerProfile {
|
|
||||||
@Id
|
|
||||||
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
|
||||||
protected String porOrgacode;
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@Column(name = "CMP_CUSTCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.CUSTOMER_CODE)
|
|
||||||
protected String cmpCustcode;
|
|
||||||
|
|
||||||
@Column(name = "PIT_IDENVALUE", nullable = true, columnDefinition = FieldNameLength.CODE_20)
|
|
||||||
protected String pitIdenvalue;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "PIT_IDENCODE", nullable = true, columnDefinition = FieldNameLength.CODE_20)
|
|
||||||
protected String pitIdencode;
|
|
||||||
|
|
||||||
@Column(name = "PAD_ADRSMOBPHONE", nullable = true, columnDefinition = FieldNameLength.CODE_20)
|
|
||||||
protected String padAdrsmobphone;
|
|
||||||
|
|
||||||
@Column(name = "KYC_RENEWAL_DATE", nullable = true, columnDefinition = FieldNameLength.DATE)
|
|
||||||
protected LocalDate kycRenewalDate;
|
|
||||||
@Column(name = "CMP_ISKYC_VERIFIED", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
|
|
||||||
protected boolean cmpIsKycVerified = false;
|
|
||||||
@Column(name = "CMP_TRAN_PIN", nullable = true, columnDefinition = FieldNameLength.PIN_VALUE)
|
|
||||||
protected String cmpTranpin;
|
|
||||||
@Column(name = "CMP_UNVERIFIED_TRAN_PIN", nullable = true, columnDefinition = FieldNameLength.PIN_VALUE)
|
|
||||||
protected String cmpUnverifiedTranpin;
|
|
||||||
@Column(name = "CMP_TRAN_PIN_VERIFIED", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
|
|
||||||
protected boolean cmpTranpinVerfied = false;
|
|
||||||
@Column(name = "CMP_EMAIL", nullable = true, columnDefinition = FieldNameLength.CODE_50)
|
|
||||||
private String cmpEmail;
|
|
||||||
@Column(name = "CMP_NAME", nullable = true, columnDefinition = FieldNameLength.CODE_50)
|
|
||||||
private String cmpName;
|
|
||||||
@Column(name = "CMP_USERNAME", nullable = true, columnDefinition = FieldNameLength.CODE_50)
|
|
||||||
private String cmpUserName;
|
|
||||||
@Column(name = "CMP_ADDRESS", nullable = true, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
|
|
||||||
private String cmpAddress;
|
|
||||||
|
|
||||||
@Column(name = "CMP_CUSTIMG", nullable = true, columnDefinition = "LONGTEXT")
|
|
||||||
@Lob
|
|
||||||
private String cmpCustImage;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
public class CustomerProfileId implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private String porOrgacode;
|
|
||||||
private String cmpCustcode;
|
|
||||||
|
|
||||||
public CustomerProfileId() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public CustomerProfileId(String porOrgacode, String cmpCustcode) {
|
|
||||||
this.porOrgacode = porOrgacode;
|
|
||||||
this.cmpCustcode = cmpCustcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPorOrgacode() {
|
|
||||||
return porOrgacode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPorOrgacode(String porOrgacode) {
|
|
||||||
this.porOrgacode = porOrgacode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCmpCustcode() {
|
|
||||||
return cmpCustcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCmpCustcode(String cmpCustcode) {
|
|
||||||
this.cmpCustcode = cmpCustcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = prime * result + ((cmpCustcode == null) ? 0 : cmpCustcode.hashCode());
|
|
||||||
result = prime * result + ((porOrgacode == null) ? 0 : porOrgacode.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (this == obj)
|
|
||||||
return true;
|
|
||||||
if (obj == null)
|
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
CustomerProfileId other = (CustomerProfileId) obj;
|
|
||||||
if (cmpCustcode == null) {
|
|
||||||
if (other.cmpCustcode != null)
|
|
||||||
return false;
|
|
||||||
} else if (!cmpCustcode.equals(other.cmpCustcode))
|
|
||||||
return false;
|
|
||||||
if (porOrgacode == null) {
|
|
||||||
if (other.porOrgacode != null)
|
|
||||||
return false;
|
|
||||||
} else if (!porOrgacode.equals(other.porOrgacode))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import com.mfsys.comm.util.FieldNameLength;
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Entity(name = "BN_MS_GA_UCOGENERALTRANSACTIONTRAIL")
|
|
||||||
@Table(name = "BN_MS_GA_UCOGENERAALTRANSACTIONTRAIL")
|
|
||||||
public class GLAccountMasterTransaction {
|
|
||||||
|
|
||||||
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
|
||||||
protected String porOrgacode;
|
|
||||||
@Column(name = "DR_PCA_GLACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
|
|
||||||
protected String drPcaGlaccode;
|
|
||||||
@Column(name = "CR_MBM_BKMSNUMBER", nullable = false, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
|
|
||||||
protected String crMbmBkmsnumber;
|
|
||||||
@Column(name = "DMP_PRODCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.DMP_PRODCODE)
|
|
||||||
protected String dmpProdcode;
|
|
||||||
@Column(name = "DR_PCA_GLADESC", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
|
|
||||||
protected String drPcaGlacdesc;
|
|
||||||
@Column(name = "CMP_CUSTCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.CUSTOMER_CODE)
|
|
||||||
protected String cmpCustcode;
|
|
||||||
@Column(name = "CR_MBM_BKMSTITLE", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
|
|
||||||
protected String crMbmBkmstitle;
|
|
||||||
@Column(name = "SGT_SENTGNTRNUMBER", nullable = false, updatable = false, columnDefinition = FieldNameLength.CODE_500)
|
|
||||||
protected String sgtSentGntrnumber;
|
|
||||||
@Column(name = "DR_SGT_GNTRDATE", nullable = false, updatable = false, columnDefinition = FieldNameLength.DATE)
|
|
||||||
protected LocalDate drSgtGntrdate;
|
|
||||||
@Column(name = "SGT_GNTRAMT", nullable = false, updatable = false, columnDefinition = FieldNameLength.AMOUNT_REAL)
|
|
||||||
protected BigDecimal sgtGntramt = BigDecimal.ZERO;
|
|
||||||
@Column(name = "DR_SGT_GNTRAMT", nullable = false, updatable = false, columnDefinition = FieldNameLength.AMOUNT_REAL)
|
|
||||||
protected BigDecimal drSgtGntramt = BigDecimal.ZERO;
|
|
||||||
@Id
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
private Long id;
|
|
||||||
@Column(name = "CR_PCR_CURRSHORT", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
|
|
||||||
private String crPcrCurrshort;
|
|
||||||
@Column(name = "CR_PCR_CURRDESC", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
|
|
||||||
private String crPcrCurrdesc;
|
|
||||||
@Column(name = "CR_PCR_CURRCODE", columnDefinition = FieldNameLength.PCR_CURRCODE)
|
|
||||||
private String crPcrCurrcode;
|
|
||||||
}
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.mfsys.comm.util.FieldNameLength;
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import org.hibernate.annotations.Cache;
|
|
||||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Entity(name = "DG_PN_PIN")
|
|
||||||
@Table(name = "DG_PN_PIN")
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
|
||||||
public class Pin {
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
@Column(name = "PINSERIAL", nullable = false, updatable = false, columnDefinition = FieldNameLength.BIGINT)
|
|
||||||
private Long pinserial;
|
|
||||||
|
|
||||||
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
|
||||||
private String porOrgacode;
|
|
||||||
|
|
||||||
@Column(name = "username", nullable = false, updatable = false, columnDefinition = FieldNameLength.USER_NAME)
|
|
||||||
private String userName;
|
|
||||||
|
|
||||||
@Column(name = "CHANNEL_CODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.CHANNEL_CODE)
|
|
||||||
private String channelCode;
|
|
||||||
|
|
||||||
@Column(name = "PINTYPE", nullable = false, updatable = false, columnDefinition = FieldNameLength.CODE_10)
|
|
||||||
private String pintype;
|
|
||||||
|
|
||||||
@Column(name = "PINLENGTH", nullable = false, updatable = false, columnDefinition = FieldNameLength.PIN_LENGTH)
|
|
||||||
private int pinlength;
|
|
||||||
|
|
||||||
@Column(name = "PINCODE", nullable = false, updatable = true, columnDefinition = FieldNameLength.PIN_VALUE)
|
|
||||||
private String pincode;
|
|
||||||
|
|
||||||
@Column(name = "PIN_CREATEDATE", nullable = false, updatable = true, columnDefinition = FieldNameLength.DATETIME)
|
|
||||||
private LocalDateTime pinCreatedate;
|
|
||||||
|
|
||||||
@Column(name = "PIN_EXPIRYDATE", nullable = false, updatable = true, columnDefinition = FieldNameLength.DATETIME)
|
|
||||||
private LocalDateTime pinExpirydate;
|
|
||||||
|
|
||||||
@Column(name = "PINSTATUS", nullable = false, updatable = true, columnDefinition = FieldNameLength.CODE_20)
|
|
||||||
private String pinstatus;
|
|
||||||
|
|
||||||
@Column(name = "PIN_VALIDATIONDATE", nullable = true, updatable = true, columnDefinition = FieldNameLength.DATETIME)
|
|
||||||
private LocalDateTime pinValidationdate;
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@Column(name = "Version", nullable = false, updatable = true, columnDefinition = FieldNameLength.INT)
|
|
||||||
@Version
|
|
||||||
private int version;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import com.mfsys.comm.util.FieldNameLength;
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@IdClass(ProductId.class)
|
|
||||||
@Data
|
|
||||||
@Entity(name ="BN_PD_DP_DEPOSITUCOPRODUCT")
|
|
||||||
@Table(name ="BN_PD_DP_DEPOSITUCOPRODUCT")
|
|
||||||
public class Product {
|
|
||||||
@Id
|
|
||||||
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
|
||||||
private String porOrgacode;
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@Column(name = "DMP_PRODCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.DMP_PRODCODE)
|
|
||||||
private String dmpProdcode;
|
|
||||||
|
|
||||||
@Column(name = "DMP_PRODDESC", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
|
|
||||||
private String dmpProddesc;
|
|
||||||
|
|
||||||
@Column(name = "DMP_PRODSHORT", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_SHORT)
|
|
||||||
private String dmpProdshort;
|
|
||||||
|
|
||||||
@Column(name = "PCR_CURRCODE", nullable = false, columnDefinition = FieldNameLength.PCR_CURRCODE)
|
|
||||||
private String pcrCurrcode;
|
|
||||||
|
|
||||||
@Column(name = "DMP_PRODACTIVE", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
|
|
||||||
private boolean dmpProdactive=true;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
public class ProductId implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
private String porOrgacode;
|
|
||||||
private String dmpProdcode;
|
|
||||||
|
|
||||||
public ProductId() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProductId(String porOrgacode, String dmpProdcode) {
|
|
||||||
this.porOrgacode = porOrgacode;
|
|
||||||
this.dmpProdcode = dmpProdcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPorOrgacode() {
|
|
||||||
return porOrgacode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPorOrgacode(String porOrgacode) {
|
|
||||||
this.porOrgacode = porOrgacode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getdmpProdcode() {
|
|
||||||
return dmpProdcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setdmpProdcode(String dmpProdcode) {
|
|
||||||
this.dmpProdcode = dmpProdcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = prime * result + ((dmpProdcode == null) ? 0 : dmpProdcode.hashCode());
|
|
||||||
result = prime * result + ((porOrgacode == null) ? 0 : porOrgacode.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (this == obj)
|
|
||||||
return true;
|
|
||||||
if (obj == null)
|
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
ProductId other = (ProductId) obj;
|
|
||||||
if (dmpProdcode == null) {
|
|
||||||
if (other.dmpProdcode != null)
|
|
||||||
return false;
|
|
||||||
} else if (!dmpProdcode.equals(other.dmpProdcode))
|
|
||||||
return false;
|
|
||||||
if (porOrgacode == null) {
|
|
||||||
if (other.porOrgacode != null)
|
|
||||||
return false;
|
|
||||||
} else if (!porOrgacode.equals(other.porOrgacode))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import com.mfsys.comm.util.FieldNameLength;
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Entity(name = "BN_MS_UA_UCOACCOUNTTRAIL")
|
|
||||||
@Table(name = "BN_MS_UA_UCOACCOUNTTRAIL")
|
|
||||||
public class TransactionTrail {
|
|
||||||
|
|
||||||
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
|
|
||||||
protected String porOrgacode;
|
|
||||||
@Column(name = "DR_MBM_BKMSNUMBER", nullable = false, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
|
|
||||||
protected String drMbmBkmsnumber;
|
|
||||||
@Column(name = "CR_MBM_BKMSNUMBER", nullable = false, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
|
|
||||||
protected String crMbmBkmsnumber;
|
|
||||||
@Column(name = "DMP_PRODCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.DMP_PRODCODE)
|
|
||||||
protected String dmpProdcode;
|
|
||||||
@Column(name = "CR_MBM_BKMSBALANCE", nullable = true, columnDefinition = FieldNameLength.AMOUNT_REAL)
|
|
||||||
protected BigDecimal crMbmBkmsbalance = BigDecimal.ZERO;
|
|
||||||
@Column(name = "DR_MBM_BKMSBALANCE", nullable = true, columnDefinition = FieldNameLength.AMOUNT_REAL)
|
|
||||||
protected BigDecimal drMbmBkmsbalance = BigDecimal.ZERO;
|
|
||||||
@Column(name = "DR_MBM_BKMSTITLE", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
|
|
||||||
protected String drmbmBkmstitle;
|
|
||||||
@Column(name = "CMP_CUSTCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.CUSTOMER_CODE)
|
|
||||||
protected String cmpCustcode;
|
|
||||||
@Column(name = "CR_MBM_BKMSTITLE", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
|
|
||||||
protected String crMbmBkmstitle;
|
|
||||||
|
|
||||||
@Column(name = "SGT_SENTGNTRNUMBER", nullable = false, updatable = false, columnDefinition = FieldNameLength.CODE_500)
|
|
||||||
protected String sgtSentGntrnumber;
|
|
||||||
@Column(name = "SGT_SENTNODEID", nullable = false, updatable = false, columnDefinition = FieldNameLength.CODE_500)
|
|
||||||
protected String sgtSentNodeId;
|
|
||||||
@Column(name = "SGT_RECEIVEGNTRNUMBER", nullable = true, updatable = true, columnDefinition = FieldNameLength.CODE_500)
|
|
||||||
protected String sgtReceiveGntrnumber;
|
|
||||||
@Column(name = "SGT_RECEIVENODEID", nullable = true, updatable = true, columnDefinition = FieldNameLength.CODE_500)
|
|
||||||
protected String sgtReceiveNodeId;
|
|
||||||
|
|
||||||
@Column(name = "DR_SGT_GNTRDATE", nullable = false, updatable = false, columnDefinition = FieldNameLength.DATE)
|
|
||||||
protected LocalDate drSgtGntrdate;
|
|
||||||
@Column(name = "CR_SGT_GNTRDATE", nullable = true, updatable = false, columnDefinition = FieldNameLength.DATE)
|
|
||||||
protected LocalDate crSgtGntrdate;
|
|
||||||
@Column(name = "SGT_GNTRAMT", nullable = false, updatable = false, columnDefinition = FieldNameLength.AMOUNT_REAL)
|
|
||||||
protected BigDecimal sgtGntramt = BigDecimal.ZERO;
|
|
||||||
@Column(name = "DR_SGT_GNTRAMT", nullable = false, updatable = false, columnDefinition = FieldNameLength.AMOUNT_REAL)
|
|
||||||
protected BigDecimal drSgtGntramt = BigDecimal.ZERO;
|
|
||||||
@Column(name = "CR_SGT_GNTRAMT", nullable = true, updatable = false, columnDefinition = FieldNameLength.AMOUNT_REAL)
|
|
||||||
protected BigDecimal crSgtGntramt = BigDecimal.ZERO;
|
|
||||||
@Column(name = "BAT_ACNTTRANSENT", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
|
|
||||||
protected boolean batAcnttranSend;
|
|
||||||
@Column(name = "BAT_ACNTTRANRECEIVED", nullable = true, columnDefinition = FieldNameLength.BOOLEAN_BIT)
|
|
||||||
protected boolean batAcnttranReceived;
|
|
||||||
@Column(name = "BAT_ACNTTRANREVERSED", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
|
|
||||||
protected boolean batAcnttranReversed;
|
|
||||||
@Column(name = "CMP_REFCODE", nullable = true, updatable = true, columnDefinition = FieldNameLength.CODE_500)
|
|
||||||
protected String cmpRefcode;
|
|
||||||
@Column(name = "EXP_SGT_GNTRDATE", nullable = true, updatable = false, columnDefinition = FieldNameLength.DATE)
|
|
||||||
protected LocalDate expSgtGntrdate;
|
|
||||||
@Transient
|
|
||||||
protected int daysToExpire;
|
|
||||||
@Id
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
private Long id;
|
|
||||||
@Column(name = "DR_PCR_CURRDESC", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
|
|
||||||
private String drpcrCurrdesc;
|
|
||||||
@Column(name = "DR_PCR_CURRCODE", columnDefinition = FieldNameLength.PCR_CURRCODE)
|
|
||||||
private String drPcrCurrcode;
|
|
||||||
@Column(name = "DR_PCR_CURRSHORT", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
|
|
||||||
private String drPcrCurrshort;
|
|
||||||
@Column(name = "cR_PCR_CURRSHORT", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
|
|
||||||
private String crPcrCurrshort;
|
|
||||||
@Column(name = "CR_PCR_CURRDESC", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
|
|
||||||
private String crPcrCurrdesc;
|
|
||||||
@Column(name = "CR_PCR_CURRCODE", columnDefinition = FieldNameLength.PCR_CURRCODE)
|
|
||||||
private String crPcrCurrcode;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
package com.mfsys.uco.model;
|
|
||||||
|
|
||||||
import com.mfsys.comm.util.FieldNameLength;
|
|
||||||
import jakarta.persistence.Column;
|
|
||||||
import jakarta.persistence.EmbeddedId;
|
|
||||||
import jakarta.persistence.Entity;
|
|
||||||
import jakarta.persistence.Table;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
@Entity(name = "BN_MS_UC_UCOACCOUNT")
|
|
||||||
@Table(name = "BN_MS_UA_UCOACCOUNT")
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class UcoAccount {
|
|
||||||
@Column(name = "DMP_PRODCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.DMP_PRODCODE)
|
|
||||||
protected String dmpProdcode;
|
|
||||||
@Column(name = "MBM_BKMSTITLE", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
|
|
||||||
protected String mbmBkmstitle;
|
|
||||||
@Column(name = "CMP_CUSTCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.CUSTOMER_CODE)
|
|
||||||
protected String cmpCustcode;
|
|
||||||
@Column(name = "MBM_BKMSCLOSED", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
|
|
||||||
protected boolean mbmBkmsclosed;
|
|
||||||
@Column(name = "SGT_LASTTRANDATE", nullable = true, updatable = true, columnDefinition = FieldNameLength.DATE)
|
|
||||||
protected LocalDate sgtLasttrandate;
|
|
||||||
@Column(name = "MBM_BKMSOPENDATE", nullable = false, columnDefinition = FieldNameLength.DATE)
|
|
||||||
protected LocalDate mbmBkmsopendate;
|
|
||||||
@EmbeddedId
|
|
||||||
private AccountId id;
|
|
||||||
@Column(name = "PCR_CURRDESC", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
|
|
||||||
private String pcrCurrdesc;
|
|
||||||
@Column(name = "PCR_CURRCODE", columnDefinition = FieldNameLength.PCR_CURRCODE)
|
|
||||||
private String pcrCurrcode;
|
|
||||||
@Column(name = "PCR_CURRSHORT", columnDefinition = FieldNameLength.PCR_CURRCODE)
|
|
||||||
private String pcrCurrshort;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
package com.mfsys.uco.repository;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.Beneficiary;
|
|
||||||
import jakarta.transaction.Transactional;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface BeneficiaryRepository extends JpaRepository<Beneficiary, Long> {
|
|
||||||
|
|
||||||
Optional<Beneficiary> findBeneficiaryByEmailAndPorOrgacodeAndMbmBkmsnumberRef(String email, String porOrgacode, String mbmBkmsnumberRef);
|
|
||||||
|
|
||||||
List<Beneficiary> findBeneficiariesByEmailAndPorOrgacode(String email, String porOrgacode);
|
|
||||||
@Transactional
|
|
||||||
void deleteByMbmBkmsnumberRefAndPorOrgacodeAndEmail(String mbmBkmsnumberRef, String porOrgacode, String email);
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.mfsys.uco.repository;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.ChartOfAccount;
|
|
||||||
import com.mfsys.uco.model.ChartOfAccountId;
|
|
||||||
import com.mfsys.uco.model.Product;
|
|
||||||
import com.mfsys.uco.model.ProductId;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface ChartOfAccountRepository extends JpaRepository<ChartOfAccount, ChartOfAccountId> {
|
|
||||||
@Query("SELECT p FROM PR_GL_CA_ACCOUNT p WHERE p.porOrgacode = :porOrgacode")
|
|
||||||
List<ChartOfAccount> fetchBankGls(String porOrgacode);
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
package com.mfsys.uco.repository;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.CustomerAccountActivity;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface CustomerAccountActivityRepository extends JpaRepository<CustomerAccountActivity, Integer> {
|
|
||||||
|
|
||||||
@Query("SELECT cust FROM CustomerAccountActivity cust WHERE cust.porOrgacode = :porOrgacode and cust.cmpCustcode = :cmpCustcode AND DATE(cust.date) BETWEEN DATE(:fdate) AND DATE(:tdate)")
|
|
||||||
List<CustomerAccountActivity> findAllByCmpUserIdAndDateBetween(String porOrgacode, String cmpCustcode, String fdate, String tdate);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
package com.mfsys.uco.repository;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.CustomerProfile;
|
|
||||||
import com.mfsys.uco.model.CustomerProfileId;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface CustomerProfileRepository extends JpaRepository<CustomerProfile, CustomerProfileId> {
|
|
||||||
@Query("SELECT c FROM BN_CS_MP_CUSTOMERPROFILE c WHERE c.porOrgacode =:porOrgacode and c.padAdrsmobphone = :phone")
|
|
||||||
CustomerProfile findProfilesByMobilePhone(String porOrgacode, String phone);
|
|
||||||
@Query("SELECT c FROM BN_CS_MP_CUSTOMERPROFILE c WHERE c.porOrgacode =:porOrgacode and c.cmpEmail = :cmpEmail")
|
|
||||||
CustomerProfile findCustomerProfileByCmpEmailAndPorOrgacode(String porOrgacode, String cmpEmail);
|
|
||||||
@Query("SELECT c FROM BN_CS_MP_CUSTOMERPROFILE c WHERE c.porOrgacode =:porOrgacode and c.cmpEmail = :email")
|
|
||||||
CustomerProfile findbyEmail(String porOrgacode, String email);
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.mfsys.uco.repository;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.Product;
|
|
||||||
import com.mfsys.uco.model.ProductId;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface DepositUcoProductsRepository extends JpaRepository<Product, ProductId> {
|
|
||||||
@Query("SELECT p FROM BN_PD_DP_DEPOSITUCOPRODUCT p WHERE p.porOrgacode = :porOrgacode AND p.dmpProdactive = true")
|
|
||||||
List<Product> fetchAllUcoActiveProducts(String porOrgacode);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
package com.mfsys.uco.repository;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.GLAccountMasterTransaction;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface GLAccountMasterTransactionTrailRepository extends JpaRepository<GLAccountMasterTransaction, Integer> {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.mfsys.uco.repository;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.Pin;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface PinRepository extends JpaRepository<Pin, Long> {
|
|
||||||
@Query("SELECT p FROM DG_PN_PIN p WHERE p.userName = :username AND p.pinstatus = 'Unverified' AND p.pinExpirydate > CURRENT_TIMESTAMP AND p.pintype=:pinType ORDER BY p.pinserial DESC LIMIT 1")
|
|
||||||
Optional<Pin> findLatestActiveOtpByUserName(String username, String pinType);
|
|
||||||
|
|
||||||
@Query("SELECT p FROM DG_PN_PIN p WHERE p.pincode =:obpPincode AND p.pinstatus = 'Unverified' AND p.pinExpirydate > CURRENT_TIMESTAMP AND p.pintype=:pinType ORDER BY p.pinserial DESC LIMIT 1")
|
|
||||||
Optional<Pin> findsss( String pinType, String obpPincode);
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
package com.mfsys.uco.repository;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.TransactionTrail;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface TransactionTrailRepository extends JpaRepository<TransactionTrail, Integer> {
|
|
||||||
|
|
||||||
@Query("SELECT t FROM BN_MS_UA_UCOACCOUNTTRAIL t WHERE t.porOrgacode =:porOrgacode and t.crMbmBkmsnumber = :crMbmBkmsnumber and t.batAcnttranReceived = false")
|
|
||||||
Optional<List<TransactionTrail>> findByPorOrgacodeAndCrMbmBkmsnumberAndBatAcnttranReceivedFalse(String porOrgacode, String crMbmBkmsnumber);
|
|
||||||
|
|
||||||
|
|
||||||
@Query(value = "SELECT * " +
|
|
||||||
"FROM bn_ms_ua_ucoaccounttrail " +
|
|
||||||
"WHERE (dr_mbm_bkmsnumber = :mbmBkmsnumber AND (bat_acnttransent = TRUE OR bat_acnttranreceived = TRUE)) " +
|
|
||||||
" OR (cr_mbm_bkmsnumber = :mbmBkmsnumber AND (bat_acnttransent = TRUE AND bat_acnttranreceived = TRUE AND BAT_ACNTTRANREVERSED = false)) ORDER BY id DESC", nativeQuery = true)
|
|
||||||
Optional<List<TransactionTrail>> fetchDepositAccountStatement(String mbmBkmsnumber);
|
|
||||||
|
|
||||||
TransactionTrail findByPorOrgacodeAndSgtSentNodeIdAndSgtSentGntrnumber(String porOrgacode, String sgtSentNodeId, String sgtSentGntrnumber);
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
package com.mfsys.uco.repository;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.AccountId;
|
|
||||||
import com.mfsys.uco.model.UcoAccount;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface UCOAccountRepository extends JpaRepository<UcoAccount, AccountId> {
|
|
||||||
|
|
||||||
@Query("SELECT c FROM BN_MS_UC_UCOACCOUNT c WHERE c.id.porOrgacode =:porOrgacode and c.cmpCustcode = :cmpCustcode")
|
|
||||||
List<UcoAccount> findUcoAccountByCmpCustcode(String porOrgacode, String cmpCustcode);
|
|
||||||
}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
package com.mfsys.uco.service;
|
|
||||||
|
|
||||||
import com.mfsys.uco.model.CustomerAccountActivity;
|
|
||||||
import com.mfsys.uco.repository.CustomerAccountActivityRepository;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class CustomerAccountActivityService {
|
|
||||||
|
|
||||||
private CustomerAccountActivityRepository customerAccountActivityRepository;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public CustomerAccountActivityService(CustomerAccountActivityRepository customerAccountActivityRepository) {
|
|
||||||
this.customerAccountActivityRepository = customerAccountActivityRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CustomerAccountActivity> getCustomerAccountActivity(String porOrgacode, String cmpCustcode, String fdate, String tdate) {
|
|
||||||
return customerAccountActivityRepository.findAllByCmpUserIdAndDateBetween(porOrgacode, cmpCustcode, fdate, tdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void postCustomerAccountActivity(CustomerAccountActivity customerAccountActivity) {
|
|
||||||
customerAccountActivityRepository.save(customerAccountActivity);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
package com.mfsys.uco.service;
|
|
||||||
|
|
||||||
import com.mfsys.uco.dto.UpdateProfileRequestPayload;
|
|
||||||
import com.mfsys.uco.exception.BenificiaryAlreadyExistsException;
|
|
||||||
import com.mfsys.uco.model.Beneficiary;
|
|
||||||
import com.mfsys.uco.model.CustomerProfile;
|
|
||||||
import com.mfsys.uco.model.CustomerProfileId;
|
|
||||||
import com.mfsys.uco.repository.BeneficiaryRepository;
|
|
||||||
import com.mfsys.uco.repository.CustomerProfileRepository;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class CustomerProfileService {
|
|
||||||
private final CustomerProfileRepository customerProfileRepository;
|
|
||||||
private final BeneficiaryRepository beneficiaryRepository;
|
|
||||||
|
|
||||||
public void deleteBeneficiary(String porOrgacode, String email, String mbmBkmsnumberRef) {
|
|
||||||
beneficiaryRepository.deleteByMbmBkmsnumberRefAndPorOrgacodeAndEmail(mbmBkmsnumberRef, porOrgacode, email);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CustomerProfile fetchCustcodeBasedOnEmail(String porOrgacode, String email) {
|
|
||||||
return customerProfileRepository.findbyEmail(porOrgacode, email);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateCustomerProfile(UpdateProfileRequestPayload updateProfileRequestPayload) {
|
|
||||||
customerProfileRepository.findById(new CustomerProfileId(updateProfileRequestPayload.getPorOrgacode(), updateProfileRequestPayload.getCmpCustcode()))
|
|
||||||
.ifPresent(customerProfile -> {
|
|
||||||
customerProfile.setCmpCustImage(updateProfileRequestPayload.getCmpCustImage());
|
|
||||||
customerProfileRepository.save(customerProfile);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addBeneficiary(Beneficiary beneficiary) {
|
|
||||||
Optional<Beneficiary> existing = beneficiaryRepository.findBeneficiaryByEmailAndPorOrgacodeAndMbmBkmsnumberRef(beneficiary.getEmail(),beneficiary.getPorOrgacode(), beneficiary.getMbmBkmsnumberRef());
|
|
||||||
if(existing.isPresent()){
|
|
||||||
throw new BenificiaryAlreadyExistsException();
|
|
||||||
}
|
|
||||||
beneficiaryRepository.save(beneficiary);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Beneficiary> fetchBeneficiaryBasedOnEmail(String porOrgacode, String email) {
|
|
||||||
return beneficiaryRepository.findBeneficiariesByEmailAndPorOrgacode(email,porOrgacode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
package com.mfsys.uco.service;
|
|
||||||
|
|
||||||
import com.mfsys.uco.constants.UCOURI;
|
|
||||||
import com.mfsys.uco.model.ChartOfAccount;
|
|
||||||
import com.mfsys.uco.model.Product;
|
|
||||||
import com.mfsys.uco.model.TransactionTrail;
|
|
||||||
import com.mfsys.uco.repository.ChartOfAccountRepository;
|
|
||||||
import com.mfsys.uco.repository.DepositUcoProductsRepository;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DepositUcoProductsService {
|
|
||||||
private final WebClientDepositService webClientDepositService;
|
|
||||||
private final DepositUcoProductsRepository depositUcoProductsRepository;
|
|
||||||
private final ChartOfAccountRepository chartOfAccountRepository;
|
|
||||||
|
|
||||||
|
|
||||||
public List<Product> fetchDepositUcoProducts(String porOrgacode) {
|
|
||||||
String url = UCOURI.FETCH_DEPOSIT_PRODUCTS + "?porOrgacode=" + porOrgacode;
|
|
||||||
return (List<Product>) webClientDepositService.fetchUcoDepositProducts(url, porOrgacode);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public List<ChartOfAccount> fetchUcoGls(String porOrgacode) {
|
|
||||||
return chartOfAccountRepository.fetchBankGls(porOrgacode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
package com.mfsys.uco.service;
|
|
||||||
|
|
||||||
import com.mfsys.comm.commonservices.OtpService;
|
|
||||||
import com.mfsys.comm.constant.EurekaRegisteredMicroServicesURI;
|
|
||||||
import com.mfsys.comm.exception.InvalidOTPException;
|
|
||||||
import com.mfsys.uco.dto.OTPRequest;
|
|
||||||
import com.mfsys.uco.model.Pin;
|
|
||||||
import com.mfsys.uco.repository.PinRepository;
|
|
||||||
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.reactive.function.client.WebClient;
|
|
||||||
import reactor.core.publisher.Mono;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class NotificationService {
|
|
||||||
@LoadBalanced
|
|
||||||
private final WebClient webClient;
|
|
||||||
private final OtpService otpService;
|
|
||||||
private final PinRepository pinRepository;
|
|
||||||
|
|
||||||
public NotificationService(WebClient.Builder webClientBuilder, OtpService otpService, PinRepository pinRepository) {
|
|
||||||
this.webClient = webClientBuilder.baseUrl(EurekaRegisteredMicroServicesURI.NOTIFICATION_SERVICE_LB).build();
|
|
||||||
this.otpService = otpService;
|
|
||||||
this.pinRepository = pinRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long sendOtp(OTPRequest otpRequest) {
|
|
||||||
String otp = otpRequest.isOtpRequired() ? otpService.generateOtp() : "123456";
|
|
||||||
Pin pin = new Pin();
|
|
||||||
final LocalDateTime createDate = LocalDateTime.now();
|
|
||||||
final LocalDateTime expiryDate = LocalDateTime.now().plusMinutes(1);
|
|
||||||
pin.setPinCreatedate(createDate);
|
|
||||||
pin.setPinExpirydate(expiryDate);
|
|
||||||
pin.setChannelCode(otpRequest.getChannelCode());
|
|
||||||
pin.setPintype(otpRequest.getPinType());
|
|
||||||
pin.setPincode(otp);
|
|
||||||
pin.setPorOrgacode(otpRequest.getPorOrgacode());
|
|
||||||
pin.setVersion(1);
|
|
||||||
pin.setPinlength(6);
|
|
||||||
pin.setPinstatus("Unverified");
|
|
||||||
pin.setUserName(otpRequest.getEmail());
|
|
||||||
pinRepository.save(pin);
|
|
||||||
webClient.post().uri("/notification/otp/email").bodyValue(Map.of("email", otpRequest.getEmail(), "subject", otpRequest.getSubject(), "otp", otp, "userName", otpRequest.getUsername(),"phoneNumber",otpRequest.getPhone())).retrieve()
|
|
||||||
.onStatus(status -> status.is4xxClientError() || status.is5xxServerError(), clientResponse
|
|
||||||
-> Mono.error(new RuntimeException("Response has error status."))).bodyToMono(String.class).block();
|
|
||||||
return pin.getPinserial();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void verifyOtp(String porOrgacode, String email, String obpPincode, String pinType) {
|
|
||||||
Optional<Pin> pin = pinRepository.findLatestActiveOtpByUserName(email, pinType);
|
|
||||||
if (pin.isPresent() && pin.get().getPincode().equals(obpPincode) && pin.get().getPorOrgacode().equals(porOrgacode)) {
|
|
||||||
pin.get().setPinstatus("VERIFIED");
|
|
||||||
pinRepository.save(pin.get());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
throw new InvalidOTPException(porOrgacode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void verifyOtpViaOtpId(String id, String pinType, String obpPincode) {
|
|
||||||
Pin pin = pinRepository.findsss(pinType, obpPincode)
|
|
||||||
.orElseThrow(() -> new InvalidOTPException(id));
|
|
||||||
pin.setPinstatus("VERIFIED");
|
|
||||||
pinRepository.save(pin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
package com.mfsys.uco.service;
|
|
||||||
|
|
||||||
import com.mfsys.uco.dto.ChangeTransactionPinRequest;
|
|
||||||
import com.mfsys.uco.dto.CreateTransactionPinRequest;
|
|
||||||
import com.mfsys.uco.dto.OTPRequest;
|
|
||||||
import com.mfsys.uco.dto.VerifyPinRequest;
|
|
||||||
import com.mfsys.uco.exception.OldPinIncorrectException;
|
|
||||||
import com.mfsys.uco.exception.SameOldNewPinException;
|
|
||||||
import com.mfsys.uco.model.CustomerProfile;
|
|
||||||
import com.mfsys.uco.model.CustomerProfileId;
|
|
||||||
import com.mfsys.uco.repository.CustomerProfileRepository;
|
|
||||||
import jakarta.transaction.Transactional;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Transactional
|
|
||||||
public class TransactionPinService {
|
|
||||||
|
|
||||||
private final CustomerProfileRepository customerProfileRepository;
|
|
||||||
private final NotificationService notificationService;
|
|
||||||
|
|
||||||
public void createTransactionPin(CreateTransactionPinRequest request) {
|
|
||||||
CustomerProfile profile = fetchCustomer(request.getPorOrgacode(), request.getCmpCustcode());
|
|
||||||
profile.setCmpTranpin(request.getNewTransPincode());
|
|
||||||
sendOtp(profile, request.getChannelCode(), request.getPinType(), "Create Transaction Pin Verification OTP", request.isOtpRequired());
|
|
||||||
customerProfileRepository.save(profile);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public boolean verifyOTPAndSavePin(VerifyPinRequest request) {
|
|
||||||
notificationService.verifyOtp(request.getPorOrgacode(), request.getEmail(), request.getObpPincode(), request.getPinType());
|
|
||||||
CustomerProfile profile = fetchCustomer(request.getPorOrgacode(), request.getCmpCustcode());
|
|
||||||
if (Objects.nonNull(profile.getCmpUnverifiedTranpin())) {
|
|
||||||
profile.setCmpTranpin(profile.getCmpUnverifiedTranpin());
|
|
||||||
profile.setCmpUnverifiedTranpin(null);
|
|
||||||
}
|
|
||||||
profile.setCmpTranpinVerfied(true);
|
|
||||||
customerProfileRepository.save(profile);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CustomerProfile fetchCustomer(String porOrgacode, String cmpCustcode) {
|
|
||||||
CustomerProfileId profileId = new CustomerProfileId(porOrgacode, cmpCustcode);
|
|
||||||
return customerProfileRepository.findById(profileId)
|
|
||||||
.orElseThrow(() -> new IllegalArgumentException("Customer profile not found for ID: " + profileId));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateTransactionPin(ChangeTransactionPinRequest request) {
|
|
||||||
CustomerProfile profile = fetchCustomer(request.getPorOrgacode(), request.getCmpCustcode());
|
|
||||||
if(request.getNewTransPincode().equals(profile.getCmpTranpin())){
|
|
||||||
throw new SameOldNewPinException();
|
|
||||||
}
|
|
||||||
validateOldPin(profile, request.getOldTransPincode());
|
|
||||||
profile.setCmpUnverifiedTranpin(request.getNewTransPincode());
|
|
||||||
customerProfileRepository.save(profile);
|
|
||||||
sendOtp(profile, request.getChannelCode(), request.getPinType(), "Change Transaction Pin Verification OTP", request.isOtpRequired());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void validateOldPin(CustomerProfile profile, String oldPin) {
|
|
||||||
if (Objects.nonNull(profile.getCmpTranpin()) && !profile.getCmpTranpin().equals(oldPin)) {
|
|
||||||
throw new OldPinIncorrectException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long sendOtp(CustomerProfile profile, String channelCode, String pinType, String subject, boolean isOtpRequired) {
|
|
||||||
OTPRequest otpRequest = OTPRequest.builder()
|
|
||||||
.porOrgacode(profile.getPorOrgacode())
|
|
||||||
.channelCode(channelCode)
|
|
||||||
.pinType(pinType)
|
|
||||||
.email(profile.getCmpEmail())
|
|
||||||
.phone(profile.getPadAdrsmobphone())
|
|
||||||
.isOtpRequired(isOtpRequired)
|
|
||||||
.username(profile.getCmpUserName())
|
|
||||||
.subject(subject)
|
|
||||||
.build();
|
|
||||||
return notificationService.sendOtp(otpRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,340 +0,0 @@
|
|||||||
package com.mfsys.uco.service;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.mfsys.comm.util.MapValueExtractorUtil;
|
|
||||||
import com.mfsys.uco.UCOURI;
|
|
||||||
import com.mfsys.uco.dto.*;
|
|
||||||
import com.mfsys.uco.dto.Transaction.TransactionOtpRequestModel;
|
|
||||||
import com.mfsys.uco.exception.InvalidTransactionAmountException;
|
|
||||||
import com.mfsys.uco.exception.ReferenceNumberNotValidException;
|
|
||||||
import com.mfsys.uco.exception.SameCrDrAccountExistsException;
|
|
||||||
import com.mfsys.uco.model.CustomerProfile;
|
|
||||||
import com.mfsys.uco.model.CustomerProfileId;
|
|
||||||
import com.mfsys.uco.model.GLAccountMasterTransaction;
|
|
||||||
import com.mfsys.uco.model.TransactionTrail;
|
|
||||||
import com.mfsys.uco.repository.CustomerProfileRepository;
|
|
||||||
import com.mfsys.uco.repository.GLAccountMasterTransactionTrailRepository;
|
|
||||||
import com.mfsys.uco.repository.TransactionTrailRepository;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.temporal.ChronoUnit;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@Data
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class TransactionService {
|
|
||||||
|
|
||||||
private final CustomerProfileRepository customerProfileRepository;
|
|
||||||
private final NotificationService notificationService;
|
|
||||||
private final TransactionPinService transactionPinService;
|
|
||||||
private final TransactionTrailRepository transactionTrailRepository;
|
|
||||||
private final UcoAccountService ucoAccountService;
|
|
||||||
private final WebClientDepositService webClientDepositService;
|
|
||||||
private final GLAccountMasterTransactionTrailRepository glAccountMasterTransactionTrailRepository;
|
|
||||||
|
|
||||||
public TransactionPinResponseModel sendOtpAndValidateTranPin(TransactionOtpRequestModel transactionOtpRequestModel, boolean isResendOtp) {
|
|
||||||
CustomerProfile customerProfile = verifyOldPinAndGetCmpProfile(transactionOtpRequestModel.getPorOrgacode(),
|
|
||||||
transactionOtpRequestModel.getTransPincode(), transactionOtpRequestModel.getCmpCustcode(), isResendOtp);
|
|
||||||
return TransactionPinResponseModel.builder().notificationId(transactionPinService.sendOtp(customerProfile, transactionOtpRequestModel.getChannelCode(),
|
|
||||||
transactionOtpRequestModel.getPinType(), "Transaction Verification OTP", transactionOtpRequestModel.isOtpRequired())).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> cashInTransaction(CashInTransactionRequest transactionRequest) {
|
|
||||||
if(transactionRequest.getSgtGntramtfc()<=0){
|
|
||||||
throw new InvalidTransactionAmountException();
|
|
||||||
}
|
|
||||||
validation(transactionRequest);
|
|
||||||
TransactionTrail transactionTrail = TransactionTrail.builder()
|
|
||||||
.porOrgacode(transactionRequest.getPorOrgacode())
|
|
||||||
.drMbmBkmsnumber(transactionRequest.getDrMbmBkmsnumber())
|
|
||||||
.crMbmBkmsnumber(transactionRequest.getCrMbmBkmsnumber())
|
|
||||||
.dmpProdcode(transactionRequest.getDmpProdCode())
|
|
||||||
.drmbmBkmstitle(transactionRequest.getDrMbmBkmstitle())
|
|
||||||
.drpcrCurrdesc(transactionRequest.getDrPcrCurrdesc())
|
|
||||||
.drPcrCurrshort(transactionRequest.getDrPcrCurrshort())
|
|
||||||
.cmpCustcode(transactionRequest.getCmpCustcode())
|
|
||||||
.drPcrCurrcode(transactionRequest.getDrPcrCurrcode())
|
|
||||||
.crMbmBkmstitle(transactionRequest.getCrMbmBkmstitle())
|
|
||||||
.drSgtGntramt(BigDecimal.valueOf(convertToPKR(transactionRequest.getDrPcrCurrcode(),transactionRequest.getSgtGntramtfc(), transactionRequest.getPorOrgacode())))
|
|
||||||
.crSgtGntramt(null)
|
|
||||||
.crPcrCurrdesc(transactionRequest.getCrPcrCurrdesc())
|
|
||||||
.crPcrCurrcode(transactionRequest.getCrPcrCurrcode())
|
|
||||||
.crPcrCurrshort(transactionRequest.getCrPcrCurrshort())
|
|
||||||
.sgtSentGntrnumber(null)
|
|
||||||
.drSgtGntrdate(LocalDate.now())
|
|
||||||
.sgtGntramt(BigDecimal.valueOf(transactionRequest.getSgtGntramtfc()))
|
|
||||||
.batAcnttranSend(false)
|
|
||||||
.batAcnttranReceived(false)
|
|
||||||
.sgtReceiveGntrnumber(null)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
CoreCashInTransaction coreCashInTransaction = CoreCashInTransaction.builder()
|
|
||||||
.drMbmBkmsnumber(transactionRequest.getDrMbmBkmsnumber())
|
|
||||||
.drPcrCurrcode(transactionTrail.getDrPcrCurrcode())
|
|
||||||
.accSgtGntramtfc(transactionRequest.getSgtGntramtfc())
|
|
||||||
.sgtGntramtfc(transactionTrail.getCrSgtGntramt())
|
|
||||||
.otdTrancomment(transactionRequest.getOtdTrancomment())
|
|
||||||
.porOrgacode(transactionRequest.getPorOrgacode())
|
|
||||||
.pcaGlaccode("A01011003")
|
|
||||||
.build();
|
|
||||||
Map<String, Object> response = (Map<String, Object>) webClientDepositService.postTransaction(coreCashInTransaction, UCOURI.BANKING_CASH_IN, transactionRequest.getPorOrgacode());
|
|
||||||
transactionTrail.setSgtSentGntrnumber(String.valueOf(response.get("tran_id")));
|
|
||||||
transactionTrail.setSgtSentNodeId(String.valueOf(response.get("node_id")));
|
|
||||||
transactionTrail.setBatAcnttranSend(true);
|
|
||||||
if(Objects.nonNull(transactionRequest.getCmpRefcode())) {
|
|
||||||
transactionTrail.setCmpRefcode(transactionTrail.getSgtSentGntrnumber() + transactionRequest.getCmpRefcode());
|
|
||||||
}
|
|
||||||
transactionTrail.setDrMbmBkmsbalance(MapValueExtractorUtil.getValueAsBigDecimal(response, "mbmBkmsbalance"));
|
|
||||||
transactionTrailRepository.save(transactionTrail);
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void validation(CashInTransactionRequest transactionRequest) {
|
|
||||||
if (transactionRequest.getCrMbmBkmsnumber().equals(transactionRequest.getDrMbmBkmsnumber())) {
|
|
||||||
throw new SameCrDrAccountExistsException();
|
|
||||||
}
|
|
||||||
notificationService.verifyOtpViaOtpId(transactionRequest.getNotificationId(), transactionRequest.getPinType(), transactionRequest.getObpPincode());
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<TransactionTrail> fetchPendingCrTransactions(String porOrgacode, String mbmBkmsnumber) {
|
|
||||||
List<TransactionTrail> transactionTrails = findPendingCrTransactions(porOrgacode,mbmBkmsnumber);
|
|
||||||
|
|
||||||
if(!transactionTrails.isEmpty()){
|
|
||||||
transactionTrails.stream().forEach(t -> {
|
|
||||||
LocalDate datePlus14Days = t.getDrSgtGntrdate().plusDays(14);
|
|
||||||
t.setExpSgtGntrdate((datePlus14Days.minusDays(ChronoUnit.DAYS.between(LocalDate.now(),datePlus14Days))));
|
|
||||||
t.setDaysToExpire(Math.toIntExact(ChronoUnit.DAYS.between(LocalDate.now(), datePlus14Days)));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return transactionTrails;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<TransactionTrail> findPendingCrTransactions(String porOrgacode , String mbmBkmsnumber)
|
|
||||||
{
|
|
||||||
Optional<List<TransactionTrail>> optionalTransactions = transactionTrailRepository.findByPorOrgacodeAndCrMbmBkmsnumberAndBatAcnttranReceivedFalse(porOrgacode, mbmBkmsnumber);
|
|
||||||
return optionalTransactions.orElseGet(Collections::emptyList);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<TransactionTrail> fetchDepositAccountStatement(String porOrgacode, String mbmBkmsnumber) {
|
|
||||||
Optional<List<TransactionTrail>> optionalTransactions = transactionTrailRepository.fetchDepositAccountStatement(mbmBkmsnumber);
|
|
||||||
return optionalTransactions.orElseGet(Collections::emptyList);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> cashOutTransaction(CashOutTransactionRequest cashOutTransactionRequest) {
|
|
||||||
verifyOldPinAndGetCmpProfile(cashOutTransactionRequest.getPorOrgacode(),
|
|
||||||
cashOutTransactionRequest.getCmpTranpin(), cashOutTransactionRequest.getCmpCustcode(), true);
|
|
||||||
Map<String, Object> response = new HashMap<>();
|
|
||||||
Optional<TransactionTrail> transactionTrail = transactionTrailRepository.findById(Math.toIntExact(cashOutTransactionRequest.getId()));
|
|
||||||
if (transactionTrail.isPresent()) {
|
|
||||||
if(Objects.nonNull(cashOutTransactionRequest.getCmpRefcode())) {
|
|
||||||
if (!(transactionTrail.get().getSgtSentGntrnumber() + cashOutTransactionRequest.getCmpRefcode()).equals(transactionTrail.get().getCmpRefcode())) {
|
|
||||||
throw new ReferenceNumberNotValidException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
transactionTrail.get().setCrSgtGntramt(BigDecimal.valueOf(convertFromPKR(transactionTrail.get().getCrPcrCurrcode(),Double.valueOf(String.valueOf(transactionTrail.get().getDrSgtGntramt())),transactionTrail.get().getPorOrgacode())));;
|
|
||||||
CoreCashOutTransaction cashOutTransaction = CoreCashOutTransaction.builder()
|
|
||||||
.crPcrCurrcode(transactionTrail.get().getCrPcrCurrcode())
|
|
||||||
.crMbmBkmsnumber(transactionTrail.get().getCrMbmBkmsnumber())
|
|
||||||
.porOrgacode(cashOutTransactionRequest.getPorOrgacode())
|
|
||||||
.otdTrancomment(cashOutTransactionRequest.getId() + "_Received")
|
|
||||||
.sgtGntramtfc(transactionTrail.get().getDrSgtGntramt())
|
|
||||||
.accSgtGntramtfc(transactionTrail.get().getCrSgtGntramt())
|
|
||||||
.pcaGlaccode("A01011003")
|
|
||||||
.build();
|
|
||||||
|
|
||||||
response = (Map<String, Object>) webClientDepositService.postTransaction(cashOutTransaction, UCOURI.BANKING_CASH_OUT, transactionTrail.get().getPorOrgacode());
|
|
||||||
transactionTrail.get().setSgtReceiveGntrnumber((String.valueOf(response.get("tran_id"))));
|
|
||||||
transactionTrail.get().setSgtSentNodeId(String.valueOf(response.get("node_id")));
|
|
||||||
transactionTrail.get().setBatAcnttranReceived(true);
|
|
||||||
transactionTrail.get().setCrMbmBkmsbalance(MapValueExtractorUtil.getValueAsBigDecimal(response, "mbmBkmsbalance"));
|
|
||||||
transactionTrailRepository.save(transactionTrail.get());
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
private CustomerProfile verifyOldPinAndGetCmpProfile(String porOrgacode, String transPincode, String cmpCustcode, boolean isResendOtp) {
|
|
||||||
CustomerProfile customerProfile = transactionPinService.fetchCustomer(porOrgacode,
|
|
||||||
cmpCustcode);
|
|
||||||
if (isResendOtp) {
|
|
||||||
transactionPinService.validateOldPin(customerProfile, transPincode);
|
|
||||||
}
|
|
||||||
return customerProfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
private CustomerProfile fetchCustomerBasedOnCmpCustcode(String porOrgacode, String cmpCustcode) {
|
|
||||||
return customerProfileRepository.findById(new CustomerProfileId(porOrgacode, cmpCustcode))
|
|
||||||
.orElseThrow(() -> new IllegalArgumentException("Customer profile not found for ID: " + cmpCustcode));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private String extractTranNumber(List<Object> args) {
|
|
||||||
if (args != null && args.size() > 0) {
|
|
||||||
return String.valueOf(args.get(0)).replace("[", "").replace("]", "");
|
|
||||||
}
|
|
||||||
throw new RuntimeException("may day");
|
|
||||||
}
|
|
||||||
|
|
||||||
public EvaluatedCurrencyReponse getEvaluatedCurrency(String porOrgacode, String baseCurrencyCode, String targetCurrencyCode, double sgtGntramtfc) {
|
|
||||||
double pkrAmt = convertToPKR(baseCurrencyCode,sgtGntramtfc,porOrgacode);
|
|
||||||
double convertFromPkr = convertFromPKR(targetCurrencyCode,pkrAmt,porOrgacode);
|
|
||||||
List<ExchangeRateModel> exchangeRateModelList = fetchExchangeRate(porOrgacode);
|
|
||||||
|
|
||||||
Optional<Double> rate = exchangeRateModelList.stream()
|
|
||||||
.filter(x -> x.isPcrCurrbase() && x.getPcrCurrcode().equals(targetCurrencyCode))
|
|
||||||
.map(x -> {
|
|
||||||
BigDecimal bd = BigDecimal.valueOf(1 / x.getPerEratrateact());
|
|
||||||
bd = bd.setScale(2, RoundingMode.HALF_UP);
|
|
||||||
return bd.doubleValue();
|
|
||||||
})
|
|
||||||
.findFirst();
|
|
||||||
|
|
||||||
if (!rate.isPresent()) {
|
|
||||||
rate = exchangeRateModelList.stream()
|
|
||||||
.filter(x -> !x.isPcrCurrbase() && x.getPcrCurrcode().equals(targetCurrencyCode))
|
|
||||||
.map(x -> {
|
|
||||||
BigDecimal bd = BigDecimal.valueOf(x.getPerEratrateact());
|
|
||||||
bd = bd.setScale(2, RoundingMode.HALF_UP);
|
|
||||||
return bd.doubleValue();
|
|
||||||
})
|
|
||||||
.findFirst();
|
|
||||||
}
|
|
||||||
|
|
||||||
double targetPerEratrateact = rate.orElse(0.0);
|
|
||||||
|
|
||||||
return EvaluatedCurrencyReponse.builder()
|
|
||||||
.targetPerEratrateact(targetPerEratrateact)
|
|
||||||
.serviceCharges(0.0)
|
|
||||||
.pcrCurrcode(targetCurrencyCode)
|
|
||||||
|
|
||||||
.sgtGntramtfc(BigDecimal.valueOf(convertFromPkr).setScale(2, RoundingMode.HALF_UP))
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public double convertToPKR(String fromcrCurrcode, double amount, String porOrgacode) {
|
|
||||||
|
|
||||||
List<ExchangeRateModel> exchangeRateModelList = fetchExchangeRate(porOrgacode);
|
|
||||||
String baseCurrencyCode = exchangeRateModelList.stream()
|
|
||||||
.filter(ExchangeRateModel::isPcrCurrbase)
|
|
||||||
.findFirst()
|
|
||||||
.map(ExchangeRateModel::getPcrCurrcode)
|
|
||||||
.orElse(null);
|
|
||||||
if (fromcrCurrcode.equals(baseCurrencyCode)) {
|
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
return exchangeRateModelList.stream()
|
|
||||||
.filter(k -> k.getPcrCurrcode().equals(fromcrCurrcode))
|
|
||||||
.findFirst()
|
|
||||||
.map(k -> amount * k.getPerEratrateact())
|
|
||||||
.orElse(0.0);
|
|
||||||
}
|
|
||||||
public List<ExchangeRateModel> fetchExchangeRate(String porOrgacode) {
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
return objectMapper.convertValue(ucoAccountService.fetchExchangeRate(porOrgacode),
|
|
||||||
new TypeReference<List<ExchangeRateModel>>() {
|
|
||||||
});
|
|
||||||
}
|
|
||||||
public double convertFromPKR(String todrCurrcode, double amount,String porOrgacode) {
|
|
||||||
List<ExchangeRateModel> exchangeRateModelList = fetchExchangeRate(porOrgacode);
|
|
||||||
|
|
||||||
String baseCurrencyCode = exchangeRateModelList.stream()
|
|
||||||
.filter(ExchangeRateModel::isPcrCurrbase)
|
|
||||||
.findFirst()
|
|
||||||
.map(ExchangeRateModel::getPcrCurrcode)
|
|
||||||
.orElse(null);
|
|
||||||
if (todrCurrcode.equals(baseCurrencyCode)) {
|
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
return exchangeRateModelList.stream()
|
|
||||||
.filter(k -> k.getPcrCurrcode().equals(todrCurrcode))
|
|
||||||
.findFirst()
|
|
||||||
.map(k -> amount / k.getPerEratrateact())
|
|
||||||
.orElseThrow(() -> new RuntimeException("Product Not Found"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> glAccountTransaction(GLAccontTranasctionRequestModel glAccontTranasctionRequestModel) {
|
|
||||||
Map<String, Object> response = new HashMap<>();
|
|
||||||
if(glAccontTranasctionRequestModel.getSgtGntramtfc()<=0){
|
|
||||||
throw new InvalidTransactionAmountException();
|
|
||||||
}
|
|
||||||
notificationService.verifyOtpViaOtpId(glAccontTranasctionRequestModel.getNotificationId(),glAccontTranasctionRequestModel.getPinType(),glAccontTranasctionRequestModel.getObpPincode());
|
|
||||||
CoreCashOutTransaction cashOutTransaction = CoreCashOutTransaction.builder()
|
|
||||||
.pcaGlaccode(glAccontTranasctionRequestModel.getDrPcaGlaccode())
|
|
||||||
.crMbmBkmsnumber(glAccontTranasctionRequestModel.getCrMbmBkmsnumber())
|
|
||||||
.otdTrancomment(glAccontTranasctionRequestModel.getOtdTrancomment())
|
|
||||||
.porOrgacode(glAccontTranasctionRequestModel.getPorOrgacode())
|
|
||||||
.accSgtGntramtfc(BigDecimal.valueOf(glAccontTranasctionRequestModel.getSgtGntramtfc()))
|
|
||||||
.sgtGntramtfc(BigDecimal.valueOf(convertToPKR(glAccontTranasctionRequestModel.getCrPcrCurrcode(),glAccontTranasctionRequestModel.getSgtGntramtfc(),glAccontTranasctionRequestModel.getPorOrgacode())))
|
|
||||||
.crPcrCurrcode(glAccontTranasctionRequestModel.getCrPcrCurrcode())
|
|
||||||
.build();
|
|
||||||
|
|
||||||
response = (Map<String, Object>) webClientDepositService.postTransaction(cashOutTransaction, UCOURI.BANKING_CASH_OUT, glAccontTranasctionRequestModel.getPorOrgacode());
|
|
||||||
TransactionTrail transactionTrail = TransactionTrail.builder()
|
|
||||||
.porOrgacode(glAccontTranasctionRequestModel.getPorOrgacode())
|
|
||||||
.drMbmBkmsnumber(glAccontTranasctionRequestModel.getDrPcaGlaccode())
|
|
||||||
.crMbmBkmsnumber(glAccontTranasctionRequestModel.getCrMbmBkmsnumber())
|
|
||||||
.dmpProdcode(glAccontTranasctionRequestModel.getDmpProdCode())
|
|
||||||
.drmbmBkmstitle(glAccontTranasctionRequestModel.getDrPcaGlacdesc())
|
|
||||||
.drpcrCurrdesc(glAccontTranasctionRequestModel.getCrPcrCurrdesc())
|
|
||||||
.drPcrCurrshort(glAccontTranasctionRequestModel.getCrPcrCurrshort())
|
|
||||||
.cmpCustcode(glAccontTranasctionRequestModel.getCmpCustcode())
|
|
||||||
.drPcrCurrcode(glAccontTranasctionRequestModel.getCrPcrCurrcode())
|
|
||||||
.crMbmBkmstitle(glAccontTranasctionRequestModel.getCrMbmBkmstitle())
|
|
||||||
.drSgtGntramt(BigDecimal.valueOf(glAccontTranasctionRequestModel.getSgtGntramtfc()))
|
|
||||||
.crSgtGntramt(null)
|
|
||||||
.crPcrCurrdesc(glAccontTranasctionRequestModel.getCrPcrCurrdesc())
|
|
||||||
.crPcrCurrcode(glAccontTranasctionRequestModel.getCrPcrCurrcode())
|
|
||||||
.crPcrCurrshort(glAccontTranasctionRequestModel.getCrPcrCurrshort())
|
|
||||||
.sgtSentGntrnumber((String.valueOf(response.get("tran_id"))))
|
|
||||||
.sgtSentNodeId(String.valueOf(response.get("node_id")))
|
|
||||||
.drSgtGntrdate(LocalDate.now())
|
|
||||||
.sgtGntramt(BigDecimal.valueOf(glAccontTranasctionRequestModel.getSgtGntramtfc()))
|
|
||||||
.batAcnttranSend(true)
|
|
||||||
.batAcnttranReceived(true)
|
|
||||||
.sgtReceiveGntrnumber((String.valueOf(response.get("tran_id"))))
|
|
||||||
.sgtReceiveNodeId(String.valueOf(response.get("node_id")))
|
|
||||||
.build();
|
|
||||||
|
|
||||||
transactionTrailRepository.save(transactionTrail);
|
|
||||||
GLAccountMasterTransaction glAccountMasterTransaction = GLAccountMasterTransaction.builder()
|
|
||||||
.porOrgacode(glAccontTranasctionRequestModel.getPorOrgacode())
|
|
||||||
.cmpCustcode(glAccontTranasctionRequestModel.getCmpCustcode())
|
|
||||||
.crMbmBkmsnumber(glAccontTranasctionRequestModel.getCrMbmBkmsnumber())
|
|
||||||
.crMbmBkmstitle(glAccontTranasctionRequestModel.getCrMbmBkmstitle())
|
|
||||||
.crPcrCurrcode(glAccontTranasctionRequestModel.getCrPcrCurrcode())
|
|
||||||
.crPcrCurrdesc(glAccontTranasctionRequestModel.getCrPcrCurrdesc())
|
|
||||||
.crPcrCurrshort(glAccontTranasctionRequestModel.getCrPcrCurrshort())
|
|
||||||
.drPcaGlaccode(glAccontTranasctionRequestModel.getDrPcaGlaccode())
|
|
||||||
.drPcaGlacdesc(glAccontTranasctionRequestModel.getDrPcaGlacdesc())
|
|
||||||
.dmpProdcode(glAccontTranasctionRequestModel.getDmpProdCode())
|
|
||||||
.sgtGntramt(BigDecimal.valueOf(glAccontTranasctionRequestModel.getSgtGntramtfc()))
|
|
||||||
.drSgtGntramt(BigDecimal.valueOf(glAccontTranasctionRequestModel.getSgtGntramtfc()))
|
|
||||||
.drSgtGntrdate(LocalDate.now())
|
|
||||||
.sgtSentGntrnumber(String.valueOf(response.get("node_id"))+(response.get("tran_id")))
|
|
||||||
.build();
|
|
||||||
|
|
||||||
glAccountMasterTransactionTrailRepository.save(glAccountMasterTransaction);
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object reverseTransacion(String porOrgacode, String nodeId, String sgtGntrnumber) {
|
|
||||||
Object reponse = webClientDepositService.postTransaction(CoreReverseTransaction.builder().porOrgacode(porOrgacode).sgtGntrtranlink(sgtGntrnumber).nodeId(nodeId).sgtGntrcreateat("2003").build(), UCOURI.CORE_REVERSE_TRANSACTION, porOrgacode);
|
|
||||||
TransactionTrail trail = transactionTrailRepository.findByPorOrgacodeAndSgtSentNodeIdAndSgtSentGntrnumber(porOrgacode,nodeId,sgtGntrnumber);
|
|
||||||
Double balance = ucoAccountService.fetchAccountBalance(trail.getPorOrgacode(), trail.getDrMbmBkmsnumber());
|
|
||||||
trail.setBatAcnttranReversed(true);
|
|
||||||
trail.setBatAcnttranReceived(true);
|
|
||||||
trail.setDrMbmBkmsbalance(BigDecimal.valueOf(balance));
|
|
||||||
transactionTrailRepository.save(trail);
|
|
||||||
return reponse;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,233 +0,0 @@
|
|||||||
package com.mfsys.uco.service;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.mfsys.comm.constant.EurekaRegisteredMicroServicesURI;
|
|
||||||
import com.mfsys.comm.constant.SecurityURI;
|
|
||||||
import com.mfsys.uco.constants.UCOConstants;
|
|
||||||
import com.mfsys.uco.constants.UCOURI;
|
|
||||||
import com.mfsys.uco.dto.AccountInquiryResponse;
|
|
||||||
import com.mfsys.uco.dto.AddAccountRequestModel;
|
|
||||||
import com.mfsys.uco.dto.SignupStep3RequestModel;
|
|
||||||
import com.mfsys.uco.dto.webclientdto.AccountDetail;
|
|
||||||
import com.mfsys.uco.exception.AccountDoesntExistsException;
|
|
||||||
import com.mfsys.uco.exception.CustomerAccountOpeningNotAllowedException;
|
|
||||||
import com.mfsys.uco.exception.UserAlreadyRegisteredException;
|
|
||||||
import com.mfsys.uco.model.AccountId;
|
|
||||||
import com.mfsys.uco.model.CustomerProfile;
|
|
||||||
import com.mfsys.uco.model.UcoAccount;
|
|
||||||
import com.mfsys.uco.repository.CustomerProfileRepository;
|
|
||||||
import com.mfsys.uco.repository.UCOAccountRepository;
|
|
||||||
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.web.reactive.function.client.WebClient;
|
|
||||||
import reactor.core.publisher.Mono;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class UcoAccountService {
|
|
||||||
ObjectMapper objectMapper;
|
|
||||||
private final CustomerProfileRepository customerProfileRepository;
|
|
||||||
private final UCOAccountRepository ucoAccountRepository;
|
|
||||||
private final CustomerProfileService customerProfileService;
|
|
||||||
@LoadBalanced
|
|
||||||
private final WebClient webClient;
|
|
||||||
private final WebClientDepositService webClientDeposit;
|
|
||||||
private final WebClientCrmService webClientCrmService;
|
|
||||||
|
|
||||||
public UcoAccountService(WebClient.Builder webClientBuilder,CustomerProfileRepository customerProfileRepository, UCOAccountRepository ucoAccountRepository, CustomerProfileService customerProfileService, WebClientDepositService webClientDeposit, WebClientCrmService webClientCrmService
|
|
||||||
,ObjectMapper objectMapper) {
|
|
||||||
this.webClient = webClientBuilder.baseUrl(EurekaRegisteredMicroServicesURI.SECURITY_SERVICE_LB).build();
|
|
||||||
this.customerProfileRepository = customerProfileRepository;
|
|
||||||
this.ucoAccountRepository = ucoAccountRepository;
|
|
||||||
this.customerProfileService = customerProfileService;
|
|
||||||
this.webClientDeposit = webClientDeposit;
|
|
||||||
this.webClientCrmService = webClientCrmService;
|
|
||||||
this.objectMapper = objectMapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<AccountInquiryResponse> fetchAccountTitile(String porOrgacode, String acntTypeCode, String acntTypeValue) {
|
|
||||||
CustomerProfile customerProfile = new CustomerProfile();
|
|
||||||
|
|
||||||
if (acntTypeCode.equals(UCOConstants.CMP_PHONE)) {
|
|
||||||
customerProfile = customerProfileRepository.findProfilesByMobilePhone(porOrgacode, acntTypeValue);
|
|
||||||
} else if (acntTypeCode.equals(UCOConstants.CMP_EMAIL)) {
|
|
||||||
customerProfile = customerProfileRepository.findCustomerProfileByCmpEmailAndPorOrgacode(porOrgacode, acntTypeValue);
|
|
||||||
}
|
|
||||||
if (Objects.isNull(customerProfile)) {
|
|
||||||
throw new AccountDoesntExistsException();
|
|
||||||
}
|
|
||||||
List<UcoAccount> ucoAccountList= ucoAccountRepository.findUcoAccountByCmpCustcode(porOrgacode, customerProfile.getCmpCustcode());
|
|
||||||
List<AccountInquiryResponse> accountInquiryResponseList = new ArrayList<>();
|
|
||||||
ucoAccountList.stream().forEach(account ->{;
|
|
||||||
accountInquiryResponseList.add( AccountInquiryResponse.builder().mbmBkmsnumber(account.getId().getMbmBkmsnumber())
|
|
||||||
.mbmBkmstitle(account.getMbmBkmstitle())
|
|
||||||
.pcrCurrshort(account.getPcrCurrshort())
|
|
||||||
.pcrCurrcode(account.getPcrCurrcode())
|
|
||||||
.pcrCurrdesc(account.getPcrCurrdesc())
|
|
||||||
.build());
|
|
||||||
});
|
|
||||||
return accountInquiryResponseList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Double fetchAccountBalance(String porOrgacode, String mbmBkmsNumber) {
|
|
||||||
return (Double) getIndvAccountDetails(porOrgacode, mbmBkmsNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getIndvAccountDetails(String porOrgacode, String mbmBkmsnumber) {
|
|
||||||
String url = UCOURI.GET_UCOACC_BALANCE + "?porOrgacode=" + porOrgacode + "&mbmBkmsnumber=" + mbmBkmsnumber;
|
|
||||||
return webClientDeposit.getUcoAccountBalance(url, porOrgacode);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void onBoardCustomer(SignupStep3RequestModel signupStep3RequestModel) {
|
|
||||||
if (Objects.nonNull(customerProfileService.fetchCustcodeBasedOnEmail(signupStep3RequestModel.getPorOrgacode(), signupStep3RequestModel.getEmail()))) {
|
|
||||||
throw new UserAlreadyRegisteredException(null);
|
|
||||||
}
|
|
||||||
String porOrgacode = signupStep3RequestModel.getPorOrgacode();
|
|
||||||
|
|
||||||
Map cmpCustcodeReturn = (Map) webClientCrmService.onboardCustomer(Map.of("CMP_FULLNAME", signupStep3RequestModel.getName()
|
|
||||||
, "PIT_IDENCODE", signupStep3RequestModel.getIdentificationType(), "CIT_IDENVALUE", signupStep3RequestModel.getIdentificationNumber()
|
|
||||||
, "PAD_ADRSMOBPHONE", signupStep3RequestModel.getPhone(), "POR_ORGACODE", signupStep3RequestModel.getPorOrgacode(), "SUS_USERCODE", "01",
|
|
||||||
"PLC_LOCACODE", "2003","DMP_PRODCODE",signupStep3RequestModel.getDmpProdcode()), UCOURI.CUSTOMER_ONBOARDING, signupStep3RequestModel.getPorOrgacode());
|
|
||||||
String cmpCustcode = String.valueOf(cmpCustcodeReturn.get("cmpCustcode"));
|
|
||||||
System.out.println(cmpCustcode);
|
|
||||||
|
|
||||||
AccountDetail accountDetail = fetchdepositAccountFromCiihive(porOrgacode, cmpCustcode).get(0);
|
|
||||||
CustomerProfile customerProfile = CustomerProfile.builder().cmpCustcode(accountDetail.getCmpCustcode()).cmpEmail(signupStep3RequestModel.getEmail())
|
|
||||||
.cmpName(signupStep3RequestModel.getName()).cmpIsKycVerified(signupStep3RequestModel.isKycAdded())
|
|
||||||
.pitIdencode(signupStep3RequestModel.getIdentificationType()).pitIdenvalue(signupStep3RequestModel.getIdentificationNumber())
|
|
||||||
.cmpUserName(signupStep3RequestModel.getName())
|
|
||||||
.padAdrsmobphone(signupStep3RequestModel.getPhone())
|
|
||||||
.cmpUserName(signupStep3RequestModel.getUsername()).porOrgacode(signupStep3RequestModel.getPorOrgacode())
|
|
||||||
.build();
|
|
||||||
customerProfileRepository.save(customerProfile);
|
|
||||||
UcoAccount ucoAccount = UcoAccount.builder()
|
|
||||||
.id(new AccountId(accountDetail.getPorOrgacode(), accountDetail.getMbmBkmsnumber())) // Set the AccountId, assuming a method exists to create or retrieve it
|
|
||||||
.dmpProdcode(accountDetail.getDmpProdcode())
|
|
||||||
.mbmBkmstitle(accountDetail.getMbmBkmstitle())
|
|
||||||
.pcrCurrdesc(accountDetail.getPcrCurrdesc())
|
|
||||||
.cmpCustcode(accountDetail.getCmpCustcode())
|
|
||||||
.pcrCurrcode(accountDetail.getPcrCurrcode())
|
|
||||||
.pcrCurrshort(accountDetail.getPcrCurrshort())
|
|
||||||
.mbmBkmsclosed(accountDetail.isMbmBkmsclosed())
|
|
||||||
.mbmBkmsopendate(LocalDate.now())
|
|
||||||
.sgtLasttrandate(LocalDate.now())
|
|
||||||
.build();
|
|
||||||
ucoAccountRepository.save(ucoAccount);
|
|
||||||
|
|
||||||
updateCustomerApplication(Map.of("email",customerProfile.getCmpEmail(),"porOrgacode",porOrgacode));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateCustomerApplication(Map<String, String> payload) {
|
|
||||||
webClient.post()
|
|
||||||
.uri(SecurityURI.UPDATE_CUSTOMER_APPLICATION)
|
|
||||||
.bodyValue(payload)
|
|
||||||
.retrieve()
|
|
||||||
.onStatus(
|
|
||||||
status -> status.is4xxClientError() || status.is5xxServerError(),
|
|
||||||
clientResponse -> Mono.error(new RuntimeException("Response has error status."))
|
|
||||||
)
|
|
||||||
.bodyToMono(String.class)
|
|
||||||
.block();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<AccountDetail> fetchdepositAccountFromCiihive(String porOrgacode, String cmpCustcode) {
|
|
||||||
String url = UCOURI.GET_CMP_UCOACCOUNTS + "?porOrgacode=" + porOrgacode + "&cmpCustcode=" + cmpCustcode;
|
|
||||||
List<Object> map = (List<Object>) webClientDeposit.getCmpUcoAccounts(url, porOrgacode);
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
|
|
||||||
return objectMapper.convertValue(map, objectMapper.getTypeFactory().constructCollectionType(List.class, AccountDetail.class));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object fetchExchangeRate(String porOrgacode) {
|
|
||||||
String url = UCOURI.FETCH_EXCHANGE_RATE + "?porOrgacode=" + porOrgacode;
|
|
||||||
return webClientDeposit.fetchExchangeRate(url, porOrgacode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addUcoAccount(AddAccountRequestModel addAccountRequestModel){
|
|
||||||
String porOrgacode = addAccountRequestModel.getPorOrgacode();
|
|
||||||
|
|
||||||
CustomerProfile customerProfile = customerProfileRepository.findCustomerProfileByCmpEmailAndPorOrgacode(porOrgacode,addAccountRequestModel.getEmail());
|
|
||||||
if(Objects.nonNull(customerProfile)){
|
|
||||||
List<UcoAccount> ucoAccountList = ucoAccountRepository.findUcoAccountByCmpCustcode(customerProfile.getPorOrgacode(),customerProfile.getCmpCustcode());
|
|
||||||
ucoAccountList.stream().forEach(acc->{
|
|
||||||
if(acc.getDmpProdcode().equals(addAccountRequestModel.getDmpProdcode())){
|
|
||||||
throw new CustomerAccountOpeningNotAllowedException();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
String accountNumber = webClientDeposit.createUcoAccount(JsonToString(Map.of("payload",preparePayloadForAccount(customerProfile,addAccountRequestModel.getTitle()),
|
|
||||||
"uniqueConstraints",List.of(List.of(String.valueOf(addAccountRequestModel.getDmpProdcode()))))),UCOURI.UCO_CUSTOMER_ACCOUNT,porOrgacode);
|
|
||||||
saveCustomerAccountDetails(porOrgacode,customerProfile.getCmpCustcode(),accountNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void saveCustomerAccountDetails(String porOrgacode, String cmpCustcode,String accountNumber){
|
|
||||||
fetchdepositAccountFromCiihive(porOrgacode, cmpCustcode).stream().forEach(k -> {
|
|
||||||
if(k.getMbmBkmsnumber().equals(accountNumber)){
|
|
||||||
UcoAccount ucoAccount = UcoAccount.builder()
|
|
||||||
.id(new AccountId(k.getPorOrgacode(), k.getMbmBkmsnumber()))
|
|
||||||
.dmpProdcode(k.getDmpProdcode())
|
|
||||||
.mbmBkmstitle(k.getMbmBkmstitle())
|
|
||||||
.pcrCurrdesc(k.getPcrCurrdesc())
|
|
||||||
.cmpCustcode(k.getCmpCustcode())
|
|
||||||
.pcrCurrcode(k.getPcrCurrcode())
|
|
||||||
.pcrCurrshort(k.getPcrCurrshort())
|
|
||||||
.mbmBkmsclosed(k.isMbmBkmsclosed())
|
|
||||||
.mbmBkmsopendate(LocalDate.now())
|
|
||||||
.sgtLasttrandate(LocalDate.now())
|
|
||||||
.build();
|
|
||||||
ucoAccountRepository.save(ucoAccount);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
public String preparePayloadForAccount(CustomerProfile customerProfile,String title){
|
|
||||||
Map<String,Object> jsonMap = new HashMap<>();
|
|
||||||
jsonMap.put("SUS_USERCODE", "01");
|
|
||||||
jsonMap.put("CMP_CUSTCODE",customerProfile.getCmpCustcode());
|
|
||||||
jsonMap.put("CMP_FULLNAME", title);
|
|
||||||
jsonMap.put("PLC_LOCACODE", "2003");
|
|
||||||
jsonMap.put("workFlowStage", "BN_WF_CP_AUTHORIZATION");
|
|
||||||
jsonMap.put("PCT_CSTYCODE", "I");
|
|
||||||
jsonMap.put("POR_ORGACODE", customerProfile.getPorOrgacode());
|
|
||||||
List<Map<String, Object>> workFlowLog = new ArrayList<>();
|
|
||||||
Map<String, Object> logEntry = new HashMap<>();
|
|
||||||
logEntry.put("susUsercode", "01");
|
|
||||||
logEntry.put("formId", "BN_WF_CP_AUTHORIZATION");
|
|
||||||
workFlowLog.add(logEntry);
|
|
||||||
jsonMap.put("workFlowLog", workFlowLog);
|
|
||||||
|
|
||||||
List<Map<String, Object>> bnCsItIdentifier = new ArrayList<>();
|
|
||||||
Map<String, Object> identifierEntry = new HashMap<>();
|
|
||||||
identifierEntry.put("CIT_IDENVALUE", customerProfile.getPitIdenvalue());
|
|
||||||
identifierEntry.put("PIT_PRIMARYIDENCODE", true);
|
|
||||||
identifierEntry.put("PIT_IDENCODE", customerProfile.getPitIdencode());
|
|
||||||
bnCsItIdentifier.add(identifierEntry);
|
|
||||||
jsonMap.put("BN_CS_IT_IDENTIFIER", bnCsItIdentifier);
|
|
||||||
jsonMap.put("@_CREATEUSER", "01");
|
|
||||||
|
|
||||||
List<Map<String, Object>> bnCsAdAddress = new ArrayList<>();
|
|
||||||
Map<String, Object> addressEntry = new HashMap<>();
|
|
||||||
addressEntry.put("PAD_ADRSCORRESPONDENCE", true);
|
|
||||||
addressEntry.put("PAD_ADRSMOBPHONE", customerProfile.getPadAdrsmobphone());
|
|
||||||
bnCsAdAddress.add(addressEntry);
|
|
||||||
jsonMap.put("BN_CS_AD_ADDRESS", customerProfile.getCmpAddress());
|
|
||||||
Map<String, Object> createdDateMap = new HashMap<>();
|
|
||||||
createdDateMap.put("$date", new Date());
|
|
||||||
jsonMap.put("@_CREATEDATE", createdDateMap);
|
|
||||||
return JsonToString(jsonMap);
|
|
||||||
}
|
|
||||||
public String JsonToString(Object jsonMap){
|
|
||||||
try {
|
|
||||||
return this.objectMapper.writeValueAsString(jsonMap);
|
|
||||||
} catch (JsonProcessingException var3) {
|
|
||||||
throw new RuntimeException(var3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,73 +0,0 @@
|
|||||||
package com.mfsys.uco.service;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ApplicationExceptionMapper;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.web.reactive.function.client.WebClient;
|
|
||||||
import org.springframework.web.reactive.function.client.WebClientResponseException;
|
|
||||||
import reactor.core.publisher.Mono;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class WebClientCrmService {
|
|
||||||
private final WebClient webClientCrm;
|
|
||||||
|
|
||||||
|
|
||||||
public WebClientCrmService(WebClient webClientCrm) {
|
|
||||||
this.webClientCrm = webClientCrm;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getUcoAccountBalance(String url, String porOrgacode) {
|
|
||||||
return handleResponse(webClientCrm.get().uri(url).accept(MediaType.APPLICATION_JSON)
|
|
||||||
.header("SUS_USERCODE", porOrgacode)
|
|
||||||
.header("POR_ORGACODE", porOrgacode).retrieve().toEntity(Object.class),
|
|
||||||
null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object onboardCustomer(Map onBoardingData, String url, String porOrgaCode) {
|
|
||||||
return handleResponse(webClientCrm.post().uri(url).bodyValue(onBoardingData).accept(MediaType.APPLICATION_JSON)
|
|
||||||
.header("SUS_USERCODE", porOrgaCode)
|
|
||||||
.header("POR_ORGACODE", porOrgaCode).retrieve()
|
|
||||||
.toEntity(Object.class),
|
|
||||||
porOrgaCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
private <T> T handleResponse(Mono<ResponseEntity<T>> responseMono, String porgaCode) {
|
|
||||||
try {
|
|
||||||
ResponseEntity<T> response = responseMono.block();
|
|
||||||
return response.getBody();
|
|
||||||
} catch (WebClientResponseException e) {
|
|
||||||
ApplicationExceptionMapper.APIError errorDetails = parseErrorDetails(e);
|
|
||||||
throw new ApplicationException(porgaCode, errorDetails.getErrorCode(), errorDetails.getArguments());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private ApplicationExceptionMapper.APIError parseErrorDetails(WebClientResponseException e) {
|
|
||||||
String errorCode = null;
|
|
||||||
List<String> arguments = null;
|
|
||||||
if (e.getResponseBodyAsString() != null) {
|
|
||||||
try {
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
JsonNode errorNode = objectMapper.readTree(e.getResponseBodyAsString());
|
|
||||||
errorCode = errorNode.get("errorCode").asText();
|
|
||||||
arguments = Arrays.asList(objectMapper.convertValue(errorNode.get("arguments"), String[].class));
|
|
||||||
} catch (IOException ex) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ApplicationExceptionMapper.APIError(errorCode, arguments.toArray());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
package com.mfsys.uco.service;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.mfsys.comm.exception.ApplicationException;
|
|
||||||
import com.mfsys.comm.exception.ApplicationExceptionMapper;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.web.reactive.function.client.WebClient;
|
|
||||||
import org.springframework.web.reactive.function.client.WebClientResponseException;
|
|
||||||
import reactor.core.publisher.Mono;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class WebClientDepositService {
|
|
||||||
private final WebClient webClientDeposit;
|
|
||||||
|
|
||||||
|
|
||||||
public WebClientDepositService(WebClient webClientDeposit) {
|
|
||||||
this.webClientDeposit = webClientDeposit;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getUcoAccountBalance(String url, String porOrgacode) {
|
|
||||||
return handleResponse(webClientDeposit.get().uri(url).accept(MediaType.APPLICATION_JSON)
|
|
||||||
.header("SUS_USERCODE", porOrgacode)
|
|
||||||
.header("POR_ORGACODE", porOrgacode).retrieve().toEntity(Object.class),
|
|
||||||
null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getCmpUcoAccounts(String url, String porOrgacode) {
|
|
||||||
return handleResponse(webClientDeposit.get().uri(url).accept(MediaType.APPLICATION_JSON)
|
|
||||||
.header("SUS_USERCODE", porOrgacode)
|
|
||||||
.header("POR_ORGACODE", porOrgacode).retrieve().toEntity(Object.class),
|
|
||||||
null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object postTransaction(Object tranData, String url, String porOrgaCode) {
|
|
||||||
return handleResponse(webClientDeposit.post().uri(url).bodyValue(tranData).accept(MediaType.APPLICATION_JSON)
|
|
||||||
.header("SUS_USERCODE", porOrgaCode)
|
|
||||||
.header("POR_ORGACODE", porOrgaCode).retrieve()
|
|
||||||
.toEntity(Object.class),
|
|
||||||
porOrgaCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String createUcoAccount(Object payload, String url, String porOrgaCode) {
|
|
||||||
return handleResponse(webClientDeposit.post().uri(url).bodyValue(payload).accept(MediaType.APPLICATION_JSON)
|
|
||||||
.header("SUS_USERCODE", porOrgaCode)
|
|
||||||
.header("POR_ORGACODE", porOrgaCode).retrieve()
|
|
||||||
.toEntity(String.class),
|
|
||||||
porOrgaCode);
|
|
||||||
}
|
|
||||||
public Object fetchExchangeRate(String url, String porOrgacode) {
|
|
||||||
return handleResponse(webClientDeposit.get().uri(url).accept(MediaType.APPLICATION_JSON)
|
|
||||||
.header("SUS_USERCODE", porOrgacode)
|
|
||||||
.header("POR_ORGACODE", porOrgacode).retrieve().toEntity(Object.class),
|
|
||||||
null);
|
|
||||||
}
|
|
||||||
public Object fetchUcoDepositProducts(String url, String porOrgacode) {
|
|
||||||
return handleResponse(webClientDeposit.get().uri(url).accept(MediaType.APPLICATION_JSON)
|
|
||||||
.header("SUS_USERCODE", porOrgacode)
|
|
||||||
.header("POR_ORGACODE", porOrgacode).retrieve().toEntity(Object.class),
|
|
||||||
null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private <T> T handleResponse(Mono<ResponseEntity<T>> responseMono, String porgaCode) {
|
|
||||||
try {
|
|
||||||
ResponseEntity<T> response = responseMono.block();
|
|
||||||
return response.getBody();
|
|
||||||
} catch (WebClientResponseException e) {
|
|
||||||
ApplicationExceptionMapper.APIError errorDetails = parseErrorDetails(e);
|
|
||||||
throw new ApplicationException(porgaCode, errorDetails.getErrorCode(), errorDetails.getArguments());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private ApplicationExceptionMapper.APIError parseErrorDetails(WebClientResponseException e) {
|
|
||||||
String errorCode = null;
|
|
||||||
List<String> arguments = null;
|
|
||||||
if (e.getResponseBodyAsString() != null) {
|
|
||||||
try {
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
JsonNode errorNode = objectMapper.readTree(e.getResponseBodyAsString());
|
|
||||||
errorCode = errorNode.get("errorCode").asText();
|
|
||||||
arguments = Arrays.asList(objectMapper.convertValue(errorNode.get("arguments"), String[].class));
|
|
||||||
} catch (IOException ex) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ApplicationExceptionMapper.APIError(errorCode, arguments.toArray());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
#base.ciihive=localhost
|
|
||||||
base.ciihive=${CIIHIVE_URL}
|
|
||||||
Loading…
Reference in New Issue