Repository: pagopa/p4pa-payhub-activities
Pull request #277: feat: P4ADEV-2701 activity status folder
Author: login: RiccardoGiuliani
Labels: name: released
Created: 2025-05-19T12:15:53Z | Merged: 2025-05-19T14:11:35Z

#### Description
<!--- Please always add a PR description as if nobody knows anything about the context these changes come from. -->
<!--- Even if we are all from our internal team, we may not be on the same page. -->
<!--- Write this PR as you were contributing to a public OSS project, where nobody knows you and you have to earn their trust. -->
<!--- This will improve our projects in the long run! Thanks. -->

#### List of Changes
<!--- Describe your changes in detail -->

#### Motivation and Context
<!--- Why is this change required? What problem does it solve? -->

#### How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->
- Pre-Deploy Test
    - [ ] Unit
    - [ ] Integration (Narrow)
- Post-Deploy Test
    - [ ] Isolated Microservice
    - [ ] Broader Integration
    - [ ] Acceptance
    - [ ] Performance & Load

#### Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] PATCH - Bug fix (backwards compatible bug fixes)
- [ ] MINOR - New feature (add functionality in a backwards compatible manner)
- [ ] MAJOR - Breaking change (fix or feature that would cause existing functionality to not work as expected)

#### Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.



Diff:
diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/ingestionflow/debtposition/MassiveNoticeGenerationStatusRetrieverActivity.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/ingestionflow/debtposition/MassiveNoticeGenerationStatusRetrieverActivity.java
new file mode 100644
index 000000000..168c8dbb0
--- /dev/null
+++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/ingestionflow/debtposition/MassiveNoticeGenerationStatusRetrieverActivity.java
@@ -0,0 +1,22 @@
+package it.gov.pagopa.payhub.activities.activity.ingestionflow.debtposition;
+
+import io.temporal.activity.ActivityInterface;
+import io.temporal.activity.ActivityMethod;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
+
+@ActivityInterface
+public interface MassiveNoticeGenerationStatusRetrieverActivity {
+    /**
+     * Retrieves the status of the specified pdfGeneratedId.
+     * Returns a SignedUrlResultDTO which includes:
+     * - a signedUrl
+     * - two lists: one of processed items and another of notices in error
+     * If the status is not complete, returns a 204 no content.
+     *
+     * @param organizationId the ID of the organization
+     * @param pdfGeneratedId the id of the generation request
+     */
+    @ActivityMethod
+    SignedUrlResultDTO retrieveNoticesGenerationStatus(Long organizationId, String pdfGeneratedId);
+}
+
diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/ingestionflow/debtposition/MassiveNoticeGenerationStatusRetrieverActivityImpl.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/ingestionflow/debtposition/MassiveNoticeGenerationStatusRetrieverActivityImpl.java
new file mode 100644
index 000000000..d28c90d37
--- /dev/null
+++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/ingestionflow/debtposition/MassiveNoticeGenerationStatusRetrieverActivityImpl.java
@@ -0,0 +1,23 @@
+package it.gov.pagopa.payhub.activities.activity.ingestionflow.debtposition;
+
+import it.gov.pagopa.payhub.activities.connector.pagopapayments.PrintPaymentNoticeService;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+@Lazy
+@Slf4j
+@Service
+public class MassiveNoticeGenerationStatusRetrieverActivityImpl implements MassiveNoticeGenerationStatusRetrieverActivity {
+    private final PrintPaymentNoticeService printPaymentNoticeService;
+
+    public MassiveNoticeGenerationStatusRetrieverActivityImpl(PrintPaymentNoticeService printPaymentNoticeService) {
+        this.printPaymentNoticeService = printPaymentNoticeService;
+    }
+
+    @Override
+    public SignedUrlResultDTO retrieveNoticesGenerationStatus(Long organizationId, String pdfGeneratedId) {
+        return printPaymentNoticeService.getSignedUrl(organizationId, pdfGeneratedId);
+    }
+}
diff --git a/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeService.java b/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeService.java
index 1995f2789..7267dea66 100644
--- a/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeService.java
+++ b/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeService.java
@@ -2,6 +2,7 @@
 
 import it.gov.pagopa.pu.pagopapayments.dto.generated.GeneratedNoticeMassiveFolderDTO;
 import it.gov.pagopa.pu.pagopapayments.dto.generated.NoticeRequestMassiveDTO;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
 
 /**
  * This interface provides a method for print payment notice on PagoPa service
@@ -15,4 +16,13 @@ public interface PrintPaymentNoticeService {
 	 * @return folderId
 	 */
 	GeneratedNoticeMassiveFolderDTO generateMassive(NoticeRequestMassiveDTO noticeRequestMassiveDTO);
