added new fields to TransferDetails
This commit is contained in:
@@ -53,7 +53,12 @@ public class AccountQueryWorkflow implements CompoundEventHandler {
|
||||
logger.info("**************** account version=" + fromAccountId + ", " + de.eventId().asString());
|
||||
logger.info("**************** account version=" + toAccountId + ", " + de.eventId().asString());
|
||||
|
||||
AccountTransactionInfo ti = new AccountTransactionInfo(moneyTransferId, fromAccountId, toAccountId, toIntegerRepr(de.event().getDetails().getAmount()));
|
||||
AccountTransactionInfo ti = new AccountTransactionInfo(moneyTransferId,
|
||||
fromAccountId,
|
||||
toAccountId,
|
||||
toIntegerRepr(de.event().getDetails().getAmount()),
|
||||
de.event().getDetails().getDate(),
|
||||
de.event().getDetails().getDescription());
|
||||
|
||||
|
||||
accountInfoUpdateService.addTransaction(eventId, fromAccountId, ti);
|
||||
|
||||
@@ -3,21 +3,31 @@ package net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.ac
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class AccountTransactionInfo {
|
||||
|
||||
private String transactionId;
|
||||
private String fromAccountId;
|
||||
private String toAccountId;
|
||||
private long amount;
|
||||
private Date date;
|
||||
private String description;
|
||||
|
||||
public AccountTransactionInfo() {
|
||||
}
|
||||
|
||||
public AccountTransactionInfo(String transactionId, String fromAccountId, String toAccountId, long amount) {
|
||||
this(transactionId, fromAccountId, toAccountId, amount, new Date(), "");
|
||||
}
|
||||
|
||||
public AccountTransactionInfo(String transactionId, String fromAccountId, String toAccountId, long amount, Date date, String description) {
|
||||
this.transactionId = transactionId;
|
||||
this.fromAccountId = fromAccountId;
|
||||
this.toAccountId = toAccountId;
|
||||
this.amount = amount;
|
||||
this.date = date;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getTransactionId() {
|
||||
@@ -52,6 +62,22 @@ public class AccountTransactionInfo {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(Date date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return EqualsBuilder.reflectionEquals(this, o);
|
||||
|
||||
Reference in New Issue
Block a user