Add transaction URI to logs and update deposit approval endpoints

Introduced a transactionUri field to TransactionLog and updated TransactionLogService methods to accept and store the URI. Refactored deposit approval endpoints in DepositAccountController to use new URIs and updated AconnectURI and TokenBypassURI constants accordingly for individual and business deposit approvals.
Wasi/BS-2239
Naeem Ullah 2 weeks ago
parent 8c762ae636
commit 53349ffadc

@ -25,15 +25,23 @@ public class DepositAccountController {
return depositAccountService.createIndividualDeposit(workflowRequestDTO, token); return depositAccountService.createIndividualDeposit(workflowRequestDTO, token);
} }
@PatchMapping(AconnectURI.UPDATE_DEPOSIT_CREATION_URI) @PostMapping(AconnectURI.BUSINESS_DEPOSIT_CREATION_URI)
public Object updateIndividualDeposit(@RequestBody WorkflowApprovalDTO workflowRequestDTO, public Object createBusinessCRM(@RequestBody WorkflowRequestDTO workflowRequestDTO,
@RequestHeader("Authorization") String token) {
return depositAccountService.createBusinessDeposit(workflowRequestDTO, token);
}
@PostMapping(AconnectURI.APPROVE_INDIVIDUAL_DEPOSIT_CREATION_URI)
public Object approveIndividualDeposit(@RequestBody WorkflowApprovalDTO workflowRequestDTO,
@RequestHeader("Authorization") String token) { @RequestHeader("Authorization") String token) {
return depositAccountService.approvalIndividualDeposit(workflowRequestDTO, token); return depositAccountService.approvalIndividualDeposit(workflowRequestDTO, token);
} }
@PostMapping(AconnectURI.BUSINESS_DEPOSIT_CREATION_URI)
public Object createBusinessCRM(@RequestBody WorkflowRequestDTO workflowRequestDTO, @PostMapping(AconnectURI.APPROVE_BUSINESS_DEPOSIT_CREATION_URI)
public Object approveBusinessDeposit(@RequestBody WorkflowApprovalDTO workflowRequestDTO,
@RequestHeader("Authorization") String token) { @RequestHeader("Authorization") String token) {
return depositAccountService.createBusinessDeposit(workflowRequestDTO, token); return depositAccountService.approvalIndividualDeposit(workflowRequestDTO, token);
} }
} }

