Package com.masai.Dao
Interface SellerDao
- All Known Implementing Classes:
SellerDaoImpl
public interface SellerDao
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addSellerPendingAmount
(String username, double newPaidAmount) Adds a new pending amount to be paid to the seller.boolean
amountWithrowBySeller
(double amount, String unsername) Withdraws a specified amount from the seller's account balance.boolean
deleteSeller
(String username, String password) Deletes a seller based on their username and password.getAllSellerProducts
(String username) Retrieves all products of a seller.getAllSellerProductsOrderByPrice
(String username) Retrieves all seller products ordered by price.getAllSellerProductsOrderByQuantity
(String username) Retrieves all seller products ordered by quantity.getSellerAllProductsByCategory
(String item, String username) Retrieves all products of a seller belonging to a specific category.getSellerByUsername
(String username) Retrieves the seller details based on the username.double
getSellerIncome
(String username) Retrieves the income earned by the seller username.double
getSellerPendingAmount
(String username) Adds a new pending amount to be paid to the seller.getSellerProductsID
(String username) Retrieves the IDs of all products belonging to a seller.boolean
hideSellerProducts
(String username) Hides the products of a seller.loginSeller
(String username, String password) Validates the seller's login credentials.double
refundToBuyer
(int productId, int quantity) Initiates a refund to the buyer for a specific product and quantity.Registers a new seller.boolean
reopenSeller
(String username, String password) Reopens the seller's account after it was closed.boolean
sellerPaidPendingAmount
(double pendingAamount, String username, double income) Marks a pending amount as paid to the seller.boolean
unhideSellerProducts
(String username) Unhides the products of a seller.Updates the details of a seller.
-
Method Details
-
loginSeller
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
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
Retrieves the seller details based on the username.- Parameters:
username
- The username of the seller.- Returns:
- The seller object.
-
updateSellerDetails
Updates the details of a seller.- Parameters:
seller
- The updated seller object.- Returns:
- The updated seller details as a string.
-
registerNewSeller
Registers a new seller.- Parameters:
seller
- The seller object to register.- Returns:
- A success message upon successful registration.
-
getAllSellerProducts
Retrieves all products of a seller.- Parameters:
username
- The username of the seller.- Returns:
- A ResultSet containing all the products of the seller.
-
getAllSellerProductsOrderByQuantity
Retrieves all seller products ordered by quantity.- Parameters:
username
- The username of the seller.- Returns:
- A ResultSet containing the products.
-
unhideSellerProducts
Unhides the products of a seller.- Parameters:
username
- The username of the seller.- Returns:
true
if the products were successfully unhidden,false
otherwise.
-
hideSellerProducts
Hides the products of a seller.- Parameters:
username
- The username of the seller.- Returns:
true
if the products were successfully hidden,false
otherwise.
-
getSellerAllProductsByCategory
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
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
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
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
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
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
Retrieves the IDs of all products belonging to a seller.- Parameters:
username
- The username of the seller.- Returns:
- A list of product IDs.
-
getAllSellerProductsOrderByPrice
Retrieves all seller products ordered by price.- Parameters:
username
- The username of the seller.- Returns:
- A ResultSet containing the products.
-
sellerPaidPendingAmount
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.
-