+
+	/**
+	 * Return SignedUrlResultDTO with signedUrl if generation request status is ready and two lists containing all notices processed or in error
+	 *
+	 * @param organizationId the ID of the organization
+	 * @param pdfGeneratedId retrieved from generateMassive
+	 * @return SignedUrlResultDTO
+	 */
+	SignedUrlResultDTO getSignedUrl(Long organizationId, String pdfGeneratedId);
 }
diff --git a/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeServiceImpl.java b/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeServiceImpl.java
index bf8ee2580..9105995ec 100644
--- a/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeServiceImpl.java
+++ b/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeServiceImpl.java
@@ -4,6 +4,7 @@
 import it.gov.pagopa.payhub.activities.connector.pagopapayments.client.PrintPaymentNoticeClient;
 import it.gov.pagopa.pu.pagopapayments.dto.generated.GeneratedNoticeMassiveFolderDTO;
 import it.gov.pagopa.pu.pagopapayments.dto.generated.NoticeRequestMassiveDTO;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
@@ -25,4 +26,10 @@ public GeneratedNoticeMassiveFolderDTO generateMassive(NoticeRequestMassiveDTO n
 		log.info("Generate massive notices for requestId: {}", noticeRequestMassiveDTO.getRequestId());
 		return printPaymentNoticeClient.generateMassive(noticeRequestMassiveDTO, authnService.getAccessToken());
 	}
+
+	@Override
+	public SignedUrlResultDTO getSignedUrl(Long organizationId, String pdfGeneratedId) {
+		log.info("Get signed url for organizationId: {} and pdfGeneratedId: {}", organizationId, pdfGeneratedId);
+		return printPaymentNoticeClient.getSignedUrl(organizationId, pdfGeneratedId, authnService.getAccessToken());
+	}
 }
diff --git a/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/client/PrintPaymentNoticeClient.java b/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/client/PrintPaymentNoticeClient.java
index 2d2c6d242..f5386f816 100644
--- a/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/client/PrintPaymentNoticeClient.java
+++ b/src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/client/PrintPaymentNoticeClient.java
@@ -3,6 +3,7 @@
 import it.gov.pagopa.payhub.activities.connector.pagopapayments.config.PagoPaPaymentsApisHolder;
 import it.gov.pagopa.pu.pagopapayments.dto.generated.GeneratedNoticeMassiveFolderDTO;
 import it.gov.pagopa.pu.pagopapayments.dto.generated.NoticeRequestMassiveDTO;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
@@ -18,4 +19,8 @@ public PrintPaymentNoticeClient(PagoPaPaymentsApisHolder pagoPaPaymentsApisHolde
 	public GeneratedNoticeMassiveFolderDTO generateMassive(NoticeRequestMassiveDTO noticeRequestMassiveDTO, String accessToken) {
 		return pagoPaPaymentsApisHolder.getPrintPaymentNoticeApi(accessToken).generateMassive(noticeRequestMassiveDTO);
 	}
+
+	public SignedUrlResultDTO getSignedUrl(Long organizationId, String pdfGeneratedId, String accessToken) {
+		return pagoPaPaymentsApisHolder.getPrintPaymentNoticeApi(accessToken).getSignedUrl(organizationId, pdfGeneratedId);
+	}
 }
