-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTransaction.java
More file actions
68 lines (55 loc) · 1.63 KB
/
Copy pathTransaction.java
File metadata and controls
68 lines (55 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package co.dapi.types;
import java.util.Optional;
public class Transaction {
private final float amount;
private final String date;
private final TransactionType type;
private final String description;
private final String details;
private final Currency currency;
private final Float beforeAmount;
private final Float afterAmount;
private final String reference;
public Transaction(float amount, String date, TransactionType type, String description, String details, Currency currency, Float beforeAmount, Float afterAmount, String reference) {
this.amount = amount;
this.date = date;
this.type = type;
this.description = description;
this.details = details;
this.currency = currency;
this.beforeAmount = beforeAmount;
this.afterAmount = afterAmount;
this.reference = reference;
}
public float getAmount() {
return amount;
}
public String getDate() {
return date;
}
public TransactionType getType() {
return type;
}
public String getDescription() {
return description;
}
public String getDetails() {
return details;
}
public Currency getCurrency() {
return currency;
}
public Optional<Float> getBeforeAmount() {
return Optional.ofNullable(beforeAmount);
}
public Optional<Float> getAfterAmount() {
return Optional.ofNullable(afterAmount);
}
public Optional<String> getReference() {
return Optional.ofNullable(reference);
}
public enum TransactionType {
credit,
debit
}
}