Class AccountQueryHandlerService
java.lang.Object
com.brodygaudel.bank.query.service.account.AccountQueryHandlerService
Service class for handling queries related to accounts and operations.
-
Constructor Summary
ConstructorsConstructorDescriptionAccountQueryHandlerService(AccountRepository accountRepository, OperationRepository operationRepository, Mappers mappers) Constructs anAccountQueryHandlerServicewith the specified repositories and mappers. -
Method Summary
Modifier and TypeMethodDescriptionon(@NotNull GetAccountByCustomerIdQuery query) Handles theGetAccountByCustomerIdQueryby retrieving and mapping an account's details by customer ID.on(@NotNull GetAccountByIdQuery query) Handles theGetAccountByIdQueryby retrieving and mapping an account's details by ID.on(@NotNull GetOperationByAccountIdQuery query) Handles theGetOperationByAccountIdQueryby retrieving and mapping details of operations associated with an account.on(@NotNull GetOperationByIdQuery query) Handles theGetOperationByIdQueryby retrieving and mapping an operation's details by ID.on(GetAllAccountsQuery query) Handles theGetAllAccountsQueryby retrieving and mapping details of all accounts.
-
Constructor Details
-
AccountQueryHandlerService
public AccountQueryHandlerService(AccountRepository accountRepository, OperationRepository operationRepository, Mappers mappers) Constructs anAccountQueryHandlerServicewith 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 theGetAccountByIdQueryby retrieving and mapping an account's details by ID.- Parameters:
query- TheGetAccountByIdQueryto handle.- Returns:
- A
AccountResponseDTOcontaining the details of the requested account.
-
on
Handles theGetAccountByCustomerIdQueryby retrieving and mapping an account's details by customer ID.- Parameters:
query- TheGetAccountByCustomerIdQueryto handle.- Returns:
- A
AccountResponseDTOcontaining the details of the requested account.
-
on
Handles theGetAllAccountsQueryby retrieving and mapping details of all accounts.- Parameters:
query- TheGetAllAccountsQueryto handle.- Returns:
- A list of
AccountResponseDTOobjects representing all accounts.
-
on
Handles theGetOperationByIdQueryby retrieving and mapping an operation's details by ID.- Parameters:
query- TheGetOperationByIdQueryto handle.- Returns:
- An
OperationResponseDTOcontaining the details of the requested operation.
-
on
@QueryHandler public List<OperationResponseDTO> on(@NotNull @NotNull GetOperationByAccountIdQuery query) Handles theGetOperationByAccountIdQueryby retrieving and mapping details of operations associated with an account.- Parameters:
query- TheGetOperationByAccountIdQueryto handle.- Returns:
- A list of
OperationResponseDTOobjects representing operations associated with the account.
-