diff --git a/src/test/java/it/gov/pagopa/payhub/activities/activity/pagopapayments/MassiveNoticeGenerationStatusRetrieverActivityImplTest.java b/src/test/java/it/gov/pagopa/payhub/activities/activity/pagopapayments/MassiveNoticeGenerationStatusRetrieverActivityImplTest.java
new file mode 100644
index 000000000..3146284d3
--- /dev/null
+++ b/src/test/java/it/gov/pagopa/payhub/activities/activity/pagopapayments/MassiveNoticeGenerationStatusRetrieverActivityImplTest.java
@@ -0,0 +1,51 @@
+package it.gov.pagopa.payhub.activities.activity.pagopapayments;
+
+import it.gov.pagopa.payhub.activities.activity.ingestionflow.debtposition.MassiveNoticeGenerationStatusRetrieverActivity;
+import it.gov.pagopa.payhub.activities.activity.ingestionflow.debtposition.MassiveNoticeGenerationStatusRetrieverActivityImpl;
+import it.gov.pagopa.payhub.activities.connector.pagopapayments.PrintPaymentNoticeService;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+
+@ExtendWith(MockitoExtension.class)
+class MassiveNoticeGenerationStatusRetrieverActivityImplTest {
+    @Mock
+    private PrintPaymentNoticeService printPaymentNoticeServiceMock;
+
+    private MassiveNoticeGenerationStatusRetrieverActivity activity;
+
+    @BeforeEach
+    void setUp() {
+        activity = new MassiveNoticeGenerationStatusRetrieverActivityImpl(printPaymentNoticeServiceMock);
+    }
+
+    @AfterEach
+    void tearDown() {
+        verifyNoMoreInteractions(printPaymentNoticeServiceMock);
+    }
+
+    @Test
+    void givenValidOrgIdAndFolderIdWhenRetrieveNoticesGenerationStatusThenOk() {
+        //given
+        Long orgId = 1L;
+        String pdfGeneratedId = "pdfGeneratedId";
+        SignedUrlResultDTO signedUrlResultDTO = new SignedUrlResultDTO();
+        signedUrlResultDTO.setSignedUrl("signedUrl");
+
+        Mockito.when(printPaymentNoticeServiceMock.getSignedUrl(orgId, pdfGeneratedId)).thenReturn(signedUrlResultDTO);
+
+        //when
+        SignedUrlResultDTO result = activity.retrieveNoticesGenerationStatus(orgId, pdfGeneratedId);
+
+        //then
+        assertEquals(result, signedUrlResultDTO);
+    }
+}
diff --git a/src/test/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeServiceTest.java b/src/test/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeServiceTest.java
index e1361f1f6..1c71170ad 100644
--- a/src/test/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeServiceTest.java
+++ b/src/test/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeServiceTest.java
@@ -4,6 +4,7 @@
 import it.gov.pagopa.payhub.activities.connector.pagopapayments.client.PrintPaymentNoticeClient;
 import it.gov.pagopa.pu.pagopapayments.dto.generated.GeneratedNoticeMassiveFolderDTO;
 import it.gov.pagopa.pu.pagopapayments.dto.generated.NoticeRequestMassiveDTO;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -55,4 +56,22 @@ void whenGenerateMassiveThenInvokeClient() {
         // Then
         assertEquals(response, result);
     }
+
+    @Test
+    void whenGetSignedUrlThenInvokeClient() {
+        // Given
+        String accessToken = "accessToken";
+        Long orgId = 1L;
+        String pdfGeneratedId = "pdfGeneratedId";
+        SignedUrlResultDTO response = podamFactory.manufacturePojo(SignedUrlResultDTO.class);
+
+        when(authnServiceMock.getAccessToken()).thenReturn(accessToken);
+        when(printPaymentNoticeClientMock.getSignedUrl(orgId, pdfGeneratedId, accessToken)).thenReturn(response);
+
+        // When
+        SignedUrlResultDTO result = service.getSignedUrl(orgId, pdfGeneratedId);
+
+        // Then
+        assertEquals(response, result);
+    }
 }
\ No newline at end of file
diff --git a/src/test/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/client/PrintPaymentsNoticeClientTest.java b/src/test/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/client/PrintPaymentsNoticeClientTest.java
index deb692037..23d2eebad 100644
--- a/src/test/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/client/PrintPaymentsNoticeClientTest.java
+++ b/src/test/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/client/PrintPaymentsNoticeClientTest.java
@@ -54,4 +54,22 @@ void whenGenerateMassiveThenInvokeWithAccessToken() {
         Mockito.verify(printPaymentNoticeApiMock)
                 .generateMassive(request);
     }
+
+    @Test
+    void whenGetSignedUrlThenInvokeWithAccessToken() {
+        // Given
+        String accessToken = "ACCESSTOKEN";
+        Long orgId = 1L;
+        String pdfGeneratedId = "pdfGeneratedId";
+
+        Mockito.when(pagoPaPaymentsApisHolderMock.getPrintPaymentNoticeApi(accessToken))
+                .thenReturn(printPaymentNoticeApiMock);
+
+        // When
+        printPaymentNoticeClient.getSignedUrl(orgId, pdfGeneratedId, accessToken);
+
+        // Then
+        Mockito.verify(printPaymentNoticeApiMock)
+                .getSignedUrl(orgId, pdfGeneratedId);
+    }
 }
