Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopocarlini committed Feb 8, 2024
1 parent f5216cc commit f14fb0a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -46,7 +47,7 @@ public class HomeController {
HealthCheckService healthCheckService;

@Autowired
PspRepository pspRepository;
ExtendedPspRepository pspRepository;

/**
* @return redirect to Swagger page documentation
Expand Down Expand Up @@ -127,7 +128,7 @@ public ResponseEntity<AppInfo> healthCheck() {
tags = {"Home"})
@GetMapping("/export_psp_duplicated")
public Collection<PspDuplicated> getPspDuplicated() {
return pspRepository.findAll()
return pspRepository.findAllByEnabled(true)
.parallelStream()
.map(elem -> {
var builder = new PspDuplicated(elem.getCodiceFiscale());
Expand Down
Original file line number Diff line number Diff line change
@@ -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<Psp> findAllByEnabled(Boolean enabled);
}

0 comments on commit f14fb0a

Please sign in to comment.