Class PromotionServiceProxy

java.lang.Object
org.bhn.promotion.core.proxy.PromotionServiceProxy

@Component public class PromotionServiceProxy extends Object
Proxy class for interacting with the Promotion Service API.

This class provides methods to create, update, and manage promo budgets by making HTTP requests to an external API using WebClient.

  • Constructor Details

    • PromotionServiceProxy

      public PromotionServiceProxy()
  • Method Details

    • saveOrder

      public void saveOrder(OrderDTO orderDTO, String source)
    • saveRollback

      public void saveRollback(RollbackDTO rollbackDTO, String source)
      Saves a RollbackDTO object by sending an HTTP POST request to the Promotion service.
      Parameters:
      rollbackDTO - The RollbackDTO object containing the rollback data to be saved in OrderEntity.
    • getAndorProductsByUpcs

      public AndorCommerceProductResponse getAndorProductsByUpcs(List<String> upcs, String source)
      Retrieves product details by a list of UPCs using a REST API call.
      Parameters:
      upcs - the list of UPCs to retrieve product details for
      Returns:
      AndorCommerceProductResponse containing the product details, or null if an error occurs
    • getTenantById

      public TenantDTO getTenantById(String tenantId)
      Retrieves a tenant by its ID from the promotion service.
      Parameters:
      tenantId - The ID of the tenant to retrieve.
      Returns:
      TenantDTO containing the tenant details, or null if not found.
    • getPromotionBudgetInfo

      public List<PromotionBudgetDTO> getPromotionBudgetInfo(List<String> promoCodes, String source)
    • getTenantByName

      public TenantDTO getTenantByName(String tenantName)
      Retrieves a tenant by its ID from the promotion service.
      Parameters:
      tenantName - The ID of the tenant to retrieve.
      Returns:
      TenantDTO containing the tenant details, or null if not found.