generated from pagopa/template-payments-java-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
P4ADEV-1426 developed rest call to mock c030
- Loading branch information
1 parent
f487fc7
commit c4fd15c
Showing
24 changed files
with
445 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,71 @@ | ||
openapi: 3.0.1 | ||
openapi: 3.0.3 | ||
info: | ||
title: Fake API | ||
description: "Una semplice API di esempio" | ||
version: "1.0.0" | ||
title: P4PA-PDND-Service API | ||
description: API and Models. | ||
version: 0.0.1 | ||
servers: | ||
- url: "http://localhost:8080/p4papdnd" | ||
paths: | ||
/api/v1/greet: | ||
/anpr-service-e002/citizen: | ||
get: | ||
summary: "Ottieni un saluto" | ||
description: "Endpoint di esempio che restituisce un saluto" | ||
summary: Retrieve citizen data | ||
description: Returns detailed information about a citizen based on their fiscal code. | ||
parameters: | ||
- name: fiscalCode | ||
in: query | ||
description: The fiscal code of the citizen | ||
required: true | ||
schema: | ||
type: string | ||
example: RSSMRA85M01H501Z | ||
responses: | ||
'200': | ||
description: "Successo" | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
firstName: | ||
type: string | ||
example: "Hello, World!" | ||
'500': | ||
description: "Errore interno del server" | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
error: | ||
example: Mario | ||
lastName: | ||
type: string | ||
example: "Errore interno del server" | ||
example: Rossi | ||
dateOfBirth: | ||
type: string | ||
format: YYYY-MM-DD | ||
example: '2021-11-15' | ||
address: | ||
$ref: '#/components/schemas/Address' | ||
'400': | ||
description: Invalid request | ||
'403': | ||
description: Forbidden | ||
'404': | ||
description: Citizen not found | ||
'500': | ||
description: Internal server error | ||
security: | ||
- BearerAuth: [] | ||
components: | ||
securitySchemes: | ||
BearerAuth: | ||
type: http | ||
scheme: bearer | ||
schemas: | ||
Address: | ||
type: object | ||
properties: | ||
street: | ||
type: string | ||
example: Via Roma 10 | ||
city: | ||
type: string | ||
example: Roma | ||
postalCode: | ||
type: string | ||
example: 00100 | ||
country: | ||
type: string | ||
example: Italy |
2 changes: 1 addition & 1 deletion
2
...nfig/pdnd/anpr/AnprC003ServiceConfig.java → ...r/c003/service/AnprC003ServiceConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/client/AnprC030Client.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.client; | ||
|
||
import it.gov.pagopa.payhub.pdnd.anpr.c030.dto.RichiestaDTO; | ||
import it.gov.pagopa.payhub.pdnd.anpr.c030.dto.RispostaOKDTO; | ||
|
||
public interface AnprC030Client { | ||
RispostaOKDTO getIdAnprFromCf(RichiestaDTO clientAssertions); | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/client/AnprC030ClientImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.client; | ||
|
||
import it.gov.pagopa.payhub.pdnd.anpr.c030.dto.RichiestaDTO; | ||
import it.gov.pagopa.payhub.pdnd.anpr.c030.dto.RispostaOKDTO; | ||
import it.gov.pagopa.payhub.pdnd.anpr.c030.service.AnprC030ServiceConfig; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.web.client.RestTemplateBuilder; | ||
import org.springframework.http.HttpEntity; | ||
import org.springframework.http.HttpHeaders; | ||
import org.springframework.http.HttpMethod; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.client.RestTemplate; | ||
|
||
@Component | ||
public class AnprC030ClientImpl implements AnprC030Client { | ||
|
||
@Value("${app.pdnd.anpr.base-url}") | ||
private String anprBasePath; | ||
private final RestTemplate restTemplate; | ||
private final AnprC030ServiceConfig anprC030ServiceConfig; | ||
|
||
public AnprC030ClientImpl(RestTemplateBuilder restTemplateBuilder, AnprC030ServiceConfig anprC030ServiceConfig) { | ||
this.restTemplate = restTemplateBuilder.build(); | ||
this.anprC030ServiceConfig = anprC030ServiceConfig; | ||
} | ||
|
||
public RispostaOKDTO getIdAnprFromCf(RichiestaDTO request) { | ||
HttpHeaders headers = new HttpHeaders(); | ||
headers.set("Content-Type", "application/json"); | ||
headers.set("Accept", "application/json"); | ||
|
||
HttpEntity<RichiestaDTO> entity = new HttpEntity<>(request, headers); | ||
|
||
ResponseEntity<RispostaOKDTO> response = restTemplate.exchange( | ||
anprBasePath + anprC030ServiceConfig.getUrl(), | ||
HttpMethod.POST, | ||
entity, | ||
RispostaOKDTO.class | ||
); | ||
|
||
return response.getBody(); | ||
} | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/dto/RichiestaDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
public class RichiestaDTO { | ||
|
||
private String idOperazioneClient; | ||
|
||
private TipoCriteriRicercaDTO criteriRicerca; | ||
|
||
private TipoDatiRichiestaDTO datiRichiesta; | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/dto/RispostaOKDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.dto; | ||
|
||
import lombok.*; | ||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@RequiredArgsConstructor | ||
public class RispostaOKDTO { | ||
|
||
private String idOperazioneANPR; | ||
|
||
private TipoListaSoggettiDTO listaSoggetti; | ||
|
||
private List<TipoErroriAnomaliaDTO> listaAnomalie; | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/dto/TipoComuneDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
public class TipoComuneDTO { | ||
|
||
private String nomeComune; | ||
|
||
private String codiceIstat; | ||
|
||
private String siglaProvinciaIstat; | ||
|
||
private String descrizioneLocalita; | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/dto/TipoCriteriRicercaDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
public class TipoCriteriRicercaDTO { | ||
|
||
private String codiceFiscale; | ||
|
||
private String cognome; | ||
|
||
private String senzaCognome; | ||
|
||
private String nome; | ||
|
||
private String senzaNome; | ||
|
||
private String sesso; | ||
|
||
private TipoDatiNascitaDTO datiNascita; | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/dto/TipoDatiNascitaDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
public class TipoDatiNascitaDTO { | ||
|
||
private String dataEvento; | ||
|
||
private String senzaGiorno; | ||
|
||
private String senzaGiornoMese; | ||
|
||
private TipoLuogoNascitaDTO luogoNascita; | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/dto/TipoDatiRichiestaDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
public class TipoDatiRichiestaDTO { | ||
|
||
private String dataRiferimentoRichiesta; | ||
|
||
private String motivoRichiesta; | ||
|
||
private String casoUso; | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/dto/TipoDatiSoggettiEnteDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@RequiredArgsConstructor | ||
public class TipoDatiSoggettiEnteDTO { | ||
|
||
private TipoIdentificativiDTO identificativi; | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/dto/TipoErroriAnomaliaDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@RequiredArgsConstructor | ||
public class TipoErroriAnomaliaDTO { | ||
|
||
private String codiceErroreAnomalia; | ||
|
||
private String tipoErroreAnomalia; | ||
|
||
private String testoErroreAnomalia; | ||
|
||
private String oggettoErroreAnomalia; | ||
|
||
private String campoErroreAnomalia; | ||
|
||
private String valoreErroreAnomalia; | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/dto/TipoIdentificativiDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@RequiredArgsConstructor | ||
public class TipoIdentificativiDTO { | ||
|
||
private String idANPR; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/dto/TipoListaSoggettiDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package it.gov.pagopa.payhub.pdnd.anpr.c030.dto; | ||
|
||
import lombok.*; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@RequiredArgsConstructor | ||
public class TipoListaSoggettiDTO { | ||
|
||
private List<TipoDatiSoggettiEnteDTO> datiSoggetto; | ||
} |
Oops, something went wrong.