Class ProductService

java.lang.Object
com.mt.ecommerce.product.service.ProductService

@Service public class ProductService extends Object
Service class for managing products. Provides methods for adding, updating, deleting, and retrieving products.
  • Constructor Details

  • Method Details

    • updateProduct

      public void updateProduct(ProductBO productBO, String userName)
      Updates an existing product.
      Parameters:
      productBO - the product information to update
      userName - the username of the user updating the product
    • saveProduct

      public ProductBO saveProduct(ProductBO productBO, String userName)
      Saves a new product.
      Parameters:
      productBO - the product information to save
      userName - the username of the user saving the product
      Returns:
      the saved ProductBO with generated ID
    • deleteProduct

      public void deleteProduct(UUID productId)
      Deletes a product by its ID.
      Parameters:
      productId - the ID of the product to delete
    • getProduct

      public List<ProductBO> getProduct(UUID vendorId, int pageNo, int size)
      Retrieves products for a specific vendor with pagination.
      Parameters:
      vendorId - the ID of the vendor whose products are to be retrieved
      pageNo - the page number for pagination
      size - the number of records per page
      Returns:
      a list of ProductBO objects representing the vendor's products
    • getProduct

      public List<ProductBO> getProduct(UUID vendorId, UUID categoryId, int pageNo, int size)
      Retrieves products for a specific vendor and category with pagination.
      Parameters:
      vendorId - the ID of the vendor whose products are to be retrieved
      categoryId - the ID of the category to filter products
      pageNo - the page number for pagination
      size - the number of records per page
      Returns:
      a list of ProductBO objects representing the vendor's products in the specified category