Class CustomerAggregate
java.lang.Object
com.brodygaudel.bank.command.aggregate.CustomerAggregate
Aggregate representing a customer in the system.
This aggregate captures the state changes of a customer, including creation, update, and deletion events. It applies the events and updates its internal state accordingly.
-
Constructor Summary
ConstructorDescriptionDefault constructor for the CustomerAggregate.CustomerAggregate
(@NotNull CreateCustomerCommand command) Constructor for handling theCreateCustomerCommand
and applying the corresponding event. -
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(@NotNull DeleteCustomerCommand command) Command handler for handling theDeleteCustomerCommand
and applying the corresponding event.void
handle
(@NotNull UpdateCustomerCommand command) Command handler for handling theUpdateCustomerCommand
and applying the corresponding event.void
on
(@NotNull CustomerCreatedEvent event) Event sourcing handler for theCustomerCreatedEvent
.void
on
(@NotNull CustomerDeletedEvent event) Event sourcing handler for theCustomerDeletedEvent
.void
on
(@NotNull CustomerUpdatedEvent event) Event sourcing handler for theCustomerUpdatedEvent
.
-
Constructor Details
-
CustomerAggregate
public CustomerAggregate()Default constructor for the CustomerAggregate. -
CustomerAggregate
Constructor for handling theCreateCustomerCommand
and applying the corresponding event.- Parameters:
command
- TheCreateCustomerCommand
to handle.
-
-
Method Details
-
on
Event sourcing handler for theCustomerCreatedEvent
.- Parameters:
event
- TheCustomerCreatedEvent
to handle.
-
handle
Command handler for handling theUpdateCustomerCommand
and applying the corresponding event.- Parameters:
command
- TheUpdateCustomerCommand
to handle.
-
on
Event sourcing handler for theCustomerUpdatedEvent
.- Parameters:
event
- TheCustomerUpdatedEvent
to handle.
-
handle
Command handler for handling theDeleteCustomerCommand
and applying the corresponding event.- Parameters:
command
- TheDeleteCustomerCommand
to handle.
-
on
Event sourcing handler for theCustomerDeletedEvent
.- Parameters:
event
- TheCustomerDeletedEvent
to handle.
-