Nabeel-DG-BS
Raja Nabeel 1 year ago
parent c6d8761ed8
commit cecc4d7fec

@ -4,6 +4,7 @@ public interface UCOURI {
String VIEW_BALANCE = "/user/viewBalance";
String ONBOARD_CUSTOMER = "/auth/user/authenticate/onboardCutomer";
String ADD_UCO_CUSTOMER_ACCOUNT = "/createUcoAccount";
String UPDATE_CUSTOMER_PROFILE = "/updateCustomerProfile";
String FETCH_DEPOSITACCOUNTS = "/depositAccounts";
String FETCH_ACCOUNT_STATEMENT = "/accountStatement";
String FETCH_ACCOUNT_INQUIRY = "/accountInquiry";

@ -19,7 +19,7 @@ public class TransactionController {
@PostMapping(UCOURI.GET_DR_TRANSACTION_PIN)
public TransactionPinResponseModel getDrTransactionOtp(@RequestBody TransactionOtpRequestModel transactionOtpRequestModel) {
return transactionService.sendOtpAndValidateTranPin(transactionOtpRequestModel,false);
return transactionService.sendOtpAndValidateTranPin(transactionOtpRequestModel,true);
}
@PostMapping(UCOURI.RESEND_GET_DR_TRANSACTION_PIN)

@ -178,4 +178,10 @@ public class UserController {
ucoAccountService.addUcoAccount(addAccountRequestModel);
return ResponseEntity.ok(HttpStatus.OK);
}
@PostMapping(UCOURI.UPDATE_CUSTOMER_PROFILE)
public ResponseEntity<HttpStatus> updateCustomerProfile(@RequestBody UpdateProfileRequestPayload updateProfileRequestPayload) {
customerProfileService.updateCustomerProfile(updateProfileRequestPayload);
return ResponseEntity.ok(HttpStatus.OK);
}
}

@ -0,0 +1,16 @@
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;
}

@ -21,6 +21,7 @@ public class AccountDetail {
protected String plcLocadesc;
protected String pcrCurrcode;
protected String pcrCurrshort;
protected String mbmBkmsopendate;
protected String pcrCurrdesc;
protected String cmpCustcode;
protected boolean mbmBkmsclosed;
@ -47,6 +48,5 @@ public class AccountDetail {
private String pcaGlaccode;
private String accJointStatus;
private String accAttortype;
private LocalDate mbmBkmsopendate;
}

@ -54,4 +54,8 @@ public class CustomerProfile {
@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,10 +1,14 @@
package com.mfsys.uco.service;
import com.mfsys.uco.dto.UpdateProfileRequestPayload;
import com.mfsys.uco.model.CustomerProfile;
import com.mfsys.uco.model.CustomerProfileId;
import com.mfsys.uco.repository.CustomerProfileRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Optional;
@Service
@RequiredArgsConstructor
public class CustomerProfileService {
@ -13,4 +17,12 @@ public class CustomerProfileService {
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);
});
}
}

@ -287,10 +287,10 @@ public class TransactionService {
.crMbmBkmsnumber(glAccontTranasctionRequestModel.getCrMbmBkmsnumber())
.dmpProdcode(glAccontTranasctionRequestModel.getDmpProdCode())
.drmbmBkmstitle(glAccontTranasctionRequestModel.getDrPcaGlacdesc())
.drpcrCurrdesc("GL Currency")
.drPcrCurrshort("GL Curr")
.drpcrCurrdesc(glAccontTranasctionRequestModel.getCrPcrCurrdesc())
.drPcrCurrshort(glAccontTranasctionRequestModel.getCrPcrCurrshort())
.cmpCustcode(glAccontTranasctionRequestModel.getCmpCustcode())
.drPcrCurrcode("GL Curr")
.drPcrCurrcode(glAccontTranasctionRequestModel.getCrPcrCurrcode())
.crMbmBkmstitle(glAccontTranasctionRequestModel.getCrMbmBkmstitle())
.drSgtGntramt(BigDecimal.valueOf(glAccontTranasctionRequestModel.getSgtGntramtfc()))
.crSgtGntramt(null)

@ -123,12 +123,18 @@ public class UcoAccountService {
}
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);
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);
@ -165,7 +171,7 @@ public void saveCustomerAccountDetails(String porOrgacode, String cmpCustcode,St
fetchdepositAccountFromCiihive(porOrgacode, cmpCustcode).stream().forEach(k -> {
if(k.getMbmBkmsnumber().equals(accountNumber)){
UcoAccount ucoAccount = UcoAccount.builder()
.id(new AccountId(k.getPorOrgacode(), k.getMbmBkmsnumber())) // Set the AccountId, assuming a method exists to create or retrieve it
.id(new AccountId(k.getPorOrgacode(), k.getMbmBkmsnumber()))
.dmpProdcode(k.getDmpProdcode())
.mbmBkmstitle(k.getMbmBkmstitle())
.pcrCurrdesc(k.getPcrCurrdesc())

Loading…
Cancel
Save