Skip to content

Commit

Permalink
feat: P4ADEV-1421-fdr-create-temporal-activity (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomatteuccieng authored Nov 22, 2024
2 parents f644902 + 87c697e commit 4a559f5
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package it.gov.pagopa.payhub.activities.activity.fdr;
import it.gov.pagopa.payhub.activities.dto.fdr.FdRIngestionActivityResult;

/**
* Interface for the FdRIngestionActivity.
* Defines methods for processing files based on an IngestionFlow ID.
*/
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 FdRIngestionActivityResult} containing the list of IUFs and status.
*/
FdRIngestionActivityResult processFile(String ingestionFlowId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package it.gov.pagopa.payhub.activities.activity.fdr;

/**
* Interface for SendEmailIngestionFlowActivity.
* Sends an email based on the status of a processed file identified by its IngestionFlow ID.
*/
public interface SendEmailIngestionFlowActivity {

/**
* Sends an email based on the process result of the given file ingestionFlow ID.
*
* @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.
*/
boolean sendEmail(String ingestionFlowId, boolean success);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package it.gov.pagopa.payhub.activities.activity.fdr;

/**
* Interface for the UpdateIngestionFlowStatusActivity.
* Updates the status of a IngestionFlow record identified by the provided ID.
*/
public interface UpdateIngestionFlowStatusActivity {

/**
* Updates the status of the IngestionFlow record corresponding to the given ID.
*
* @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.
*/
boolean updateStatus(String id, String newStatus);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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 FdRIngestionActivityResult {
/** List of extracted IUFs */
private List<String> iufs;
/** Success flag for the operation */
private boolean success;
}

0 comments on commit 4a559f5

Please sign in to comment.