diff --git a/src/test/java/it/gov/pagopa/payhub/activities/connector/workflowhub/WorkflowHubServiceTest.java b/src/test/java/it/gov/pagopa/payhub/activities/connector/workflowhub/WorkflowHubServiceTest.java
index 7df8eb420..3c9767940 100644
--- a/src/test/java/it/gov/pagopa/payhub/activities/connector/workflowhub/WorkflowHubServiceTest.java
+++ b/src/test/java/it/gov/pagopa/payhub/activities/connector/workflowhub/WorkflowHubServiceTest.java
@@ -1,5 +1,6 @@
 package it.gov.pagopa.payhub.activities.connector.workflowhub;
 
+import io.temporal.api.enums.v1.WorkflowExecutionStatus;
 import it.gov.pagopa.payhub.activities.connector.auth.AuthnService;
 import it.gov.pagopa.payhub.activities.connector.workflowhub.client.WorkflowHubClient;
 import it.gov.pagopa.pu.workflowhub.dto.generated.WorkflowStatusDTO;
@@ -11,6 +12,8 @@
 import org.mockito.Mockito;
 import org.mockito.junit.jupiter.MockitoExtension;
 
+import java.time.OffsetDateTime;
+
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
 @ExtendWith(MockitoExtension.class)
@@ -36,19 +39,29 @@ void verifyNoMoreInteractions() {
     }
 
     @Test
-    void givenGetWorkflowStatusThenOk(){
+    void givenGetWorkflowStatusThenOk() {
         String token = "token";
         String workflowId = "workflowId";
-        String status = "status";
+        WorkflowStatusDTO wfStatus = WorkflowStatusDTO.builder()
+                .workflowId(workflowId)
+                .workflowType("WFTYPE")
+                .runId("RUNID")
+                .taskQueue("TASKQUEUE")
+                .startDateTime(OffsetDateTime.now())
+                .executionDateTime(OffsetDateTime.now().plusMinutes(1))
+                .endDateTime(OffsetDateTime.now().plusDays(1))
+                .duration("PT0S")
+                .status(WorkflowExecutionStatus.WORKFLOW_EXECUTION_STATUS_COMPLETED.name())
+                .build();
 
         Mockito.when(authnServiceMock.getAccessToken()).thenReturn(token);
 
         Mockito.when(debtPositionClientMock.getWorkflowStatus(token, workflowId))
-                .thenReturn(new WorkflowStatusDTO(workflowId, status));
+                .thenReturn(wfStatus);
 
         WorkflowStatusDTO workflowStatusDTO = service.getWorkflowStatus(workflowId);
 
         assertEquals(workflowId, workflowStatusDTO.getWorkflowId());
-        assertEquals(status, workflowStatusDTO.getStatus());
+        assertEquals(wfStatus.getStatus(), workflowStatusDTO.getStatus());
     }
 }
diff --git a/version b/version
index 938d55c54..f756da328 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-1.109.0
+1.109.0-SNAPSHOT


Reviews:
user: login: antonioT90
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T13:13:58Z
user: login: antonioT90
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T13:41:36Z
user: login: antonioT90
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T14:07:30Z

