Package entity

Class TransactionLog

java.lang.Object
entity.TransactionLog

public class TransactionLog extends Object
Represents a transaction log entry in the banking system. Stores details of deposit/withdrawal transactions, including metadata and audit info.

This class tracks balances before and after the transaction, the user who initiated it, and the status of the operation.

Author:
TAMIL
  • Field Details

  • Constructor Details

    • TransactionLog

      public TransactionLog()
      Default no argument constructor.
    • TransactionLog

      public TransactionLog(int accountNo, TransactionLog.TransactionType transactionType, BigDecimal amount, BigDecimal balanceBefore, BigDecimal balanceAfter, TransactionLog.TransactionStatus status)
      Constructs a basic transaction log entry.
      Parameters:
      accountNo - the account number involved
      transactionType - type of transaction (deposit or withdrawal)
      amount - the transaction amount
      balanceBefore - balance before transaction
      balanceAfter - balance after transaction
      status - transaction status (success or failed)
    • TransactionLog

      public TransactionLog(int accountNo, TransactionLog.TransactionType transactionType, BigDecimal amount, BigDecimal balanceBefore, BigDecimal balanceAfter, TransactionLog.TransactionStatus status, String description, Integer createdByUserId, TransactionLog.UserType createdByUserType)
      Constructs a transaction log entry with additional audit fields.
      Parameters:
      accountNo - the account number involved
      transactionType - type of transaction
      amount - the transaction amount
      balanceBefore - balance before transaction
      balanceAfter - balance after transaction
      status - transaction status
      description - optional transaction description
      createdByUserId - user ID of the person who created the transaction
      createdByUserType - type of user who initiated the transaction
  • Method Details

    • getTransactionId

      public Long getTransactionId()
      Gets the transaction ID.
      Returns:
      the transaction ID
    • setTransactionId

      public void setTransactionId(Long transactionId)
      Sets the transaction ID.
      Parameters:
      transactionId - the transaction ID
    • getAccountNo

      public int getAccountNo()
      Gets the account number involved in the transaction.
      Returns:
      the account number
    • setAccountNo

      public void setAccountNo(int accountNo)
      Sets the Account no.
      Parameters:
      accountNo - the accountNo
    • getTransactionType

      public TransactionLog.TransactionType getTransactionType()
      Gets the transaction type.
      Returns:
      the transaction type
    • setTransactionType

      public void setTransactionType(TransactionLog.TransactionType transactionType)
      Sets the transaction Type.
      Parameters:
      transactionType - the transaction Type
    • getAmount

      public BigDecimal getAmount()
      Gets the transaction amount.
      Returns:
      the amount
    • setAmount

      public void setAmount(BigDecimal amount)
      Sets the Amount.
      Parameters:
      amount - the amount to be set
    • getBalanceBefore

      public BigDecimal getBalanceBefore()
      Gets the balance before the transaction.
      Returns:
      the balance before transaction
    • setBalanceBefore

      public void setBalanceBefore(BigDecimal balanceBefore)
    • getBalanceAfter

      public BigDecimal getBalanceAfter()
      Gets the balance after the transaction.
      Returns:
      the balance after transaction
    • setBalanceAfter

      public void setBalanceAfter(BigDecimal balanceAfter)
      Sets the Balance after transaction.
      Parameters:
      balanceAfter - the balanceAfter transaction
    • getTransactionDate

      public LocalDateTime getTransactionDate()
      Gets the date and time of the transaction.
      Returns:
      the transaction date
    • setTransactionDate

      public void setTransactionDate(LocalDateTime transactionDate)
    • getStatus

      Gets the transaction status.
      Returns:
      the status
    • setStatus

      public void setStatus(TransactionLog.TransactionStatus status)
    • getDescription

      public String getDescription()
      Gets the optional transaction description.
      Returns:
      the description
    • setDescription

      public void setDescription(String description)
    • getCreatedByUserId

      public Integer getCreatedByUserId()
      Gets the user ID of the person who initiated the transaction.
      Returns:
      the creator user ID
    • setCreatedByUserId

      public void setCreatedByUserId(Integer createdByUserId)
    • getCreatedByUserType

      public TransactionLog.UserType getCreatedByUserType()
      Gets the user type of the person who created the transaction.
      Returns:
      the user type
    • setCreatedByUserType

      public void setCreatedByUserType(TransactionLog.UserType createdByUserType)
    • toString

      public String toString()
      Overrides:
      toString in class Object