Class Transaction

java.lang.Object
org.episteme.social.economics.money.Transaction
All Implemented Interfaces:
Serializable, Commented, ComprehensiveIdentification, Identified<Identification>, Named

public final class Transaction extends Object implements ComprehensiveIdentification
Represents a financial transaction between two parties.

A transaction records the exchange of money or shares between a seller and buyer, and can generate receipts for both parties.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Transaction

      public Transaction(Organization seller, Organization buyer, TimeCoordinate date, Identification id, String description, Money amount)
      Creates a money transaction.
      Parameters:
      seller - the selling organization
      buyer - the buying organization
      date - the transaction date
      description - transaction description
      amount - the monetary amount
      identification - unique transaction ID
    • Transaction

      public Transaction(Organization seller, Organization buyer, TimeCoordinate date, Identification id, String description, Share share, int quantity)
      Creates a share transaction.
      Parameters:
      seller - the selling organization
      buyer - the buying organization
      date - the transaction date
      description - transaction description
      share - the share being traded
      quantity - number of shares
      identification - unique transaction ID
  • Method Details

    • getId

      public Identification getId()
      Description copied from interface: Identified
      Returns the unique identifier of this entity.
      Specified by:
      getId in interface Identified<Identification>
      Returns:
      the identifier
    • getTraits

      public Map<String,Object> getTraits()
      Description copied from interface: ComprehensiveIdentification
      Returns the traits map for this entity.
      Specified by:
      getTraits in interface Commented
      Specified by:
      getTraits in interface ComprehensiveIdentification
      Returns:
      the traits map
    • getSeller

      public Organization getSeller()
    • getBuyer

      public Organization getBuyer()
    • getDate

      public TimeCoordinate getDate()
    • getIdentification

      public Identification getIdentification()
    • getDescription

      public String getDescription()
    • getAmount

      public Money getAmount()
    • getShare

      public Share getShare()
    • getQuantity

      public int getQuantity()
    • getStatus

      public TransactionStatus getStatus()
    • setStatus

      public void setStatus(TransactionStatus status)
      Updates the transaction status.
      Parameters:
      status - the new status
    • complete

      public void complete()
      Marks the transaction as completed.
    • cancel

      public void cancel()
      Marks the transaction as cancelled.
    • isMoneyTransaction

      public boolean isMoneyTransaction()
      Returns true if this is a money transaction.
      Returns:
      true for money transaction
    • isShareTransaction

      public boolean isShareTransaction()
      Returns true if this is a share transaction.
      Returns:
      true for share transaction
    • getTotalValue

      public Money getTotalValue()
      Calculates the total value of a share transaction.
      Returns:
      the total value (share price × quantity)
    • getReceipt

      public Receipt getReceipt()
      Generates a receipt for this transaction.
      Returns:
      the receipt
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object