Class AccountQueryHandlerService
java.lang.Object
com.brodygaudel.bank.query.service.account.AccountQueryHandlerService
Service class for handling queries related to accounts and operations.
-
Constructor Summary
ConstructorDescriptionAccountQueryHandlerService
(AccountRepository accountRepository, OperationRepository operationRepository, Mappers mappers) Constructs anAccountQueryHandlerService
with the specified repositories and mappers. -
Method Summary
Modifier and TypeMethodDescriptionon
(@NotNull GetAccountByCustomerIdQuery query) Handles theGetAccountByCustomerIdQuery
by retrieving and mapping an account's details by customer ID.on
(@NotNull GetAccountByIdQuery query) Handles theGetAccountByIdQuery
by retrieving and mapping an account's details by ID.on
(@NotNull GetOperationByAccountIdQuery query) Handles theGetOperationByAccountIdQuery
by retrieving and mapping details of operations associated with an account.on
(@NotNull GetOperationByIdQuery query) Handles theGetOperationByIdQuery
by retrieving and mapping an operation's details by ID.on
(GetAllAccountsQuery query) Handles theGetAllAccountsQuery
by retrieving and mapping details of all accounts.
-
Constructor Details
-
AccountQueryHandlerService
public AccountQueryHandlerService(AccountRepository accountRepository, OperationRepository operationRepository, Mappers mappers) Constructs anAccountQueryHandlerService
with the specified repositories and mappers.- Parameters:
accountRepository
- The repository for retrieving account data.operationRepository
- The repository for retrieving operation data.mappers
- The mapper utility for converting entities to DTOs.
-
-
Method Details
-
on
Handles theGetAccountByIdQuery
by retrieving and mapping an account's details by ID.- Parameters:
query
- TheGetAccountByIdQuery
to handle.- Returns:
- A
AccountResponseDTO
containing the details of the requested account.
-
on
Handles theGetAccountByCustomerIdQuery
by retrieving and mapping an account's details by customer ID.- Parameters:
query
- TheGetAccountByCustomerIdQuery
to handle.- Returns:
- A
AccountResponseDTO
containing the details of the requested account.
-
on
Handles theGetAllAccountsQuery
by retrieving and mapping details of all accounts.- Parameters:
query
- TheGetAllAccountsQuery
to handle.- Returns:
- A list of
AccountResponseDTO
objects representing all accounts.
-
on
Handles theGetOperationByIdQuery
by retrieving and mapping an operation's details by ID.- Parameters:
query
- TheGetOperationByIdQuery
to handle.- Returns:
- An
OperationResponseDTO
containing the details of the requested operation.
-
on
@QueryHandler public List<OperationResponseDTO> on(@NotNull @NotNull GetOperationByAccountIdQuery query) Handles theGetOperationByAccountIdQuery
by retrieving and mapping details of operations associated with an account.- Parameters:
query
- TheGetOperationByAccountIdQuery
to handle.- Returns:
- A list of
OperationResponseDTO
objects representing operations associated with the account.
-