@ -30,6 +30,9 @@ public class TransactionLog {
@Column(name = "CR_PCAGLACCODE", nullable = true, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER) @Column(name = "CR_PCAGLACCODE", nullable = true, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
private String crPcaglacode; private String crPcaglacode;
@Column(name = "TRANSACTION_URI", nullable = true, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
private String transactionUri;
@Column(name = "DR_PCAGLACCODE", nullable = true, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER) @Column(name = "DR_PCAGLACCODE", nullable = true, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
private String drPcaGlacode; private String drPcaGlacode;

@ -26,7 +26,7 @@ public class TransactionLogService {
return transactionLogRepository.findAll(); return transactionLogRepository.findAll();
} }
public TransactionLog createTransactionLog(AccountGLTransactionRequest accountGLTransactionRequest) { public TransactionLog createTransactionLog(AccountGLTransactionRequest accountGLTransactionRequest, String URI) {
TransactionLog transactionLog = new TransactionLog(); TransactionLog transactionLog = new TransactionLog();
transactionLog.setPorOrgacode(accountGLTransactionRequest.getPorOrgacode()); transactionLog.setPorOrgacode(accountGLTransactionRequest.getPorOrgacode());
transactionLog.setChannelCode(accountGLTransactionRequest.getSgtGntrcreateusr()); transactionLog.setChannelCode(accountGLTransactionRequest.getSgtGntrcreateusr());
@ -40,6 +40,7 @@ public class TransactionLogService {
transactionLog.setCreatedAt(LocalDateTime.now()); transactionLog.setCreatedAt(LocalDateTime.now());
transactionLog.setUpdatedAt(LocalDateTime.now()); transactionLog.setUpdatedAt(LocalDateTime.now());
transactionLog.setSgtGntrdate(LocalDate.parse(accountGLTransactionRequest.getSgtGntrvaluedate())); transactionLog.setSgtGntrdate(LocalDate.parse(accountGLTransactionRequest.getSgtGntrvaluedate()));
transactionLog.setTransactionUri(URI);
return transactionLogRepository.save(transactionLog); return transactionLogRepository.save(transactionLog);
} }
@ -57,7 +58,7 @@ public class TransactionLogService {
} }
public TransactionLog createGLtoGLTransactionLog(GLtoGLRequest gLtoGLRequest) { public TransactionLog createGLtoGLTransactionLog(GLtoGLRequest gLtoGLRequest, String URI) {
TransactionLog transactionLog = new TransactionLog(); TransactionLog transactionLog = new TransactionLog();
transactionLog.setPorOrgacode(gLtoGLRequest.getPorOrgacode()); transactionLog.setPorOrgacode(gLtoGLRequest.getPorOrgacode());
transactionLog.setChannelCode(gLtoGLRequest.getSgtGntrcreateusr()); transactionLog.setChannelCode(gLtoGLRequest.getSgtGntrcreateusr());
@ -71,10 +72,11 @@ public class TransactionLogService {
transactionLog.setCreatedAt(LocalDateTime.now()); transactionLog.setCreatedAt(LocalDateTime.now());
transactionLog.setUpdatedAt(LocalDateTime.now()); transactionLog.setUpdatedAt(LocalDateTime.now());
transactionLog.setSgtGntrdate(LocalDate.parse(gLtoGLRequest.getSgtGntrvaluedate())); transactionLog.setSgtGntrdate(LocalDate.parse(gLtoGLRequest.getSgtGntrvaluedate()));
transactionLog.setTransactionUri(URI);
return transactionLogRepository.save(transactionLog); return transactionLogRepository.save(transactionLog);
} }
public TransactionLog createAccToAccTransactionLog(AccountToAccountDTO accountToAccountDTO) { public TransactionLog createAccToAccTransactionLog(AccountToAccountDTO accountToAccountDTO, String URI) {
TransactionLog transactionLog = new TransactionLog(); TransactionLog transactionLog = new TransactionLog();
transactionLog.setPorOrgacode(accountToAccountDTO.getPorOrgacode()); transactionLog.setPorOrgacode(accountToAccountDTO.getPorOrgacode());
transactionLog.setChannelCode(accountToAccountDTO.getSgtGntrcreateusr()); transactionLog.setChannelCode(accountToAccountDTO.getSgtGntrcreateusr());
@ -88,10 +90,11 @@ public class TransactionLogService {
transactionLog.setCreatedAt(LocalDateTime.now()); transactionLog.setCreatedAt(LocalDateTime.now());
transactionLog.setUpdatedAt(LocalDateTime.now()); transactionLog.setUpdatedAt(LocalDateTime.now());
transactionLog.setSgtGntrdate(accountToAccountDTO.getSgtGntrvaluedate()); transactionLog.setSgtGntrdate(accountToAccountDTO.getSgtGntrvaluedate());
transactionLog.setTransactionUri(URI);
return transactionLogRepository.save(transactionLog); return transactionLogRepository.save(transactionLog);
} }
public TransactionLog createGLToAccTransactionLog(GlToAccountDTO glToAccountDTO) { public TransactionLog createGLToAccTransactionLog(GlToAccountDTO glToAccountDTO, String URI) {
TransactionLog transactionLog = new TransactionLog(); TransactionLog transactionLog = new TransactionLog();
transactionLog.setPorOrgacode(glToAccountDTO.getPorOrgacode()); transactionLog.setPorOrgacode(glToAccountDTO.getPorOrgacode());
transactionLog.setChannelCode(glToAccountDTO.getSgtGntrcreateusr()); transactionLog.setChannelCode(glToAccountDTO.getSgtGntrcreateusr());
@ -105,6 +108,7 @@ public class TransactionLogService {
transactionLog.setCreatedAt(LocalDateTime.now()); transactionLog.setCreatedAt(LocalDateTime.now());
transactionLog.setUpdatedAt(LocalDateTime.now()); transactionLog.setUpdatedAt(LocalDateTime.now());
transactionLog.setSgtGntrdate(glToAccountDTO.getSgtGntrvaluedate()); transactionLog.setSgtGntrdate(glToAccountDTO.getSgtGntrvaluedate());
transactionLog.setTransactionUri(URI);
return transactionLogRepository.save(transactionLog); return transactionLogRepository.save(transactionLog);
} }
} }

@ -88,7 +88,7 @@ public class TransactionService {
headers.setAccept(java.util.List.of(MediaType.APPLICATION_JSON)); headers.setAccept(java.util.List.of(MediaType.APPLICATION_JSON));
HttpEntity<AccountGLTransactionRequest> entity = new HttpEntity<>(accountGLTransactionRequest, headers); HttpEntity<AccountGLTransactionRequest> entity = new HttpEntity<>(accountGLTransactionRequest, headers);
TransactionLog log = transactionLogService.createTransactionLog(accountGLTransactionRequest); TransactionLog log = transactionLogService.createTransactionLog(accountGLTransactionRequest, url);
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
ResponseEntity<Map> response = restTemplate.exchange( ResponseEntity<Map> response = restTemplate.exchange(
url, url,
@ -154,7 +154,7 @@ public class TransactionService {
HttpEntity<GLtoGLRequest> entity = new HttpEntity<>(gLtoGLRequest, headers); HttpEntity<GLtoGLRequest> entity = new HttpEntity<>(gLtoGLRequest, headers);
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
TransactionLog log = transactionLogService.createGLtoGLTransactionLog(gLtoGLRequest); TransactionLog log = transactionLogService.createGLtoGLTransactionLog(gLtoGLRequest, url);
ResponseEntity<Map> response = restTemplate.exchange( ResponseEntity<Map> response = restTemplate.exchange(
url, url,
HttpMethod.POST, HttpMethod.POST,
@ -217,7 +217,7 @@ public class TransactionService {
HttpEntity<AccountToAccountDTO> entity = new HttpEntity<>(accountToAccountDTO, headers); HttpEntity<AccountToAccountDTO> entity = new HttpEntity<>(accountToAccountDTO, headers);
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
TransactionLog log = transactionLogService.createAccToAccTransactionLog(accountToAccountDTO); TransactionLog log = transactionLogService.createAccToAccTransactionLog(accountToAccountDTO, url);
ResponseEntity<Map> response = restTemplate.exchange( ResponseEntity<Map> response = restTemplate.exchange(
url, url,
HttpMethod.POST, HttpMethod.POST,
@ -261,7 +261,7 @@ public class TransactionService {
HttpEntity<GlToAccountDTO> entity = new HttpEntity<>(glToAccountDTO, headers); HttpEntity<GlToAccountDTO> entity = new HttpEntity<>(glToAccountDTO, headers);
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
TransactionLog log = transactionLogService.createGLToAccTransactionLog(glToAccountDTO); TransactionLog log = transactionLogService.createGLToAccTransactionLog(glToAccountDTO, url);
ResponseEntity<Map> response = restTemplate.exchange( ResponseEntity<Map> response = restTemplate.exchange(
url, url,

@ -40,7 +40,8 @@ public interface AconnectURI {
String CHECK_BUSINESS_APPLICATIONS_URI = CRM + BUSINESS + "/inprocess"; String CHECK_BUSINESS_APPLICATIONS_URI = CRM + BUSINESS + "/inprocess";
String BUSINESS_CRM_CREATION_URI = CRM + BUSINESS + "/create"; String BUSINESS_CRM_CREATION_URI = CRM + BUSINESS + "/create";
String INDIVIDUAL_DEPOSIT_CREATION_URI = DEPOSIT + INDIVIDUAL + "/create"; String INDIVIDUAL_DEPOSIT_CREATION_URI = DEPOSIT + INDIVIDUAL + "/create";
String UPDATE_DEPOSIT_CREATION_URI = DEPOSIT + INDIVIDUAL + "/approval"; String APPROVE_INDIVIDUAL_DEPOSIT_CREATION_URI = DEPOSIT + INDIVIDUAL + "/approval";
String APPROVE_BUSINESS_DEPOSIT_CREATION_URI = DEPOSIT + BUSINESS + "/approval";
String BUSINESS_DEPOSIT_CREATION_URI = DEPOSIT + BUSINESS + "/create"; String BUSINESS_DEPOSIT_CREATION_URI = DEPOSIT + BUSINESS + "/create";

@ -31,6 +31,7 @@ public interface TokenBypassURI {
"/aconnect/crm/business/create", "/aconnect/crm/business/create",
"/aconnect/deposit/individual/create", "/aconnect/deposit/individual/create",
"/aconnect/deposit/individual/approval", "/aconnect/deposit/individual/approval",
"/aconnect/deposit/business/approval",
"/aconnect/deposit/business/create", "/aconnect/deposit/business/create",
"/aconnect/loan/individual/create", "/aconnect/loan/individual/create",
"/aconnect/loan/individual/approval", "/aconnect/loan/individual/approval",

Loading…
Cancel
Save