示例#1
0
 public EndorsedProductResponseDTO getEndorsedBusiness(String merchantId) {
   MerchantBusinessViewEntity merchantBusinessViewEntity = getMerchantBusinessDetails(merchantId);
   EndorsedProductResponseDTO response = new EndorsedProductResponseDTO();
   if (merchantBusinessViewEntity != null) {
     response.setBusinessCategory(merchantBusinessViewEntity.getBusinessCategory());
   }
   response.setMerchantID(merchantId);
   return response;
 }
示例#2
0
  /**
   * Get Product details.
   *
   * @param response
   * @param productId product Id of the product to fetch details.
   * @param merchantId merchantId of the product to fetch details.
   * @return Product details for the provided ProductId
   */
  public ProductSpecificDetailsResponseDTO readProductDetails(
      String merchantId, String productId, ProductSpecificDetailsResponseDTO response) {
    MerchantBusinessViewEntity merchantBusinessViewEntity = getMerchantBusinessDetails(merchantId);

    if (FASHION_BUSINESS_CATEGORY.equals(merchantBusinessViewEntity.getBusinessCategory())) {
      response = getFashionProduct(merchantId, productId, response);
    } else if (GROCERY_BUSINESS_CATEGORY.equals(merchantBusinessViewEntity.getBusinessCategory())) {
      response = getGroceryProduct(merchantId, productId, response);
    } else if (RESTAURANT_BUSINESS_CATEGORY.equals(
        merchantBusinessViewEntity.getBusinessCategory())) {
      response = getRestaurantProduct(merchantId, productId, response);
    }

    return response;
  }
示例#3
0
  /**
   * Read all products for the provided merchantId.
   *
   * @param merchantId
   * @return List of all products.
   */
  @SuppressWarnings("unchecked")
  public MerchantProductListingResponseDTO readAllProductsForMerchant(String merchantId) {

    MerchantProductListingResponseDTO response = new MerchantProductListingResponseDTO();
    MerchantBusinessViewEntity merchantBusinessViewEntity = getMerchantBusinessDetails(merchantId);

    if (FASHION_BUSINESS_CATEGORY.equals(merchantBusinessViewEntity.getBusinessCategory())) {

      response =
          getAllFashionProduct(
              merchantId, merchantBusinessViewEntity.getBusinessCategory(), response);
    } else if (GROCERY_BUSINESS_CATEGORY.equals(merchantBusinessViewEntity.getBusinessCategory())) {
      response =
          getAllGroceryProduct(
              merchantId, merchantBusinessViewEntity.getBusinessCategory(), response);
    } else if (RESTAURANT_BUSINESS_CATEGORY.equals(
        merchantBusinessViewEntity.getBusinessCategory())) {
      response =
          getAllRestaurantProduct(
              merchantId, merchantBusinessViewEntity.getBusinessCategory(), response);
    }

    return response;
  }