update http client service
This commit is contained in:
parent
bcf4fcaca6
commit
dba8884e1b
Binary file not shown.
@ -1,11 +0,0 @@
|
||||
package com.banesco.common.domain.exception;
|
||||
|
||||
public class BusinessException extends BaseApiException {
|
||||
public BusinessException(String errorCode, String message, String fieldPath) {
|
||||
super(errorCode, message, fieldPath, "business");
|
||||
}
|
||||
|
||||
public BusinessException(String errorCode, String fieldPath) {
|
||||
super(errorCode, fieldPath, "business");
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,6 @@ import com.banesco.module.legal_customer_product_directory.application.repositor
|
||||
import com.banesco.module.legal_customer_product_directory.application.usecase.LegalCustomerProductDirectoryUseCase;
|
||||
import com.banesco.module.legal_customer_product_directory.domain.dto.request.LegalCustomerProductDirectoryRequest;
|
||||
import com.banesco.module.legal_customer_product_directory.domain.dto.response.LegalCustomerProductDirectoryResponse;
|
||||
import com.banesco.module.legal_customer_product_directory.domain.model.CustomerProductAndServiceDirectory;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -53,15 +52,9 @@ public class LegalCustomerProductDirectoryService implements LegalCustomerProduc
|
||||
) {
|
||||
log.info("Calling persistence repository for client: {}", request.getCustomerIbsNumber());
|
||||
|
||||
CustomerProductAndServiceDirectory response = persistenceRepository.execute(request);
|
||||
|
||||
if(response == null) {
|
||||
throw HttpStatusCodeException.badRequest("400");
|
||||
}
|
||||
|
||||
return new ApiResponse<>(
|
||||
LegalCustomerProductDirectoryResponse.builder()
|
||||
.customerProductAndServiceDirectory(response)
|
||||
.customerProductAndServiceDirectory(persistenceRepository.execute(request))
|
||||
.build(),
|
||||
messageHelper.createStatusResponse("200")
|
||||
);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.banesco.module.legal_customer_product_directory.infrastructure.adapter;
|
||||
|
||||
import com.banesco.common.domain.exception.HttpStatusCodeException;
|
||||
import com.banesco.common.infrastructure.config.DataSourceConfig;
|
||||
import com.banesco.module.legal_customer_product_directory.application.repository.PersistenceRepository;
|
||||
import com.banesco.module.legal_customer_product_directory.domain.dto.request.LegalCustomerProductDirectoryRequest;
|
||||
@ -40,7 +41,7 @@ public class PersistenceAdapter implements PersistenceRepository {
|
||||
log.info("Cuentas obtenidas por el SP: {}", accountsFromSP.size());
|
||||
|
||||
if(accountsFromSP.isEmpty()) {
|
||||
return null;
|
||||
throw HttpStatusCodeException.badRequest("400");
|
||||
}
|
||||
|
||||
return CustomerProductAndServiceDirectory.builder()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user