Package passport.domain.models.purchases
Class Transaction
java.lang.Object
passport.domain.models.purchases.Transaction
- All Implemented Interfaces:
Entity<TransactionId>
Represents a transaction including payer, recipient, payment details, and
description.
-
Constructor Summary
ConstructorsConstructorDescriptionTransaction(Participant payer, Participant recipient, PaymentDetails payment, String description) Constructs a new Transaction with the specified payer, recipient, payment details, and description.Transaction(TransactionId id, Participant payer, Participant recipient, PaymentDetails payment, String description) Constructs a new Transaction with the specified ID, payer, recipient, payment details, and description. -
Method Summary
-
Constructor Details
-
Transaction
public Transaction(TransactionId id, Participant payer, Participant recipient, PaymentDetails payment, String description) Constructs a new Transaction with the specified ID, payer, recipient, payment details, and description.- Parameters:
id- the transaction IDpayer- the participant making the paymentrecipient- the participant receiving the paymentpayment- the payment detailsdescription- the description of the transaction
-
Transaction
public Transaction(Participant payer, Participant recipient, PaymentDetails payment, String description) Constructs a new Transaction with the specified payer, recipient, payment details, and description.- Parameters:
payer- the participant making the paymentrecipient- the participant receiving the paymentpayment- the payment detailsdescription- the description of the transaction
-
-
Method Details
-
id
Returns the transaction ID.- Specified by:
idin interfaceEntity<TransactionId>- Returns:
- the transaction ID
-
toEmail
Converts the transaction details to an email document.- Returns:
- the email document representing the transaction
-