Class VoucherifyPromotionExportService

java.lang.Object
org.bhn.promotion.voucherify.service.VoucherifyPromotionExportService
All Implemented Interfaces:
PromotionExportService

@Service public class VoucherifyPromotionExportService extends Object implements PromotionExportService
This class implements the PromotionExportService interface and provides methods related to exporting reports using the Voucherify service.

It contains logic for creating exports, retrieving export URLs, and downloading export data.

  • Constructor Details

    • VoucherifyPromotionExportService

      @Autowired public VoucherifyPromotionExportService(VoucherifyClient voucherifyClient, VoucherifyProxy voucherifyProxy)
  • Method Details

    • createExport

      public File createExport(ExportModel exportModel)
      Creates an export based on the provided ExportModel.
      Specified by:
      createExport in interface PromotionExportService
      Parameters:
      exportModel - the export type and sorting parameter name of the ExportModel.
      Returns:
      a File representing the generated export data, or null if an exception occurs. Logs any exceptions that occur during the process.
    • getExport

      public String getExport(String exportId)
      Retrieves the URL for downloading the export associated with the given export ID.
      Specified by:
      getExport in interface PromotionExportService
      Parameters:
      exportId - the ID of the export for which to fetch the report.
      Returns:
      a String representing the URL for downloading the export, or null if an exception occurs. Logs any exceptions that occur during the retrieval process.
    • downloadExport

      public File downloadExport(String exportType, String exportId, String token)
      Downloads the export data based on the provided export type, export ID, and authorization token.
      Specified by:
      downloadExport in interface PromotionExportService
      Parameters:
      exportType - the type of export to download.
      exportId - the ID of the export to download.
      token - the authorization token required for downloading the export.
      Returns:
      a File representing the CSV data based on the specified parameters, or null if an exception occurs. Logs any exceptions that occur during the download process.