Review comments:
diff_hunk: @@ -0,0 +1,22 @@
+package it.gov.pagopa.payhub.activities.activity.pagopapayments;
path: src/main/java/it/gov/pagopa/payhub/activities/activity/pagopapayments/FolderStatusActivity.java
user: login: antonioT90
body: ```suggestion
package it.gov.pagopa.payhub.activities.activity.ingestionflow.debtposition;
```
created_at: 2025-05-19T13:10:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,22 @@
+package it.gov.pagopa.payhub.activities.activity.pagopapayments;
+
+import io.temporal.activity.ActivityInterface;
+import io.temporal.activity.ActivityMethod;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
+
+@ActivityInterface
+public interface FolderStatusActivity {
path: src/main/java/it/gov/pagopa/payhub/activities/activity/pagopapayments/FolderStatusActivity.java
user: login: antonioT90
body: ```suggestion
public interface MassiveNoticeGenerationStatusRetrieverActivity {
```
created_at: 2025-05-19T13:11:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,22 @@
+package it.gov.pagopa.payhub.activities.activity.pagopapayments;
+
+import io.temporal.activity.ActivityInterface;
+import io.temporal.activity.ActivityMethod;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
+
+@ActivityInterface
+public interface FolderStatusActivity {
+    /**
+     * Retrieves the status of the specified folderId.
+     * Returns a SignedUrlResultDTO which includes:
+     * - a signedUrl
+     * - two lists: one of processed items and another of notices in error
+     * If the status is not complete, returns a 204 no content.
+     *
+     * @param organizationId the ID of the organization
+     * @param folderId the id of the folder
+     */
+    @ActivityMethod
+    SignedUrlResultDTO retrieveFolderStatus(Long organizationId, String folderId);
path: src/main/java/it/gov/pagopa/payhub/activities/activity/pagopapayments/FolderStatusActivity.java
user: login: antonioT90
body: ```suggestion
    SignedUrlResultDTO retrieveNoticesGenerationStatus(Long organizationId, String pdfGeneratedId);
```
created_at: 2025-05-19T13:11:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,22 @@
+package it.gov.pagopa.payhub.activities.activity.pagopapayments;
+
+import io.temporal.activity.ActivityInterface;
+import io.temporal.activity.ActivityMethod;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
+
+@ActivityInterface
+public interface FolderStatusActivity {
+    /**
+     * Retrieves the status of the specified folderId.
path: src/main/java/it/gov/pagopa/payhub/activities/activity/pagopapayments/FolderStatusActivity.java
user: login: antonioT90
body: ```suggestion
     * Retrieves the status of the specified pdfGeneratedId.
```
created_at: 2025-05-19T13:12:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -15,4 +16,13 @@ public interface PrintPaymentNoticeService {
 	 * @return folderId
 	 */
 	GeneratedNoticeMassiveFolderDTO generateMassive(NoticeRequestMassiveDTO noticeRequestMassiveDTO);
+
+	/**
+	 * Return SignedUrlResultDTO with signedUrl if folder status is ready and two lists containing all notices processed or in error
+	 *
+	 * @param organizationId the ID of the organization
+	 * @param folderId retrieved from generateMassive
+	 * @return SignedUrlResultDTO
+	 */
+	SignedUrlResultDTO getSignedUrl(Long organizationId, String folderId);
path: src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeService.java
user: login: antonioT90
body: ```suggestion
	SignedUrlResultDTO getSignedUrl(Long organizationId, String pdfGeneratedId);
```
created_at: 2025-05-19T13:12:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -25,4 +26,10 @@ public GeneratedNoticeMassiveFolderDTO generateMassive(NoticeRequestMassiveDTO n
 		log.info("Generate massive notices for requestId: {}", noticeRequestMassiveDTO.getRequestId());
 		return printPaymentNoticeClient.generateMassive(noticeRequestMassiveDTO, authnService.getAccessToken());
 	}
+
+	@Override
+	public SignedUrlResultDTO getSignedUrl(Long organizationId, String folderId) {
+		log.info("Get signed url for organizationId: {} and folderId: {}", organizationId, folderId);
+		return printPaymentNoticeClient.getSignedUrl(organizationId, folderId, authnService.getAccessToken());
path: src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeServiceImpl.java
user: login: antonioT90
body: ```suggestion
	public SignedUrlResultDTO getSignedUrl(Long organizationId, String pdfGeneratedId) {
		log.info("Get signed url for organizationId: {} and pdfGeneratedId: {}", organizationId, pdfGeneratedId);
		return printPaymentNoticeClient.getSignedUrl(organizationId, pdfGeneratedId, authnService.getAccessToken());
```
created_at: 2025-05-19T13:13:38Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,4 +19,8 @@ public PrintPaymentNoticeClient(PagoPaPaymentsApisHolder pagoPaPaymentsApisHolde
 	public GeneratedNoticeMassiveFolderDTO generateMassive(NoticeRequestMassiveDTO noticeRequestMassiveDTO, String accessToken) {
 		return pagoPaPaymentsApisHolder.getPrintPaymentNoticeApi(accessToken).generateMassive(noticeRequestMassiveDTO);
 	}
+
+	public SignedUrlResultDTO getSignedUrl(Long organizationId, String folderId, String accessToken) {
+		return pagoPaPaymentsApisHolder.getPrintPaymentNoticeApi(accessToken).getSignedUrl(organizationId, folderId);
path: src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/client/PrintPaymentNoticeClient.java
user: login: antonioT90
body: ```suggestion
	public SignedUrlResultDTO getSignedUrl(Long organizationId, String pdfGeneratedId, String accessToken) {
		return pagoPaPaymentsApisHolder.getPrintPaymentNoticeApi(accessToken).getSignedUrl(organizationId, pdfGeneratedId);
```
created_at: 2025-05-19T13:13:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,22 @@
+package it.gov.pagopa.payhub.activities.activity.ingestionflow.debtposition;
+
+import io.temporal.activity.ActivityInterface;
+import io.temporal.activity.ActivityMethod;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
+
+@ActivityInterface
+public interface MassiveNoticeGenerationStatusRetrieverActivity {
+    /**
+     * Retrieves the status of the specified pdfGeneratedId.
+     * Returns a SignedUrlResultDTO which includes:
+     * - a signedUrl
+     * - two lists: one of processed items and another of notices in error
+     * If the status is not complete, returns a 204 no content.
+     *
+     * @param organizationId the ID of the organization
+     * @param pdfGeneratedId the id of the folder
path: src/main/java/it/gov/pagopa/payhub/activities/activity/ingestionflow/debtposition/MassiveNoticeGenerationStatusRetrieverActivity.java
user: login: antonioT90
body: ```suggestion
     * @param pdfGeneratedId the id of the generation request
```
created_at: 2025-05-19T13:40:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,23 @@
+package it.gov.pagopa.payhub.activities.activity.ingestionflow.debtposition;
+
+import it.gov.pagopa.payhub.activities.connector.pagopapayments.PrintPaymentNoticeService;
+import it.gov.pagopa.pu.pagopapayments.dto.generated.SignedUrlResultDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+@Lazy
+@Slf4j
+@Service
+public class MassiveNoticeGenerationStatusRetrieverActivityImpl implements MassiveNoticeGenerationStatusRetrieverActivity {
+    private final PrintPaymentNoticeService printPaymentNoticeService;
+
+    public MassiveNoticeGenerationStatusRetrieverActivityImpl(PrintPaymentNoticeService printPaymentNoticeService) {
+        this.printPaymentNoticeService = printPaymentNoticeService;
+    }
+
+    @Override
+    public SignedUrlResultDTO retrieveNoticesGenerationStatus(Long organizationId, String folderId) {
+        return printPaymentNoticeService.getSignedUrl(organizationId, folderId);
path: src/main/java/it/gov/pagopa/payhub/activities/activity/ingestionflow/debtposition/MassiveNoticeGenerationStatusRetrieverActivityImpl.java
user: login: antonioT90
body: ```suggestion
    public SignedUrlResultDTO retrieveNoticesGenerationStatus(Long organizationId, String pdfGeneratedId) {
        return printPaymentNoticeService.getSignedUrl(organizationId, pdfGeneratedId);
```
created_at: 2025-05-19T13:40:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -15,4 +16,13 @@ public interface PrintPaymentNoticeService {
 	 * @return folderId
 	 */
 	GeneratedNoticeMassiveFolderDTO generateMassive(NoticeRequestMassiveDTO noticeRequestMassiveDTO);
+
+	/**
+	 * Return SignedUrlResultDTO with signedUrl if folder status is ready and two lists containing all notices processed or in error
path: src/main/java/it/gov/pagopa/payhub/activities/connector/pagopapayments/PrintPaymentNoticeService.java
user: login: antonioT90
body: ```suggestion
	/**
	 * Return SignedUrlResultDTO with signedUrl if generation request status is ready and two lists containing all notices processed or in error
```
created_at: 2025-05-19T13:41:21Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-05-19T14:05:10Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=pagopa_p4pa-payhub-activities&pullRequest=277) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=pagopa_p4pa-payhub-activities&pullRequest=277&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=pagopa_p4pa-payhub-activities&pullRequest=277&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=pagopa_p4pa-payhub-activities&pullRequest=277&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=pagopa_p4pa-payhub-activities&pullRequest=277&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=pagopa_p4pa-payhub-activities&pullRequest=277&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=pagopa_p4pa-payhub-activities&pullRequest=277)


author_association: NONE
user: login: github-actions[bot]
created_at: 2025-05-19T14:12:12Z
body: :tada: This PR is included in version 1.110.0 :tada:

The release is available on [GitHub release](https://github.com/pagopa/p4pa-payhub-activities/releases/tag/v1.110.0)

Your **[semantic-release](https://github.com/semantic-release/semantic-release)** bot :package::rocket:
author_association: CONTRIBUTOR