Class AccountAggregate
java.lang.Object
com.brodygaudel.bank.command.aggregate.AccountAggregate
Aggregate representing an account in the system.
This aggregate captures the state changes of an account, including creation, activation, suspension, credit, and debit events. It applies the events and updates its internal state accordingly.
-
Constructor Summary
ConstructorDescriptionDefault constructor for the AccountAggregate.AccountAggregate
(@NotNull CreateAccountCommand command) Constructor for handling theCreateAccountCommand
and applying the corresponding event. -
Method Summary
Modifier and TypeMethodDescriptionvoid
on
(@NotNull ActiveAccountCommand command) Command handler for handling theActiveAccountCommand
and applying the corresponding event.void
on
(@NotNull CreditAccountCommand command) Command handler for handling theCreditAccountCommand
and applying the corresponding event.void
on
(@NotNull SuspendAccountCommand command) Command handler for handling theSuspendAccountCommand
and applying the corresponding event.void
on
(@NotNull AccountActivatedEvent event) Event sourcing handler for theAccountActivatedEvent
.void
on
(@NotNull AccountCreatedEvent event) Event sourcing handler for theAccountCreatedEvent
.void
on
(@NotNull AccountCreditedEvent event) Event sourcing handler for theAccountCreditedEvent
.void
on
(@NotNull AccountDebitedEvent event) Event sourcing handler for theAccountDebitedEvent
.void
on
(@NotNull AccountSuspendedEvent event) Event sourcing handler for theAccountSuspendedEvent
.void
on
(DebitAccountCommand command) Command handler for handling theDebitAccountCommand
and applying the corresponding event.
-
Constructor Details
-
AccountAggregate
public AccountAggregate()Default constructor for the AccountAggregate. -
AccountAggregate
Constructor for handling theCreateAccountCommand
and applying the corresponding event.- Parameters:
command
- TheCreateAccountCommand
to handle.
-
-
Method Details
-
on
Event sourcing handler for theAccountCreatedEvent
.- Parameters:
event
- TheAccountCreatedEvent
to handle.
-
on
Command handler for handling theDebitAccountCommand
and applying the corresponding event.- Parameters:
command
- TheDebitAccountCommand
to handle.
-
on
Event sourcing handler for theAccountDebitedEvent
.- Parameters:
event
- TheAccountDebitedEvent
to handle.
-
on
Command handler for handling theCreditAccountCommand
and applying the corresponding event.- Parameters:
command
- TheCreditAccountCommand
to handle.
-
on
Event sourcing handler for theAccountCreditedEvent
.- Parameters:
event
- TheAccountCreditedEvent
to handle.
-
on
Command handler for handling theActiveAccountCommand
and applying the corresponding event.- Parameters:
command
- TheActiveAccountCommand
to handle.
-
on
Event sourcing handler for theAccountActivatedEvent
.- Parameters:
event
- TheAccountActivatedEvent
to handle.
-
on
Command handler for handling theSuspendAccountCommand
and applying the corresponding event.- Parameters:
command
- TheSuspendAccountCommand
to handle.
-
on
Event sourcing handler for theAccountSuspendedEvent
.- Parameters:
event
- TheAccountSuspendedEvent
to handle.
-