Hello everybody
I have something like this for an update command:
@CommandHandler
public void handle(AccountUpdateCommand command) {
AccountUpdatedEvent event = new AccountUpdatedEvent(command.getAccountEventId(), command.getAccountId(), command.getFirstName(), command.getLastName(), command.getPhone());
apply(event);
}
@EventSourcingHandler
protected void on(AccountSavedEvent event) {
this.accountEventId = event.getAccountEventId();
this.firstName = event.getFirstName();
this.lastName = event.getLastName();
this.email = event.getEmail();
}
But how would be the best way to reflect a delete using an event:
@CommandHandler
public void handle(AccountUpdateCommand command) {
AccountDeleteEvent event = new AccountDeleteEvent(command.getAccountEventId(), command.getAccountId(), command.getFirstName(), command.getLastName(), command.getPhone());
apply(event);
}
@EventSourcingHandler
protected void on(AccountDeleteEvent event) {
????????
}
Could anyone help me, please?
Thanks in advance
Richard