From 482dc189768f78ad2f130a0e1198350278c07a41 Mon Sep 17 00:00:00 2001 From: "marco.matteucci@eng.it" Date: Fri, 22 Nov 2024 10:14:52 +0100 Subject: [PATCH 01/14] feat: P4ADEV-1421-fdr-create-temporal-activity added FdR WF activities - add gradle.lockfile file --- build.gradle.kts | 2 ++ gradle.lockfile | 25 +++++++++++++++++++ .../activity/fdr/FdRIngestionActivity.java | 23 +++++++++++++++++ .../fdr/SendEmailIngestionFlowActivity.java | 22 ++++++++++++++++ .../UpdateIngestionFlowStatusActivity.java | 22 ++++++++++++++++ .../dto/fdr/FdRIngestionResponse.java | 19 ++++++++++++++ 6 files changed, 113 insertions(+) create mode 100644 src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java create mode 100644 src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java create mode 100644 src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java create mode 100644 src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java diff --git a/build.gradle.kts b/build.gradle.kts index 20adac91..eeae8fc7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -71,6 +71,8 @@ dependencies { implementation("com.fasterxml.jackson.module:jackson-module-parameter-names:$jacksonModuleVersion") + // Temporal.io + implementation ("io.temporal:temporal-sdk:1.19.0") // Testing testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.junit.jupiter:junit-jupiter-api") diff --git a/gradle.lockfile b/gradle.lockfile index e69d2c27..1a98212c 100644 --- a/gradle.lockfile +++ b/gradle.lockfile @@ -10,10 +10,34 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2=compileClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.18.1=compileClasspath com.fasterxml.jackson:jackson-bom:2.18.1=compileClasspath com.fasterxml:classmate:1.7.0=compileClasspath +com.google.api.grpc:proto-google-common-protos:2.9.0=compileClasspath +com.google.code.findbugs:jsr305:3.0.2=compileClasspath +com.google.code.gson:gson:2.10.1=compileClasspath +com.google.errorprone:error_prone_annotations:2.14.0=compileClasspath +com.google.guava:failureaccess:1.0.1=compileClasspath +com.google.guava:guava:31.1-jre=compileClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath +com.google.j2objc:j2objc-annotations:1.3=compileClasspath +com.google.protobuf:protobuf-java-util:3.22.0=compileClasspath +com.google.protobuf:protobuf-java:3.21.7=compileClasspath +com.uber.m3:tally-core:0.13.0=compileClasspath commons-codec:commons-codec:1.16.1=compileClasspath commons-io:commons-io:2.16.1=compileClasspath +io.grpc:grpc-api:1.53.0=compileClasspath +io.grpc:grpc-bom:1.53.0=compileClasspath +io.grpc:grpc-context:1.53.0=compileClasspath +io.grpc:grpc-core:1.53.0=compileClasspath +io.grpc:grpc-netty-shaded:1.53.0=compileClasspath +io.grpc:grpc-protobuf-lite:1.53.0=compileClasspath +io.grpc:grpc-protobuf:1.53.0=compileClasspath +io.grpc:grpc-services:1.53.0=compileClasspath +io.grpc:grpc-stub:1.53.0=compileClasspath +io.micrometer:micrometer-bom:1.9.9=compileClasspath io.micrometer:micrometer-commons:1.13.6=compileClasspath +io.micrometer:micrometer-core:1.13.6=compileClasspath io.micrometer:micrometer-observation:1.13.6=compileClasspath +io.temporal:temporal-sdk:1.19.0=compileClasspath +io.temporal:temporal-serviceclient:1.19.0=compileClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=compileClasspath jakarta.validation:jakarta.validation-api:3.0.2=compileClasspath org.apache.commons:commons-compress:1.27.1=compileClasspath @@ -21,6 +45,7 @@ org.apache.commons:commons-lang3:3.17.0=compileClasspath org.apache.commons:commons-text:1.12.0=compileClasspath org.apache.logging.log4j:log4j-api:2.23.1=compileClasspath org.apache.logging.log4j:log4j-to-slf4j:2.23.1=compileClasspath +org.checkerframework:checker-qual:3.12.0=compileClasspath org.codehaus.janino:commons-compiler:3.1.12=compileClasspath org.codehaus.janino:janino:3.1.12=compileClasspath org.hibernate.validator:hibernate-validator:8.0.1.Final=compileClasspath diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java new file mode 100644 index 00000000..39b53c39 --- /dev/null +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java @@ -0,0 +1,23 @@ +package it.gov.pagopa.payhub.activities.activity.fdr; + +import io.temporal.activity.ActivityInterface; +import io.temporal.activity.ActivityMethod; +import it.gov.pagopa.payhub.activities.dto.fdr.FdRIngestionResponse; +import it.gov.pagopa.payhub.activities.dto.fdr.FdRIngestionResponse; + +/** + * Interface for the FdRIngestionActivity. + * Defines methods for processing files based on an ID. + */ +@ActivityInterface +public interface FdRIngestionActivity { + + /** + * Processes a file based on the provided ID. + * + * @param fileId the unique identifier of the file to process. + * @return {@link FdRIngestionResponse} containing the list of IUFs and status. + */ + @ActivityMethod + FdRIngestionResponse processFile(String fileId); +} diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java new file mode 100644 index 00000000..5f04b5fb --- /dev/null +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java @@ -0,0 +1,22 @@ +package it.gov.pagopa.payhub.activities.activity.fdr; + +import io.temporal.activity.ActivityInterface; +import io.temporal.activity.ActivityMethod; + +/** + * Interface for SendEmailIngestionFlowActivity. + * Sends an email based on the status of a processed file identified by its ID. + */ +@ActivityInterface +public interface SendEmailIngestionFlowActivity { + + /** + * Sends an email based on the process result of the given file ID. + * + * @param fileId the unique identifier of the imported file. + * @param success true if the process succeeded, false otherwise. + * @return true if the email was sent successfully, false otherwise. + */ + @ActivityMethod + boolean sendEmail(String fileId, boolean success); +} diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java new file mode 100644 index 00000000..995891b0 --- /dev/null +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java @@ -0,0 +1,22 @@ +package it.gov.pagopa.payhub.activities.activity.fdr; + +import io.temporal.activity.ActivityInterface; +import io.temporal.activity.ActivityMethod; + +/** + * Interface for the UpdateIngestionFlowStatusActivity. + * Updates the status of a database row identified by the provided ID. + */ +@ActivityInterface +public interface UpdateIngestionFlowStatusActivity { + + /** + * Updates the status of the row corresponding to the given ID. + * + * @param id the unique identifier of the row to update. + * @param newStatus the new status to set. + * @return true if the update was successful, false otherwise. + */ + @ActivityMethod + boolean updateStatus(String id, String newStatus); +} diff --git a/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java new file mode 100644 index 00000000..ea720896 --- /dev/null +++ b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java @@ -0,0 +1,19 @@ +package it.gov.pagopa.payhub.activities.dto.fdr; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * DTO for the FdRIngestionResponse, representing the result of file processing. + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class FdRIngestionResponse { + private List iufList; // List of extracted IUFs + private boolean success; // Success flag for the operation + private String errorLogPath; // Path to the error log, if applicable +} From 948bbe9a95cac7fb89140e5d32ac981d0a8e383e Mon Sep 17 00:00:00 2001 From: "marco.matteucci@eng.it" Date: Fri, 22 Nov 2024 10:16:46 +0100 Subject: [PATCH 02/14] feat: P4ADEV-1421-fdr-create-temporal-activity added FdR WF activities - add gradle.lockfile file --- .../pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java index ea720896..81defe75 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java @@ -15,5 +15,4 @@ public class FdRIngestionResponse { private List iufList; // List of extracted IUFs private boolean success; // Success flag for the operation - private String errorLogPath; // Path to the error log, if applicable } From f5b40dba0c8f4b32b9833f0923e539c8af0c5477 Mon Sep 17 00:00:00 2001 From: marcomatteuccieng Date: Fri, 22 Nov 2024 11:20:10 +0100 Subject: [PATCH 03/14] Update src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java Co-authored-by: antonioT90 <34568575+antonioT90@users.noreply.github.com> --- .../payhub/activities/activity/fdr/FdRIngestionActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java index 39b53c39..62449492 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java @@ -7,7 +7,7 @@ /** * Interface for the FdRIngestionActivity. - * Defines methods for processing files based on an ID. + * Defines methods for processing files based on an IngestionFlow ID. */ @ActivityInterface public interface FdRIngestionActivity { From 6de94024698ca983d39452fa8912bbff4b4d8c26 Mon Sep 17 00:00:00 2001 From: marcomatteuccieng Date: Fri, 22 Nov 2024 11:21:48 +0100 Subject: [PATCH 04/14] Update src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java Co-authored-by: antonioT90 <34568575+antonioT90@users.noreply.github.com> --- .../payhub/activities/activity/fdr/FdRIngestionActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java index 62449492..4e212c76 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java @@ -13,9 +13,9 @@ public interface FdRIngestionActivity { /** - * Processes a file based on the provided ID. + * Processes a file based on the provided IngestionFlow ID. * - * @param fileId the unique identifier of the file to process. + * @param ingestionFlowId the unique identifier related to the file to process. * @return {@link FdRIngestionResponse} containing the list of IUFs and status. */ @ActivityMethod From c37b5097bcba5f33c08ac7656dbd23708c1cd877 Mon Sep 17 00:00:00 2001 From: marcomatteuccieng Date: Fri, 22 Nov 2024 11:22:30 +0100 Subject: [PATCH 05/14] Update src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java Co-authored-by: antonioT90 <34568575+antonioT90@users.noreply.github.com> --- .../payhub/activities/activity/fdr/FdRIngestionActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java index 4e212c76..91b2f093 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java @@ -19,5 +19,5 @@ public interface FdRIngestionActivity { * @return {@link FdRIngestionResponse} containing the list of IUFs and status. */ @ActivityMethod - FdRIngestionResponse processFile(String fileId); + FdRIngestionResponse processFile(String ingestionFlowId); } From 1217bef8c2c115e7f8567f6cd6c5c441b6c25ad5 Mon Sep 17 00:00:00 2001 From: marcomatteuccieng Date: Fri, 22 Nov 2024 11:22:46 +0100 Subject: [PATCH 06/14] Update src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java Co-authored-by: antonioT90 <34568575+antonioT90@users.noreply.github.com> --- .../activities/activity/fdr/SendEmailIngestionFlowActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java index 5f04b5fb..1ce8f7a0 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java @@ -5,7 +5,7 @@ /** * Interface for SendEmailIngestionFlowActivity. - * Sends an email based on the status of a processed file identified by its ID. + * Sends an email based on the status of a processed file identified by its IngestionFlow ID. */ @ActivityInterface public interface SendEmailIngestionFlowActivity { From c4cf6484dd76db018c2483ed34c9d5d2b8bc6491 Mon Sep 17 00:00:00 2001 From: marcomatteuccieng Date: Fri, 22 Nov 2024 11:23:04 +0100 Subject: [PATCH 07/14] Update src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java Co-authored-by: antonioT90 <34568575+antonioT90@users.noreply.github.com> --- .../activity/fdr/UpdateIngestionFlowStatusActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java index 995891b0..c21cf8f7 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java @@ -5,7 +5,7 @@ /** * Interface for the UpdateIngestionFlowStatusActivity. - * Updates the status of a database row identified by the provided ID. + * Updates the status of a IngestionFlow record identified by the provided ID. */ @ActivityInterface public interface UpdateIngestionFlowStatusActivity { From d737888f34290648514036d47ec255a4b2b63eb0 Mon Sep 17 00:00:00 2001 From: marcomatteuccieng Date: Fri, 22 Nov 2024 11:23:22 +0100 Subject: [PATCH 08/14] Update src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java Co-authored-by: antonioT90 <34568575+antonioT90@users.noreply.github.com> --- .../activity/fdr/UpdateIngestionFlowStatusActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java index c21cf8f7..427ed61d 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java @@ -11,9 +11,9 @@ public interface UpdateIngestionFlowStatusActivity { /** - * Updates the status of the row corresponding to the given ID. + * Updates the status of the IngestionFlow record corresponding to the given ID. * - * @param id the unique identifier of the row to update. + * @param id the unique identifier of the record to update. * @param newStatus the new status to set. * @return true if the update was successful, false otherwise. */ From e79da5b01d95512ff8526b4e1d1f1b76917b06ca Mon Sep 17 00:00:00 2001 From: marcomatteuccieng Date: Fri, 22 Nov 2024 11:24:08 +0100 Subject: [PATCH 09/14] Update src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java Co-authored-by: antonioT90 <34568575+antonioT90@users.noreply.github.com> --- .../pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java index 81defe75..ffd32c38 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java @@ -14,5 +14,6 @@ @AllArgsConstructor public class FdRIngestionResponse { private List iufList; // List of extracted IUFs - private boolean success; // Success flag for the operation + /** Success flag for the operation */ + private boolean success; } From aa6d8d7ecb8d870061fe3fc6c64d1d6d7ba9778d Mon Sep 17 00:00:00 2001 From: marcomatteuccieng Date: Fri, 22 Nov 2024 11:24:20 +0100 Subject: [PATCH 10/14] Update src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java Co-authored-by: antonioT90 <34568575+antonioT90@users.noreply.github.com> --- .../pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java index ffd32c38..90be8773 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java @@ -13,7 +13,8 @@ @NoArgsConstructor @AllArgsConstructor public class FdRIngestionResponse { - private List iufList; // List of extracted IUFs + /** List of extracted IUFs */ + private List iufs; /** Success flag for the operation */ private boolean success; } From 44b7e37446bc12cd7f079c244b5bc6647421f2dd Mon Sep 17 00:00:00 2001 From: marcomatteuccieng Date: Fri, 22 Nov 2024 14:05:08 +0100 Subject: [PATCH 11/14] Update src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java Co-authored-by: antonioT90 <34568575+antonioT90@users.noreply.github.com> --- .../pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java index 90be8773..304a55dd 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java @@ -12,7 +12,7 @@ @Data @NoArgsConstructor @AllArgsConstructor -public class FdRIngestionResponse { +public class FdRIngestionActivityResult { /** List of extracted IUFs */ private List iufs; /** Success flag for the operation */ From 69ed5aedd260b94e0eced2336deb7560a6f74d76 Mon Sep 17 00:00:00 2001 From: "marco.matteucci@eng.it" Date: Fri, 22 Nov 2024 14:23:13 +0100 Subject: [PATCH 12/14] feat:P4ADEV-1421-fdr-create-temporal-activity added FdR WF activities - changed the return name of the DTO --- build.gradle.kts | 3 ++- .../activities/activity/fdr/FdRIngestionActivity.java | 7 +++---- ...estionResponse.java => FdRIngestionActivityResult.java} | 0 3 files changed, 5 insertions(+), 5 deletions(-) rename src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/{FdRIngestionResponse.java => FdRIngestionActivityResult.java} (100%) diff --git a/build.gradle.kts b/build.gradle.kts index eeae8fc7..e04d85e7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,6 +53,7 @@ val commonsCompressVersion = "1.27.1" val commonsLang3Version = "3.17.0" val commonsTextVersion = "1.12.0" val jacksonModuleVersion = "2.18.1" +val temporalVersion = "1.19.0" dependencies { @@ -72,7 +73,7 @@ dependencies { implementation("com.fasterxml.jackson.module:jackson-module-parameter-names:$jacksonModuleVersion") // Temporal.io - implementation ("io.temporal:temporal-sdk:1.19.0") + implementation ("io.temporal:temporal-sdk:$temporalVersion") // Testing testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.junit.jupiter:junit-jupiter-api") diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java index 91b2f093..c413f12a 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java @@ -2,8 +2,7 @@ import io.temporal.activity.ActivityInterface; import io.temporal.activity.ActivityMethod; -import it.gov.pagopa.payhub.activities.dto.fdr.FdRIngestionResponse; -import it.gov.pagopa.payhub.activities.dto.fdr.FdRIngestionResponse; +import it.gov.pagopa.payhub.activities.dto.fdr.FdRIngestionActivityResult; /** * Interface for the FdRIngestionActivity. @@ -16,8 +15,8 @@ public interface FdRIngestionActivity { * Processes a file based on the provided IngestionFlow ID. * * @param ingestionFlowId the unique identifier related to the file to process. - * @return {@link FdRIngestionResponse} containing the list of IUFs and status. + * @return {@link FdRIngestionActivityResult} containing the list of IUFs and status. */ @ActivityMethod - FdRIngestionResponse processFile(String ingestionFlowId); + FdRIngestionActivityResult processFile(String ingestionFlowId); } diff --git a/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java b/src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionActivityResult.java similarity index 100% rename from src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionResponse.java rename to src/main/java/it/gov/pagopa/payhub/activities/dto/fdr/FdRIngestionActivityResult.java From 1426422f66ab86cbca94f2a664db0f29eb90c902 Mon Sep 17 00:00:00 2001 From: marcomatteuccieng Date: Fri, 22 Nov 2024 14:28:58 +0100 Subject: [PATCH 13/14] Update src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java Co-authored-by: antonioT90 <34568575+antonioT90@users.noreply.github.com> --- .../activity/fdr/SendEmailIngestionFlowActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java index 1ce8f7a0..cbfe3052 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java @@ -11,12 +11,12 @@ public interface SendEmailIngestionFlowActivity { /** - * Sends an email based on the process result of the given file ID. + * Sends an email based on the process result of the given file ingestionFlow ID. * - * @param fileId the unique identifier of the imported file. + * @param ingestionFlowId the unique identifier of the IngestionFlow record related to the imported file. * @param success true if the process succeeded, false otherwise. * @return true if the email was sent successfully, false otherwise. */ @ActivityMethod - boolean sendEmail(String fileId, boolean success); + boolean sendEmail(String ingestionFlowId, boolean success); } From 87c697eba051275ec7ab8fc0943a52891b2876fe Mon Sep 17 00:00:00 2001 From: "marco.matteucci@eng.it" Date: Fri, 22 Nov 2024 16:45:02 +0100 Subject: [PATCH 14/14] feat:P4ADEV-1421-fdr-create-temporal-activity added FdR WF activities - removed Tempral annotations and dependencies --- build.gradle.kts | 3 --- gradle.lockfile | 25 ------------------- .../activity/fdr/FdRIngestionActivity.java | 5 ---- .../fdr/SendEmailIngestionFlowActivity.java | 5 ---- .../UpdateIngestionFlowStatusActivity.java | 5 ---- 5 files changed, 43 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e04d85e7..20adac91 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,7 +53,6 @@ val commonsCompressVersion = "1.27.1" val commonsLang3Version = "3.17.0" val commonsTextVersion = "1.12.0" val jacksonModuleVersion = "2.18.1" -val temporalVersion = "1.19.0" dependencies { @@ -72,8 +71,6 @@ dependencies { implementation("com.fasterxml.jackson.module:jackson-module-parameter-names:$jacksonModuleVersion") - // Temporal.io - implementation ("io.temporal:temporal-sdk:$temporalVersion") // Testing testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.junit.jupiter:junit-jupiter-api") diff --git a/gradle.lockfile b/gradle.lockfile index 1a98212c..e69d2c27 100644 --- a/gradle.lockfile +++ b/gradle.lockfile @@ -10,34 +10,10 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2=compileClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.18.1=compileClasspath com.fasterxml.jackson:jackson-bom:2.18.1=compileClasspath com.fasterxml:classmate:1.7.0=compileClasspath -com.google.api.grpc:proto-google-common-protos:2.9.0=compileClasspath -com.google.code.findbugs:jsr305:3.0.2=compileClasspath -com.google.code.gson:gson:2.10.1=compileClasspath -com.google.errorprone:error_prone_annotations:2.14.0=compileClasspath -com.google.guava:failureaccess:1.0.1=compileClasspath -com.google.guava:guava:31.1-jre=compileClasspath -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath -com.google.j2objc:j2objc-annotations:1.3=compileClasspath -com.google.protobuf:protobuf-java-util:3.22.0=compileClasspath -com.google.protobuf:protobuf-java:3.21.7=compileClasspath -com.uber.m3:tally-core:0.13.0=compileClasspath commons-codec:commons-codec:1.16.1=compileClasspath commons-io:commons-io:2.16.1=compileClasspath -io.grpc:grpc-api:1.53.0=compileClasspath -io.grpc:grpc-bom:1.53.0=compileClasspath -io.grpc:grpc-context:1.53.0=compileClasspath -io.grpc:grpc-core:1.53.0=compileClasspath -io.grpc:grpc-netty-shaded:1.53.0=compileClasspath -io.grpc:grpc-protobuf-lite:1.53.0=compileClasspath -io.grpc:grpc-protobuf:1.53.0=compileClasspath -io.grpc:grpc-services:1.53.0=compileClasspath -io.grpc:grpc-stub:1.53.0=compileClasspath -io.micrometer:micrometer-bom:1.9.9=compileClasspath io.micrometer:micrometer-commons:1.13.6=compileClasspath -io.micrometer:micrometer-core:1.13.6=compileClasspath io.micrometer:micrometer-observation:1.13.6=compileClasspath -io.temporal:temporal-sdk:1.19.0=compileClasspath -io.temporal:temporal-serviceclient:1.19.0=compileClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=compileClasspath jakarta.validation:jakarta.validation-api:3.0.2=compileClasspath org.apache.commons:commons-compress:1.27.1=compileClasspath @@ -45,7 +21,6 @@ org.apache.commons:commons-lang3:3.17.0=compileClasspath org.apache.commons:commons-text:1.12.0=compileClasspath org.apache.logging.log4j:log4j-api:2.23.1=compileClasspath org.apache.logging.log4j:log4j-to-slf4j:2.23.1=compileClasspath -org.checkerframework:checker-qual:3.12.0=compileClasspath org.codehaus.janino:commons-compiler:3.1.12=compileClasspath org.codehaus.janino:janino:3.1.12=compileClasspath org.hibernate.validator:hibernate-validator:8.0.1.Final=compileClasspath diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java index c413f12a..da3b00f2 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/FdRIngestionActivity.java @@ -1,14 +1,10 @@ package it.gov.pagopa.payhub.activities.activity.fdr; - -import io.temporal.activity.ActivityInterface; -import io.temporal.activity.ActivityMethod; import it.gov.pagopa.payhub.activities.dto.fdr.FdRIngestionActivityResult; /** * Interface for the FdRIngestionActivity. * Defines methods for processing files based on an IngestionFlow ID. */ -@ActivityInterface public interface FdRIngestionActivity { /** @@ -17,6 +13,5 @@ public interface FdRIngestionActivity { * @param ingestionFlowId the unique identifier related to the file to process. * @return {@link FdRIngestionActivityResult} containing the list of IUFs and status. */ - @ActivityMethod FdRIngestionActivityResult processFile(String ingestionFlowId); } diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java index cbfe3052..f5758fab 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/SendEmailIngestionFlowActivity.java @@ -1,13 +1,9 @@ package it.gov.pagopa.payhub.activities.activity.fdr; -import io.temporal.activity.ActivityInterface; -import io.temporal.activity.ActivityMethod; - /** * Interface for SendEmailIngestionFlowActivity. * Sends an email based on the status of a processed file identified by its IngestionFlow ID. */ -@ActivityInterface public interface SendEmailIngestionFlowActivity { /** @@ -17,6 +13,5 @@ public interface SendEmailIngestionFlowActivity { * @param success true if the process succeeded, false otherwise. * @return true if the email was sent successfully, false otherwise. */ - @ActivityMethod boolean sendEmail(String ingestionFlowId, boolean success); } diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java index 427ed61d..01bfd004 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/fdr/UpdateIngestionFlowStatusActivity.java @@ -1,13 +1,9 @@ package it.gov.pagopa.payhub.activities.activity.fdr; -import io.temporal.activity.ActivityInterface; -import io.temporal.activity.ActivityMethod; - /** * Interface for the UpdateIngestionFlowStatusActivity. * Updates the status of a IngestionFlow record identified by the provided ID. */ -@ActivityInterface public interface UpdateIngestionFlowStatusActivity { /** @@ -17,6 +13,5 @@ public interface UpdateIngestionFlowStatusActivity { * @param newStatus the new status to set. * @return true if the update was successful, false otherwise. */ - @ActivityMethod boolean updateStatus(String id, String newStatus); }