Skip to content

Commit

Permalink
feat(be): Added javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
mamartinezmejia committed Nov 25, 2024
1 parent 74e30d4 commit 6c03a7d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ public Flux<ClientPublicViewDto> searchClients(
.putIfAbsent(ApplicationConstants.X_TOTAL_COUNT, List.of(dto.getCount().toString())));
}

/**
* Searches for clients based on the provided parameters using a fuzzy match algorithm.
* The search is case-insensitive and has a threshold cutout of 0.8 for the fuzzy match.
*
* @param page the one-based page number to retrieve, defaults to 0 if not provided.
* @param size the number of results per page, defaults to 10 if not provided.
* @param name the name of the client to search for (optional).
* @param acronym the acronym of the client to search for (optional).
* @param number the unique number of the client to search for (optional).
* @param serverResponse the {@link ServerHttpResponse} to include response headers.
* @return a reactive stream of {@link ClientPublicViewDto} objects representing matching
* clients.

Check warning on line 130 in src/main/java/ca/bc/gov/api/oracle/legacy/controller/ClientSearchController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagContinuationIndentationCheck

Line continuation have incorrect indentation level, expected level should be 4.
*
* @apiNote This method provides a paginated, fuzzy search for client details. Results
* include a total record count in the response headers under {@code X-Total-Count}.

Check warning on line 133 in src/main/java/ca/bc/gov/api/oracle/legacy/controller/ClientSearchController.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagContinuationIndentationCheck

Line continuation have incorrect indentation level, expected level should be 4.
*/
@GetMapping("/by")
@Operation(
summary = "Search for clients",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ public Flux<ClientPublicViewDto> searchClientByQuery(
.doOnNext(client -> log.info("Found client with id {}", client.getClientNumber()));
}

/**
* Constructs a search {@link Criteria} object based on the provided client name, acronym, or
* number.
* This method normalizes input values for case-insensitive searches and validates the client
* number.
*
* @param name the name of the client to search for, or null if not specified.
* @param acronym the acronym of the client to search for, or null if not specified.
* @param number the unique number of the client to search for, or null if not specified.
* @return a {@link Mono} emitting the constructed {@link Criteria} object for the search.
*
* @implNote Input values are transformed to uppercase for case-insensitivity. The client
* number is validated using {@link #checkClientNumber(String)}. Repository results are

Check warning on line 124 in src/main/java/ca/bc/gov/api/oracle/legacy/service/ClientSearchService.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagContinuationIndentationCheck

Line continuation have incorrect indentation level, expected level should be 4.
* mapped to a search criteria object.

Check warning on line 125 in src/main/java/ca/bc/gov/api/oracle/legacy/service/ClientSearchService.java

View workflow job for this annotation

GitHub Actions / Checkstyle

com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagContinuationIndentationCheck

Line continuation have incorrect indentation level, expected level should be 4.
*/
public Mono<Criteria> searchByAcronymNameNumber(String name, String acronym, String number) {
log.info("Searching for clients with name {}, acronym {} or number {}", name, acronym, number);

Expand Down

0 comments on commit 6c03a7d

Please sign in to comment.