diff --git a/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/controller/HomeController.java b/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/controller/HomeController.java index 7c7edccd..eda03e61 100644 --- a/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/controller/HomeController.java +++ b/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/controller/HomeController.java @@ -10,6 +10,7 @@ import it.gov.pagopa.apiconfig.selfcareintegration.model.AppInfo; import it.gov.pagopa.apiconfig.selfcareintegration.model.ProblemJson; import it.gov.pagopa.apiconfig.selfcareintegration.model.PspDuplicated; +import it.gov.pagopa.apiconfig.selfcareintegration.repository.ExtendedPspRepository; import it.gov.pagopa.apiconfig.selfcareintegration.service.HealthCheckService; import it.gov.pagopa.apiconfig.starter.repository.PspRepository; import org.springframework.beans.factory.annotation.Autowired; @@ -46,7 +47,7 @@ public class HomeController { HealthCheckService healthCheckService; @Autowired - PspRepository pspRepository; + ExtendedPspRepository pspRepository; /** * @return redirect to Swagger page documentation @@ -127,7 +128,7 @@ public ResponseEntity healthCheck() { tags = {"Home"}) @GetMapping("/export_psp_duplicated") public Collection getPspDuplicated() { - return pspRepository.findAll() + return pspRepository.findAllByEnabled(true) .parallelStream() .map(elem -> { var builder = new PspDuplicated(elem.getCodiceFiscale()); diff --git a/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/repository/ExtendedPspRepository.java b/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/repository/ExtendedPspRepository.java new file mode 100644 index 00000000..b6fbbf23 --- /dev/null +++ b/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/repository/ExtendedPspRepository.java @@ -0,0 +1,19 @@ +package it.gov.pagopa.apiconfig.selfcareintegration.repository; + +import it.gov.pagopa.apiconfig.starter.entity.IbanMaster; +import it.gov.pagopa.apiconfig.starter.entity.Psp; +import it.gov.pagopa.apiconfig.starter.repository.IbanMasterRepository; +import it.gov.pagopa.apiconfig.starter.repository.PspRepository; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@SuppressWarnings( + "java:S100") // Disabled naming convention rule for method name to use Spring Data interface +@Repository +public interface ExtendedPspRepository extends PspRepository { + + List findAllByEnabled(Boolean enabled); +}