Class VoucherifyConfiguration
java.lang.Object
org.bhn.promotion.voucherify.config.VoucherifyConfiguration
@Configuration
@ConditionalOnProperty(name="promo-engine.service.type",
havingValue="VOUCHERIFY",
matchIfMissing=true)
public class VoucherifyConfiguration
extends Object
The class contains Voucherify configuration.
-
Constructor Summary
ConstructorsConstructorDescriptionVoucherifyConfiguration(String appId, String secretKey, String endpoint, boolean voucherifyApiEnabled, int maxRetries, long retryThresholdMilliSeconds, int eligiblePromoLimit, String eligiblePromoSortingType, boolean isStackablePromos, List<String> voucherFields, String promoReportNewFields, List<String> voucherifyOrderFields, String promoOrderFields, String voucherifyDownloadBaseUrl, Integer webClientMaxMemorySize, String voucherifyDownloadUrl, long sleepMilliSecond, String encryptionApiKey, Integer bulkVoucherLimit, String promotionServiceBaseUrl, String shippingFeePromotionProduct, String iamBaseTokenUrl, String clientId, String clientSecret, String iamServiceAuthTokenUrl, String newUserGraphQLUrl, String bulkAffiliateCategoryId, String managementId, String managementToken, String projectId) Constructor to initialize configuration properties for Voucherify. -
Method Summary
Modifier and TypeMethodDescriptionio.voucherify.client.ApiClientProvides a configured ApiClient instance for interacting with the Voucherify API.io.voucherify.client.api.CampaignsApiCreates a CampaignsApi instance for managing campaigns in Voucherify.io.voucherify.client.api.ExportsApiCreates a bean for the ExportsApi.Creates a primary InputAdapter bean for handling input to the pricing service.io.voucherify.client.api.ManagementApiCreates and returns aNewUserGraphQLProxybean, configured with the GraphQL URL,RestTemplate, andTokenGeneratorfor making authenticated GraphQL requests.Creates a primary OutputAdapter bean for handling output from the pricing service.io.voucherify.client.api.ProductCollectionsApiCreates a ProductCollectionsApi instance for managing productCollections in Voucherify.io.voucherify.client.api.ProductsApiCreates a ProductsApi instance for managing products in Voucherify.Creates a primary PromotionEngine bean for managing promotions in Voucherify.Creates a primary bean for the PromotionExportService.Creates a primary PromotionOperation bean for executing promotion-related operations.Creates a primary PromotionProductService bean using VoucherifyClient.io.voucherify.client.api.PromotionsApiCreates a PromotionsApi instance for managing promotions in Voucherify.Creates aPromotionServiceProxybean that acts as a proxy for interacting with the Promotion Service.io.voucherify.client.api.QualificationsApiCreates a QualificationsApi instance for managing qualifications in Voucherify.io.voucherify.client.api.RedemptionsApiCreates a RedemptionsApi instance for managing redemptions in Voucherify.io.voucherify.client.api.ValidationRulesApiCreates a ValidationRulesApi instance for managing validation rules in Voucherify.io.voucherify.client.api.ValidationsApiCreates a ValidationsApi instance for managing validations in Voucherify.Creates a VoucherifyClient instance configured with necessary API clients.Creates a bean for the VoucherifyProxy.Creates a QualificationEngine for managing qualification processes in Voucherify.Creates a RedemptionEngine for managing redemption processes in Voucherify.Creates a RollbackEngine for handling rollback operations in Voucherify.Creates a ValidationEngine for managing validation processes in Voucherify.io.voucherify.client.api.VouchersApiCreates a VouchersApi instance for managing vouchers in Voucherify.
-
Constructor Details
-
VoucherifyConfiguration
public VoucherifyConfiguration(@Value("${promo-engine.service.voucherify.app-id}") String appId, @Value("${promo-engine.service.voucherify.client-secret}") String secretKey, @Value("${promo-engine.service.voucherify.end-point}") String endpoint, @Value("${promo-engine.service.voucherify.api-enabled:false}") boolean voucherifyApiEnabled, @Value("${promo-engine.service.voucherify.max-retries:3}") int maxRetries, @Value("${promo-engine.service.voucherify.retry-threshold-milli-seconds:1000}") long retryThresholdMilliSeconds, @Value("${promo-engine.service.voucherify.eligible-promo-limit:50}") int eligiblePromoLimit, @Value("${promo-engine.service.voucherify.eligible-promo-sorting:BEST_DEAL}") String eligiblePromoSortingType, @Value("${promo-engine.service.voucherify.stackable-promos:false}") boolean isStackablePromos, @Value("${promo-engine.service.voucherify.export.voucher-fields:null}") List<String> voucherFields, @Value("${promo-engine.service.voucherify.export.promo-fields:null}") String promoReportNewFields, @Value("${promo-engine.service.voucherify.export.order-fields:null}") List<String> voucherifyOrderFields, @Value("${promo-engine.service.voucherify.export.promo-order-fields:null}") String promoOrderFields, @Value("${promo-engine.service.voucherify.download.base-url:null}") String voucherifyDownloadBaseUrl, @Value("${promo-engine.service.voucherify.export.webclient.max-memory-size:10}") Integer webClientMaxMemorySize, @Value("${promo-engine.service.voucherify.download.export-url:null}") String voucherifyDownloadUrl, @Value("${promo-engine.service.voucherify.export.sleep-milli-second:100}") long sleepMilliSecond, @Value("${promo-engine.encryption.api-key:null}") String encryptionApiKey, @Value("${promo-engine.service.voucherify.webhook.bulk-voucher-limit:0}") Integer bulkVoucherLimit, @Value("${promo-engine.service.base-url:null}") String promotionServiceBaseUrl, @Value("${promo-engine.service.voucherify.shipping-fee.promotion.product:null}") String shippingFeePromotionProduct, @Value("${promo-engine.iam-service.base-url:null}") String iamBaseTokenUrl, @Value("${promo-engine.iam-service.client-id:null}") String clientId, @Value("${promo-engine.iam-service.client-secret:null}") String clientSecret, @Value("${promo-engine.iam-service.auth-token-url:null}") String iamServiceAuthTokenUrl, @Value("${promo-engine.servicing-graphQl-url:null}") String newUserGraphQLUrl, @Value("${promo-engine.service.voucherify.bulk-affiliate-category-id}") String bulkAffiliateCategoryId, @Value("${promo-engine.service.voucherify.management-id:}") String managementId, @Value("${promo-engine.service.voucherify.management-token:}") String managementToken, @Value("${promo-engine.service.voucherify.project-id:null}") String projectId) Constructor to initialize configuration properties for Voucherify.- Parameters:
appId- the application ID for VoucherifysecretKey- the client secret for Voucherifyendpoint- the endpoint URL for Voucherify APIvoucherifyApiEnabled- flag to enable or disable Voucherify APImaxRetries- the maximum number of retries for API callseligiblePromoLimit- the maximum number of eligible promotionseligiblePromoSortingType- the sorting type for eligible promotionsisStackablePromos- the sorting type for stackable promotionsvoucherFields- the fields to include in voucher export (can benull).promoReportNewFields- the fields for the promotional report (can benull).voucherifyOrderFields- the fields to include in order export (can benull).promoOrderFields- the fields to include in promo-order export (can benull).voucherifyDownloadBaseUrl- the base URL for Voucherify downloads (can benull).webClientMaxMemorySize- the maximum memory size for WebClient in MB (default: 10).voucherifyDownloadUrl- the URL for Voucherify export downloads (can benull).sleepMilliSecond- the sleep time between API calls in milliseconds (default: 100).encryptionApiKey- the API key for encryption services (can benull).bulkVoucherLimit- The limit for bulk voucher processing in webhook operations.shippingFeePromotionProduct- Product is used to manage free shipping product in voucherifypromotionServiceBaseUrl- Promotion Service Base UrlprojectId- the project ID for Voucherify
-
-
Method Details
-
apiClient
@Bean public io.voucherify.client.ApiClient apiClient()Provides a configured ApiClient instance for interacting with the Voucherify API.- Returns:
- the configured ApiClient
-
managementApi
@Bean public io.voucherify.client.api.ManagementApi managementApi() -
promotionsApi
@Bean public io.voucherify.client.api.PromotionsApi promotionsApi()Creates a PromotionsApi instance for managing promotions in Voucherify.- Returns:
- a PromotionsApi instance
-
campaignsApi
@Bean public io.voucherify.client.api.CampaignsApi campaignsApi()Creates a CampaignsApi instance for managing campaigns in Voucherify.- Returns:
- a CampaignsApi instance
-
vouchersApi
@Bean public io.voucherify.client.api.VouchersApi vouchersApi()Creates a VouchersApi instance for managing vouchers in Voucherify.- Returns:
- a VouchersApi instance
-
validationRulesApi
@Bean public io.voucherify.client.api.ValidationRulesApi validationRulesApi()Creates a ValidationRulesApi instance for managing validation rules in Voucherify.- Returns:
- a ValidationRulesApi instance
-
productsApi
@Bean public io.voucherify.client.api.ProductsApi productsApi()Creates a ProductsApi instance for managing products in Voucherify.- Returns:
- a ProductsApi instance
-
productCollectionsApi
@Bean public io.voucherify.client.api.ProductCollectionsApi productCollectionsApi()Creates a ProductCollectionsApi instance for managing productCollections in Voucherify.- Returns:
- a ProductsApi instance
-
validationsApi
@Bean public io.voucherify.client.api.ValidationsApi validationsApi()Creates a ValidationsApi instance for managing validations in Voucherify.- Returns:
- a ValidationsApi instance
-
redemptionsApi
@Bean public io.voucherify.client.api.RedemptionsApi redemptionsApi()Creates a RedemptionsApi instance for managing redemptions in Voucherify.- Returns:
- a RedemptionsApi instance
-
qualificationsApi
@Bean public io.voucherify.client.api.QualificationsApi qualificationsApi()Creates a QualificationsApi instance for managing qualifications in Voucherify.- Returns:
- a QualificationsApi instance
-
exportsApi
@Bean public io.voucherify.client.api.ExportsApi exportsApi()Creates a bean for the ExportsApi.- Returns:
- a new instance of
ExportsApiconfigured with the API client.
-
promotionProductService
Creates a primary PromotionProductService bean using VoucherifyClient.- Returns:
- a PromotionProductService instance
-
voucherifyClient
Creates a VoucherifyClient instance configured with necessary API clients.- Returns:
- a VoucherifyClient instance
-
voucherifyValidationEngine
Creates a ValidationEngine for managing validation processes in Voucherify.- Returns:
- a ValidationEngine instance
-
voucherifyQualificationEngine
Creates a QualificationEngine for managing qualification processes in Voucherify.- Returns:
- a QualificationEngine instance
-
voucherifyRedemptionEngine
Creates a RedemptionEngine for managing redemption processes in Voucherify.- Returns:
- a RedemptionEngine instance
-
voucherifyRollbackEngine
Creates a RollbackEngine for handling rollback operations in Voucherify.- Returns:
- a RollbackEngine instance
-
promotionEngine
Creates a primary PromotionEngine bean for managing promotions in Voucherify.- Returns:
- a PromotionEngine instance
-
promotionOperation
Creates a primary PromotionOperation bean for executing promotion-related operations.- Returns:
- a PromotionOperation instance
-
inputAdapter
Creates a primary InputAdapter bean for handling input to the pricing service.- Returns:
- an InputAdapter instance
-
outputAdapter
Creates a primary OutputAdapter bean for handling output from the pricing service.- Returns:
- an OutputAdapter instance
-
voucherifyCampaignService
-
voucherifyValidationService
-
voucherifyPromotionTierService
-
voucherifyVoucherService
-
promotionExportService
Creates a primary bean for the PromotionExportService.This method initializes the
VoucherifyPromotionExportServicewith the necessary dependencies and sets its properties for voucher fields and report fields.- Returns:
- a configured instance of
PromotionExportService.
-
voucherifyProxy
Creates a bean for the VoucherifyProxy.This method configures the proxy with the download URL and sets up a WebClient with the specified base URL and HTTP headers.
- Returns:
- a configured instance of
VoucherifyProxy.
-
promotionServiceProxy
Creates aPromotionServiceProxybean that acts as a proxy for interacting with the Promotion Service.- Returns:
- A new instance of
PromotionServiceProxy.
-
newUserGraphQL
Creates and returns aNewUserGraphQLProxybean, configured with the GraphQL URL,RestTemplate, andTokenGeneratorfor making authenticated GraphQL requests.- Returns:
- a configured
NewUserGraphQLProxyinstance
-
voucherifyManagementService
-
voucherifyApiClient
-