Class CustomerEventHandlerService
java.lang.Object
com.brodygaudel.bank.query.service.customer.CustomerEventHandlerService
Service class for handling customer-related events, such as creation, update, and deletion.
-
Constructor Summary
ConstructorDescriptionCustomerEventHandlerService
(CustomerRepository customerRepository) Constructs aCustomerEventHandlerService
with the specifiedCustomerRepository
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
on
(@NotNull CustomerCreatedEvent event) Handles theCustomerCreatedEvent
by creating a new customer entity and saving it to the repository.void
on
(@NotNull CustomerDeletedEvent event) Handles theCustomerDeletedEvent
by deleting an existing customer entity from the repository.void
on
(@NotNull CustomerUpdatedEvent event) Handles theCustomerUpdatedEvent
by updating an existing customer entity in the repository.
-
Constructor Details
-
CustomerEventHandlerService
Constructs aCustomerEventHandlerService
with the specifiedCustomerRepository
.- Parameters:
customerRepository
- The repository for managing customer data.
-
-
Method Details
-
on
Handles theCustomerCreatedEvent
by creating a new customer entity and saving it to the repository.- Parameters:
event
- TheCustomerCreatedEvent
to handle.
-
on
Handles theCustomerUpdatedEvent
by updating an existing customer entity in the repository.- Parameters:
event
- TheCustomerUpdatedEvent
to handle.
-
on
Handles theCustomerDeletedEvent
by deleting an existing customer entity from the repository.- Parameters:
event
- TheCustomerDeletedEvent
to handle.
-