Skip to content

Commit

Permalink
P4ADEV-1426 fix pr
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoGiuliani committed Dec 6, 2024
1 parent ddda446 commit 1539196
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -173,7 +173,7 @@ tasks.register<org.openapitools.generator.gradle.plugin.tasks.GenerateTask>("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"
))
}

Expand All @@ -194,6 +194,6 @@ tasks.register<org.openapitools.generator.gradle.plugin.tasks.GenerateTask>("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"
))
}
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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;
}
}

0 comments on commit 1539196

Please sign in to comment.