Package com.masai.Dao

Class TransactionDaoImpl

java.lang.Object
com.masai.Dao.TransactionDaoImpl
All Implemented Interfaces:
TransactionDao

public class TransactionDaoImpl extends Object implements TransactionDao
  • Constructor Details

    • TransactionDaoImpl

      public TransactionDaoImpl()
  • Method Details

    • getAllTransactionIdByParticularBuyer

      public List<Integer> getAllTransactionIdByParticularBuyer(String buyerUsername)
      Retrieves all transaction IDs associated with a particular buyer.
      Specified by:
      getAllTransactionIdByParticularBuyer in interface TransactionDao
      Parameters:
      buyerUsername - The username of the buyer.
      Returns:
      A list of transaction IDs.
    • getProductNameAndProductIdAndQuantityAndDateByIdAndReturn

      public List<String> getProductNameAndProductIdAndQuantityAndDateByIdAndReturn(int id)
      Retrieves the product name, product ID, quantity, and date of a transaction by its ID and return status.
      Specified by:
      getProductNameAndProductIdAndQuantityAndDateByIdAndReturn in interface TransactionDao
      Parameters:
      id - The ID of the transaction.
      Returns:
      A list containing the product name, product ID, quantity, and date.
    • returnProductTransaction

      public boolean returnProductTransaction(ReturnProduct returnProduct)
      Processes the return of a product as a transaction.
      Specified by:
      returnProductTransaction in interface TransactionDao
      Parameters:
      returnProduct - The return product object.
      Returns:
      true if the return transaction was successfully processed, false otherwise.
    • alreadyReturnOrNot

      public String alreadyReturnOrNot(int transactionId)
      Retrieves the return type for a given transaction ID.
      Specified by:
      alreadyReturnOrNot in interface TransactionDao
      Parameters:
      transactionId - The transaction ID to check for return status.
      Returns:
      The return type ("YES" or "NO") for the specified transaction ID.