From 15391969c8e87df0c10fca5ae6068eae319579e0 Mon Sep 17 00:00:00 2001 From: RiccardoGiuliani Date: Fri, 6 Dec 2024 12:17:38 +0100 Subject: [PATCH] P4ADEV-1426 fix pr --- build.gradle.kts | 10 +++++----- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- .../pdnd/anpr/c030/service/AnprC030Service.java | 11 ++++++++++- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cd8b582..6c070f4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,15 +48,15 @@ dependencies { implementation("org.openapitools:jackson-databind-nullable:$openApiToolsVersion") implementation("com.google.code.findbugs:jsr305:$findbugsVersion") - compileOnly("org.projectlombok:lombok") - annotationProcessor("org.projectlombok:lombok") - // validation token jwt implementation("com.auth0:java-jwt:$javaJwtVersion") implementation("com.auth0:jwks-rsa:$jwksRsaVersion") implementation("com.nimbusds:nimbus-jose-jwt:$nimbusJoseJwtVersion") implementation("io.jsonwebtoken:jjwt-api:$jjwtVersion") + compileOnly("org.projectlombok:lombok") + annotationProcessor("org.projectlombok:lombok") + // Testing testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.springframework.security:spring-security-test") @@ -173,7 +173,7 @@ tasks.register("ope "useTags" to "true", "generateConstructorWithAllArgs" to "false", "generatedConstructorWithRequiredArgs" to "false", - "additionalModelTypeAnnotations" to "@lombok.Data @lombok.Builder @lombok.AllArgsConstructor" + "additionalModelTypeAnnotations" to "@lombok.Data;@lombok.Builder;@lombok.NoArgsConstructor;@lombok.AllArgsConstructor" )) } @@ -194,6 +194,6 @@ tasks.register("ope "useTags" to "true", "generateConstructorWithAllArgs" to "false", "generatedConstructorWithRequiredArgs" to "false", - "additionalModelTypeAnnotations" to "@lombok.Data @lombok.Builder @lombok.AllArgsConstructor" + "additionalModelTypeAnnotations" to "@lombok.Data;@lombok.Builder;@lombok.NoArgsConstructor;@lombok.AllArgsConstructor" )) } \ No newline at end of file diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index be2b009..16afb34 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -38,7 +38,7 @@ microservice-chart: PDND_SERVICE_ANPR_C003_PURPOSE_ID: 5ba1f38f-6a91-4da4-8a42-4da1aa55bfee PDND_SERVICE_ANPR_C030_PURPOSE_ID: 87520bd5-207a-4616-85d9-10d7bb3e88b8 - ANPR_BASE_URL: http://localhost:8080 + ANPR_BASE_URL: http://p4pa-mocks-microservice-chart:8080 keyvault: name: "p4pa-d-payhub-kv" diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 1e98577..69a4c06 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -39,7 +39,7 @@ microservice-chart: PDND_SERVICE_ANPR_C003_PURPOSE_ID: 5ba1f38f-6a91-4da4-8a42-4da1aa55bfee PDND_SERVICE_ANPR_C030_PURPOSE_ID: 87520bd5-207a-4616-85d9-10d7bb3e88b8 - ANPR_BASE_URL: https://modipa-val.anpr.interno.it + ANPR_BASE_URL: https://p4pa-mocks-microservice-chart:8080 keyvault: name: "p4pa-p-payhub-kv" diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index ac3edaf..4adce36 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -38,7 +38,7 @@ microservice-chart: PDND_SERVICE_ANPR_C003_PURPOSE_ID: 5ba1f38f-6a91-4da4-8a42-4da1aa55bfee PDND_SERVICE_ANPR_C030_PURPOSE_ID: 87520bd5-207a-4616-85d9-10d7bb3e88b8 - ANPR_BASE_URL: http://localhost:8080 + ANPR_BASE_URL: http://p4pa-mocks-microservice-chart:8080 keyvault: name: "p4pa-u-payhub-kv" diff --git a/src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/service/AnprC030Service.java b/src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/service/AnprC030Service.java index 17d0c63..6059b65 100644 --- a/src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/service/AnprC030Service.java +++ b/src/main/java/it/gov/pagopa/payhub/pdnd/anpr/c030/service/AnprC030Service.java @@ -8,6 +8,9 @@ import it.gov.pagopa.payhub.pdnd.anpr.c030.client.AnprC030ClientImpl; import org.springframework.stereotype.Service; +import java.time.Instant; +import java.util.UUID; + @Service public class AnprC030Service { @@ -27,12 +30,18 @@ public RispostaE002OK getIdAnprFromFc(String fiscalCode) { .build(); RichiestaE002 request = RichiestaE002.builder() - .idOperazioneClient("ID-ENTE-myHost-1701102800550") + .idOperazioneClient(generateIdClientOperation(fiscalCode)) .criteriRicerca(searchTypes) .datiRichiesta(reqDataTypes) .build(); return anprC030Client.getIdAnprFromFc(request); } + + private String generateIdClientOperation(String fiscalCode) { + String timestamp = String.valueOf(Instant.now().toEpochMilli()); + String uuid = UUID.nameUUIDFromBytes(fiscalCode.getBytes()).toString(); + return uuid + "-" + timestamp; + } }