|
|
|
@ -3,7 +3,9 @@ package com.mfsys.aconnect.client.service;
|
|
|
|
import com.mfsys.aconnect.client.dto.DepositCancellationDTO;
|
|
|
|
import com.mfsys.aconnect.client.dto.DepositCancellationDTO;
|
|
|
|
import com.mfsys.aconnect.client.dto.GLCancellationDTO;
|
|
|
|
import com.mfsys.aconnect.client.dto.GLCancellationDTO;
|
|
|
|
import com.mfsys.aconnect.client.exception.PreviousDayCancellationException;
|
|
|
|
import com.mfsys.aconnect.client.exception.PreviousDayCancellationException;
|
|
|
|
|
|
|
|
import com.mfsys.aconnect.client.exception.TransactionNotAllowedException;
|
|
|
|
import com.mfsys.aconnect.client.exception.TransactionNotFoundException;
|
|
|
|
import com.mfsys.aconnect.client.exception.TransactionNotFoundException;
|
|
|
|
|
|
|
|
import com.mfsys.aconnect.client.model.TransactionEndpoint;
|
|
|
|
import com.mfsys.aconnect.client.model.TransactionLog;
|
|
|
|
import com.mfsys.aconnect.client.model.TransactionLog;
|
|
|
|
import com.mfsys.aconnect.client.repository.TransactionLogRepository;
|
|
|
|
import com.mfsys.aconnect.client.repository.TransactionLogRepository;
|
|
|
|
import com.mfsys.aconnect.configuration.config.WebClientConfig;
|
|
|
|
import com.mfsys.aconnect.configuration.config.WebClientConfig;
|
|
|
|
@ -27,12 +29,18 @@ public class CancellationTransactionService {
|
|
|
|
|
|
|
|
|
|
|
|
private final WebClientConfig webClientConfig;
|
|
|
|
private final WebClientConfig webClientConfig;
|
|
|
|
private final TransactionLogRepository transactionLogRepository;
|
|
|
|
private final TransactionLogRepository transactionLogRepository;
|
|
|
|
public CancellationTransactionService(WebClientConfig webClientConfig, TransactionLogRepository transactionLogRepository) {
|
|
|
|
private final TransactionPermissionService permissionService;
|
|
|
|
|
|
|
|
public CancellationTransactionService(WebClientConfig webClientConfig, TransactionLogRepository transactionLogRepository,
|
|
|
|
|
|
|
|
TransactionPermissionService permissionService) {
|
|
|
|
this.webClientConfig = webClientConfig;
|
|
|
|
this.webClientConfig = webClientConfig;
|
|
|
|
this.transactionLogRepository = transactionLogRepository;
|
|
|
|
this.transactionLogRepository = transactionLogRepository;
|
|
|
|
|
|
|
|
this.permissionService = permissionService;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ResponseEntity<Object> processDepositCancellationTransaction(DepositCancellationDTO depositCancellationDTO, String tokenHeader) {
|
|
|
|
public ResponseEntity<Object> processDepositCancellationTransaction(DepositCancellationDTO depositCancellationDTO, String tokenHeader) {
|
|
|
|
|
|
|
|
if (!permissionService.isAllowed(depositCancellationDTO.getSusUsercode(), TransactionEndpoint.DEPOSIT_CANCELLATION.getCode())) {
|
|
|
|
|
|
|
|
throw new TransactionNotAllowedException(depositCancellationDTO.getPorOrgacode());
|
|
|
|
|
|
|
|
}
|
|
|
|
String porOrgacode = depositCancellationDTO.getPorOrgacode();
|
|
|
|
String porOrgacode = depositCancellationDTO.getPorOrgacode();
|
|
|
|
|
|
|
|
|
|
|
|
// TransactionLog log = transactionLogRepository
|
|
|
|
// TransactionLog log = transactionLogRepository
|
|
|
|
@ -62,6 +70,9 @@ public class CancellationTransactionService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ResponseEntity<Object> processGLCancellationTransaction(GLCancellationDTO glCancellationDTO, String tokenHeader) {
|
|
|
|
public ResponseEntity<Object> processGLCancellationTransaction(GLCancellationDTO glCancellationDTO, String tokenHeader) {
|
|
|
|
|
|
|
|
if (!permissionService.isAllowed(glCancellationDTO.getSusUsercode(), TransactionEndpoint.GL_CANCELLATION.getCode())) {
|
|
|
|
|
|
|
|
throw new TransactionNotAllowedException(glCancellationDTO.getPorOrgacode());
|
|
|
|
|
|
|
|
}
|
|
|
|
String porOrgacode = glCancellationDTO.getPorOrgacode();
|
|
|
|
String porOrgacode = glCancellationDTO.getPorOrgacode();
|
|
|
|
|
|
|
|
|
|
|
|
// TransactionLog log = transactionLogRepository
|
|
|
|
// TransactionLog log = transactionLogRepository
|
|
|
|
|