49 lines
1.1 KiB
Java
49 lines
1.1 KiB
Java
package me.zacharias.bank.transaction;
|
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalTime;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.util.UUID;
|
|
|
|
public class Transaction {
|
|
private double amount;
|
|
private String description;
|
|
private UUID originator;
|
|
private UUID destination;
|
|
private TransactionType type;
|
|
private String date;
|
|
|
|
public Transaction(double amount, String description, UUID destination, UUID originator, TransactionType type) {
|
|
this.amount = amount;
|
|
this.description = description;
|
|
this.originator = originator;
|
|
this.destination = destination;
|
|
this.type = type;
|
|
date = LocalDateTime.now().format(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm"));
|
|
}
|
|
|
|
public double getAmount() {
|
|
return amount;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public UUID getOriginator() {
|
|
return originator;
|
|
}
|
|
|
|
public UUID getDestination() {
|
|
return destination;
|
|
}
|
|
|
|
public TransactionType getType() {
|
|
return type;
|
|
}
|
|
|
|
public String getDate() {
|
|
return date;
|
|
}
|
|
}
|