Class Transaction

java.lang.Object
no.idata1002.group19.domain.entity.Transaction

@Entity public class Transaction extends Object
This class represent Transaction entity.
Since:
16.04.2023
Version:
16.04.2023
Author:
Group19
  • Constructor Details

    • Transaction

      public Transaction(String tname, int value, String description, LocalDate date, Budget budget)
      Default constructor for Transaction.
      Parameters:
      tname - the name of the transaction.
      value - the value of the transaction.
      description - description of the transaction.
      date - the date of the transaction.
    • Transaction

      public Transaction()
      Empty constructor that is needed for JPA
  • Method Details

    • getTid

      public long getTid()
      Returns the id of transaction.
      Returns:
      tid.
    • getTname

      public String getTname()
      Returns the name of the transaction.
      Returns:
      tname.
    • getValue

      public int getValue()
      Returns the value of the transaction.
      Returns:
      value.
    • getDescription

      public String getDescription()
      Returns the description of the transaction.
      Returns:
      transaction.
    • getDate

      public LocalDate getDate()
      Returns the date of the transaction.
      Returns:
      date.
    • setTid

      public void setTid(long tid)
      Setts the id of the transaction.
      Parameters:
      tid - the id you want for transaction.
    • setTname

      public void setTname(String tname)
      Setts the name fo the transaction.
      Parameters:
      tname - the name you want for transaction.
    • setValue

      public void setValue(int value)
      Setts the value of the transaction.
      Parameters:
      value - the vale you want for transaction.
    • setDescription

      public void setDescription(String description)
      Setts the description of the transaction.
      Parameters:
      description - the description you want for transaction.
    • setDate

      public void setDate(LocalDate date)
      Setts the date of the transaction.
      Parameters:
      date - the date you want for transaction.
    • getBudget

      public Budget getBudget()
    • setBudget

      public void setBudget(Budget budget)
    • isValid

      public boolean isValid()
      Checks if the transaction is valid.
      Returns:
      boolean statement. True if valid, false if not.