示例#1
0
  /**
   * Save Product into the application for the merchant.
   *
   * @param request product details
   * @param productId product Id of the product to delete.
   * @return Status of the operation.
   */
  @SuppressWarnings("unchecked")
  public ProductDetailsResponseDTO deleteProduct(
      String merchantId, String productId, String businessCategory) {
    ProductDetailsResponseDTO response = new ProductDetailsResponseDTO();
    boolean result = true;

    result = deleteProduct(productId);
    if (result == true) {
      logger.info("Product Deleted with ID: " + productId);
    }
    response.setMerchantId(merchantId);
    return response;
  }
示例#2
0
  /**
   * Save Product into the application for the merchant.
   *
   * @param request product details
   * @param productId product Id from {@link
   *     MerchantProduct#create(ProductCreateAndRegisterRequestDTO)}
   * @return Status of the operation.
   */
  public ProductDetailsResponseDTO addProductDetails(
      String merchantId, String businessCategory, ProductDetailsRequestDTO request) {
    ProductDetailsResponseDTO response = new ProductDetailsResponseDTO();

    Product product = registerProduct(merchantId, businessCategory);

    if (FASHION_BUSINESS_CATEGORY.equals(businessCategory)) {
      persistFashionProduct(product, request);
    } else if (GROCERY_BUSINESS_CATEGORY.equals(businessCategory)) {
      persistGroceryProduct(product, request);
    } else if (RESTAURANT_BUSINESS_CATEGORY.equals(businessCategory)) {
      persistRestaurantProduct(product, request);
    }

    response.setMerchantId(merchantId);
    return response;
  }