Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ public class CreditReportWritePlatformServiceImpl implements CreditReportWritePl

private final CreditBureauRepository creditBureauRepository;
private final CreditReportRepository creditReportRepository;
private final ThitsaWorksCreditBureauIntegrationWritePlatformService thitsaWorksCreditBureauIntegrationWritePlatformService;
private final ExternalCreditBureauIntegrationWritePlatformService externalCreditBureauIntegrationWritePlatformService;

@Autowired
public CreditReportWritePlatformServiceImpl(final PlatformSecurityContext context, final CreditBureauRepository creditBureauRepository,
final CreditReportRepository creditReportRepository,
final ThitsaWorksCreditBureauIntegrationWritePlatformService thitsaWorksCreditBureauIntegrationWritePlatformService) {
final ExternalCreditBureauIntegrationWritePlatformService externalCreditBureauIntegrationWritePlatformService) {
this.context = context;
this.creditBureauRepository = creditBureauRepository;
this.creditReportRepository = creditReportRepository;
this.thitsaWorksCreditBureauIntegrationWritePlatformService = thitsaWorksCreditBureauIntegrationWritePlatformService;
this.externalCreditBureauIntegrationWritePlatformService = externalCreditBureauIntegrationWritePlatformService;
}

@Override
Expand All @@ -81,8 +81,8 @@ public CommandProcessingResult getCreditReport(JsonCommand command) {

if (Objects.equals(creditBureauName, CreditBureauConfigurations.THITSAWORKS.toString())) {

CreditBureauReportData reportobj = this.thitsaWorksCreditBureauIntegrationWritePlatformService
.getCreditReportFromThitsaWorks(command);
CreditBureauReportData reportobj = this.externalCreditBureauIntegrationWritePlatformService
.getCreditReportFromExternalCredit(command);

Map<String, Object> reportMap = Map.of("name", reportobj.getName(), "gender", reportobj.getGender(), "address",
reportobj.getAddress(), "creditScore", reportobj.getCreditScore(), "borrowerInfo", reportobj.getBorrowerInfo(),
Expand Down Expand Up @@ -115,8 +115,7 @@ public String addCreditReport(Long bureauId, File creditReport, FormDataContentD
String responseMessage = null;

if (Objects.equals(creditBureauName, CreditBureauConfigurations.THITSAWORKS.toString())) {
responseMessage = this.thitsaWorksCreditBureauIntegrationWritePlatformService.addCreditReport(bureauId, creditReport,
fileDetail);
responseMessage = this.externalCreditBureauIntegrationWritePlatformService.addCreditReport(bureauId, creditReport, fileDetail);
} else {

baseDataValidator.reset().failWithCode(CREDIT_BUREAU_HAS_NOT_BEEN_INTEGRATED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.apache.fineract.infrastructure.creditbureau.domain.CreditBureauToken;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;

public interface ThitsaWorksCreditBureauIntegrationWritePlatformService {
public interface ExternalCreditBureauIntegrationWritePlatformService {

CreditBureauToken createToken(Long creditBureauID);

Expand All @@ -33,7 +33,7 @@ public interface ThitsaWorksCreditBureauIntegrationWritePlatformService {
String okHttpConnectionMethod(String userName, String password, String subscriptionKey, String subscriptionId, String url, String token,
File report, FormDataContentDisposition fileDetail, Long uniqueId, String nrcId, String process);

CreditBureauReportData getCreditReportFromThitsaWorks(JsonCommand command);
CreditBureauReportData getCreditReportFromExternalCredit(JsonCommand command);

String addCreditReport(Long bureauId, File creditReport, FormDataContentDisposition fileDetail);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
@Slf4j
@RequiredArgsConstructor
@Service
public class ThitsaWorksCreditBureauIntegrationWritePlatformServiceImpl implements ThitsaWorksCreditBureauIntegrationWritePlatformService {
public class ExternalCreditBureauIntegrationWritePlatformServiceImpl implements ExternalCreditBureauIntegrationWritePlatformService {

public static final String UPLOAD_CREDIT_REPORT = "UploadCreditReport";
public static final String RESPONSE_MESSAGE = "ResponseMessage";
Expand Down Expand Up @@ -216,7 +216,7 @@ private void httpResponse(Integer responseCode, String responseMessage) {

@Transactional
@Override
public CreditBureauReportData getCreditReportFromThitsaWorks(final JsonCommand command) {
public CreditBureauReportData getCreditReportFromExternalCredit(final JsonCommand command) {

this.context.authenticatedUser();
String nrcId = command.stringValueOfParameterNamed("NRC");
Expand Down Expand Up @@ -452,8 +452,7 @@ public CreditBureauToken createToken(Long bureauID) {

public String getCreditBureauConfiguration(Integer creditBureauId, String configurationParameterName) {
List<ApiParameterError> dataValidationErrors = new ArrayList<>();
DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
.resource("ThitsaWorksCreditBureauIntegration");
DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("ExternalCreditBureauIntegration");

String creditBureauConfigurationValue;
try {
Expand Down
Loading
Loading