Package com.masai.Dao

Interface SellerDao

All Known Implementing Classes:
SellerDaoImpl

public interface SellerDao
  • Method Details

    • loginSeller

      Seller loginSeller(String username, String password)
      Validates the seller's login credentials.
      Parameters:
      username - The username of the seller.
      password - The password of the seller.
      Returns:
      The authenticated seller object.
    • getSellerIncome

      double getSellerIncome(String username)
      Retrieves the income earned by the seller username.
      Parameters:
      username - The username of the seller.
      Returns:
      The total income of the seller.
    • refundToBuyer

      double refundToBuyer(int productId, int quantity)
      Initiates a refund to the buyer for a specific product and quantity.
      Parameters:
      productId - The ID of the product to be refunded.
      quantity - The quantity of the product to be refunded.
      Returns:
      The refund amount.
    • getSellerByUsername

      Seller getSellerByUsername(String username)
      Retrieves the seller details based on the username.
      Parameters:
      username - The username of the seller.
      Returns:
      The seller object.
    • updateSellerDetails

      String updateSellerDetails(Seller u)
      Updates the details of a seller.
      Parameters:
      seller - The updated seller object.
      Returns:
      The updated seller details as a string.
    • registerNewSeller

      String registerNewSeller(Seller s)
      Registers a new seller.
      Parameters:
      seller - The seller object to register.
      Returns:
      A success message upon successful registration.
    • getAllSellerProducts

      ResultSet getAllSellerProducts(String username)
      Retrieves all products of a seller.
      Parameters:
      username - The username of the seller.
      Returns:
      A ResultSet containing all the products of the seller.
    • getAllSellerProductsOrderByQuantity

      ResultSet getAllSellerProductsOrderByQuantity(String username)
      Retrieves all seller products ordered by quantity.
      Parameters:
      username - The username of the seller.
      Returns:
      A ResultSet containing the products.
    • unhideSellerProducts

      boolean unhideSellerProducts(String username)
      Unhides the products of a seller.
      Parameters:
      username - The username of the seller.
      Returns:
      true if the products were successfully unhidden, false otherwise.
    • hideSellerProducts

      boolean hideSellerProducts(String username)
      Hides the products of a seller.
      Parameters:
      username - The username of the seller.
      Returns:
      true if the products were successfully hidden, false otherwise.
    • getSellerAllProductsByCategory

      ResultSet getSellerAllProductsByCategory(String item, String username)
      Retrieves all products of a seller belonging to a specific category.
      Parameters:
      item - The category of the products.
      username - The username of the seller.
      Returns:
      A ResultSet containing the products.
    • amountWithrowBySeller

      boolean amountWithrowBySeller(double amount, String unsername)
      Withdraws a specified amount from the seller's account balance.
      Parameters:
      amount - The amount to withdraw.
      username - The username of the seller.
      Returns:
      true if the withdrawal was successful, false otherwise.
    • deleteSeller

      boolean deleteSeller(String username, String password)
      Deletes a seller based on their username and password.
      Parameters:
      username - The username of the seller.
      password - The password of the seller.
      Returns:
      true if the seller was successfully deleted, false otherwise.
    • reopenSeller

      boolean reopenSeller(String username, String password)
      Reopens the seller's account after it was closed.
      Parameters:
      username - The username of the seller.
      password - The password of the seller.
      Returns:
      true if the seller's account was successfully reopened, false otherwise.
    • getSellerPendingAmount

      double getSellerPendingAmount(String username)
      Adds a new pending amount to be paid to the seller.
      Parameters:
      username - The username of the seller.
      newPaidAmount - The new pending amount to be paid.
      Returns:
      true if the pending amount was successfully added, false otherwise.
    • addSellerPendingAmount

      boolean addSellerPendingAmount(String username, double newPaidAmount)
      Adds a new pending amount to be paid to the seller.
      Parameters:
      username - The username of the seller.
      newPaidAmount - The new pending amount to be paid.
      Returns:
      true if the pending amount was successfully added, false otherwise.
    • getSellerProductsID

      List<Integer> getSellerProductsID(String username)
      Retrieves the IDs of all products belonging to a seller.
      Parameters:
      username - The username of the seller.
      Returns:
      A list of product IDs.
    • getAllSellerProductsOrderByPrice

      ResultSet getAllSellerProductsOrderByPrice(String username)
      Retrieves all seller products ordered by price.
      Parameters:
      username - The username of the seller.
      Returns:
      A ResultSet containing the products.
    • sellerPaidPendingAmount

      boolean sellerPaidPendingAmount(double pendingAamount, String username, double income)
      Marks a pending amount as paid to the seller.
      Parameters:
      pendingAmount - The pending amount to be paid.
      username - The username of the seller.
      income - The income earned by the
      Returns:
      true if the pending amount was successfully marked as paid, false otherwise.