-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Account.java
43 lines (28 loc) · 1.09 KB
/
Account.java
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
package net.chrisrichardson.ftgo.accountingservice.domain;
import io.eventuate.Event;
import io.eventuate.ReflectiveMutableCommandProcessingAggregate;
import io.eventuate.tram.sagas.eventsourcingsupport.SagaReplyRequestedEvent;
import java.util.Collections;
import java.util.List;
import static io.eventuate.EventUtil.events;
public class Account extends ReflectiveMutableCommandProcessingAggregate<Account, AccountCommand> {
public List<Event> process(CreateAccountCommand command) {
return events(new AccountCreatedEvent());
}
public void apply(AccountCreatedEvent event) {
}
public List<Event> process(AuthorizeCommandInternal command) {
return events(new AccountAuthorizedEvent());
}
public List<Event> process(ReverseAuthorizationCommandInternal command) {
return Collections.emptyList();
}
public List<Event> process(ReviseAuthorizationCommandInternal command) {
return Collections.emptyList();
}
public void apply(AccountAuthorizedEvent event) {
}
public void apply(SagaReplyRequestedEvent event) {
// TODO - need a way to not need this method
}
}